/**
 * DurmaPlay — Premium Gift Card rollout
 * Scope: missing Gift Card main/category-listing pages in every locale.
 * Excludes: existing Steam main + Google Play TL pilots, Top Up, Game Currency,
 * Game Key, Xbox Game Pass, Steam Account and PlayStation account products.
 * Rollback: disable/remove this single stylesheet link.
 * No JavaScript or theme-core dependency.
 */

@supports selector(body:has(*)) {
  /* Five landing pages. Matching the small, immutable head is much cheaper than
     repeatedly searching every category card and lazy-loaded image in the body. */
  :is(
    html:has(head link[rel="alternate"][hreflang="tr"][href="https://www.durmaplay.com/itunes-gift-card"]),
    html:has(head link[rel="alternate"][hreflang="tr"][href="https://www.durmaplay.com/google-play-gift-card"]),
    html:has(head link[rel="alternate"][hreflang="tr"][href="https://www.durmaplay.com/razer-gold"]),
    html:has(head link[rel="alternate"][hreflang="tr"][href="https://www.durmaplay.com/playstation-network-card"])
  ) body.categories-body,
  html:has(head link[rel="alternate"][hreflang="tr"][href="https://www.durmaplay.com/xbox-hediye-karti"]) body.categories-body:has(.card-category) {
    --gcr-gold-light: #efd590;
    --gcr-panel: #111318;
    --gcr-text: #f7f8fa;
    --gcr-border: rgba(201, 161, 77, 0.3);
    --gcr-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);

    & .p-g-mod-body {
      display: flex;
      flex-direction: column;
      container: gcr / inline-size;
    }

    & .p-g-mod-body > h1:first-child {
      order: 1;
      position: relative;
      overflow: hidden;
      margin: 0 0 24px !important;
      padding: 38px 36px !important;
      border: 1px solid var(--gcr-border);
      border-radius: 22px;
      color: var(--gcr-text) !important;
      background:
        radial-gradient(circle at 86% 14%, rgba(201, 161, 77, 0.18), transparent 35%),
        linear-gradient(135deg, #111317, #090b0e 64%, #0d0f12);
      box-shadow: 0 22px 60px rgba(0, 0, 0, 0.3);
      font-size: clamp(30px, 3vw, 46px) !important;
      font-weight: 850 !important;
      letter-spacing: -0.035em;
    }

    & .p-g-mod-body > h1:first-child::before {
      content: "PREMIUM DIGITAL GIFT CARD";
      display: block;
      width: max-content;
      margin-bottom: 14px;
      padding: 7px 11px;
      border: 1px solid rgba(201, 161, 77, 0.38);
      border-radius: 999px;
      color: var(--gcr-gold-light);
      background: rgba(201, 161, 77, 0.09);
      font-size: 10px;
      font-weight: 850;
      letter-spacing: 0.14em;
    }

    & .category-short-description {
      order: 3;
      margin-top: 4px;
    }

    & .xbg-global-cat,
    & .rzgold-cat {
      display: contents;
    }

    & .xg-hero,
    & .rzgold-hero {
      order: 1;
      position: relative;
      isolation: isolate;
      min-height: 250px;
      overflow: hidden;
      margin: 0 0 24px !important;
      padding: 42px 38px !important;
      border: 1px solid var(--gcr-border) !important;
      border-radius: 22px !important;
      background:
        radial-gradient(circle at 84% 18%, rgba(201, 161, 77, 0.18), transparent 36%),
        linear-gradient(135deg, #111317 0%, #17130c 54%, #0e1014 100%) !important;
      box-shadow: 0 22px 60px rgba(0, 0, 0, 0.3) !important;
    }

    & .xg-hero h1,
    & .rzgold-hero h1 {
      max-width: 780px;
      margin: 0 auto 13px !important;
      color: var(--gcr-text) !important;
      font-size: clamp(30px, 3.4vw, 48px) !important;
      font-weight: 850 !important;
      letter-spacing: -0.035em;
    }

    & .xg-hero p,
    & .rzgold-hero p {
      max-width: 800px;
      margin: 0 auto 22px !important;
      color: #cbd1da !important;
      font-size: 15px !important;
      line-height: 1.75 !important;
    }

    & .category-pg-inner {
      order: 2;
      margin: 0 0 28px;
      padding: 26px;
      border: 1px solid rgba(255, 255, 255, 0.075);
      border-radius: 22px;
      background: linear-gradient(180deg, rgba(24, 27, 32, 0.97), rgba(13, 15, 18, 0.97));
      box-shadow: var(--gcr-shadow);
    }

    & .category-pg-inner::before {
      content: "Dijital Kart Seçenekleri";
      display: block;
      margin: 0 0 20px;
      color: var(--gcr-text);
      font-size: 25px;
      font-weight: 800;
      letter-spacing: -0.025em;
    }

    & .category-pg-inner > .row {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 16px;
      margin: 0;
    }

    & .category-pg-inner > .row > [class*="col-"] {
      width: auto;
      max-width: none;
      padding: 0;
    }

    & .card-category {
      position: relative;
      display: flex;
      height: 100%;
      min-width: 0;
      overflow: hidden;
      border: 1px solid rgba(255, 255, 255, 0.09) !important;
      border-radius: 16px !important;
      background: var(--gcr-panel) !important;
      box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
      transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
    }

    & .card-category::before {
      content: "DIGITAL CODE";
      position: absolute;
      z-index: 2;
      top: 10px;
      left: 10px;
      padding: 6px 8px;
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 999px;
      color: #fff;
      background: rgba(8, 10, 13, 0.76);
      font-size: 8px;
      font-weight: 850;
      letter-spacing: 0.1em;
    }

    & .card-category .image {
      aspect-ratio: 1 / 1;
      width: 100%;
      height: auto;
      overflow: hidden;
      background: #0c0e12;
    }

    & .card-category .image > a,
    & .card-category .image img {
      display: block;
      width: 100%;
      height: 100%;
    }

    & .card-category .image img {
      object-fit: cover;
      transition: transform 260ms ease;
    }

    & .card-category .title {
      min-height: 58px;
      margin: 0 !important;
      padding: 15px 12px !important;
      border-top: 1px solid rgba(255, 255, 255, 0.07);
      color: var(--gcr-text) !important;
      background: linear-gradient(180deg, #171a20, #101216) !important;
      font-size: 13px !important;
      font-weight: 750 !important;
      line-height: 1.35 !important;
      text-align: center;
    }

    & .card-category:hover {
      z-index: 2;
      border-color: rgba(201, 161, 77, 0.62) !important;
      box-shadow: 0 18px 38px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(201, 161, 77, 0.12);
      transform: translateY(-5px);
    }

    & .card-category:hover .image img {
      transform: scale(1.045);
    }
  }

  /* Xbox and Razer already provide their own hero; avoid descendant :has(). */
  :is(
    html:has(head link[rel="alternate"][hreflang="tr"][href="https://www.durmaplay.com/razer-gold"]),
    html:has(head link[rel="alternate"][hreflang="tr"][href="https://www.durmaplay.com/xbox-hediye-karti"])
  ) body.categories-body:has(.card-category) {
    & .p-g-mod-body > h1:first-child {
      display: none;
    }

    & .category-short-description {
      display: contents;
    }
  }

  /* Listing pages. Only immutable Turkish hreflang metadata is inspected; no
     product grid, image or account/game exclusion scan is needed anymore. */
  :is(
    html:has(head link[rel="alternate"][hreflang="tr"][href^="https://www.durmaplay.com/steam-wallet-"]),
    html:has(head link[rel="alternate"][hreflang="tr"][href^="https://www.durmaplay.com/itunes-"]:not([href="https://www.durmaplay.com/itunes-gift-card"])),
    html:has(head link[rel="alternate"][hreflang="tr"]:is([href="https://www.durmaplay.com/google-play-hediye-karti-usd"], [href="https://www.durmaplay.com/google-play-hediye-karti-eur"])),
    html:has(head link[rel="alternate"][hreflang="tr"]:is([href="https://www.durmaplay.com/razer-gold-tl"], [href="https://www.durmaplay.com/razer-gold-usd"])),
    html:has(head link[rel="alternate"][hreflang="tr"][href^="https://www.durmaplay.com/xbox-"]:not([href*="game-pass"]):not([href*="xbox-oyun"]):not([href*="xbox-game"]):not([href="https://www.durmaplay.com/xbox-hediye-karti"])),
    html:has(head link[rel="alternate"][hreflang="tr"][href^="https://www.durmaplay.com/playstation-"]:not([href*="playstation-plus-"]):not([href*="playstation-oyun"]):not([href="https://www.durmaplay.com/playstation-network-card"])),
    html:has(head link[rel="alternate"][hreflang="tr"]:is([href="https://www.durmaplay.com/amazon-gift-card"], [href="https://www.durmaplay.com/netflix"], [href="https://www.durmaplay.com/spotify"], [href="https://www.durmaplay.com/nintendo-usd"], [href="https://www.durmaplay.com/nintendo-eur"], [href="https://www.durmaplay.com/hediyen-kart"], [href="https://www.durmaplay.com/netease-usd-hediye-karti"], [href="https://www.durmaplay.com/gcash-gift-card"], [href="https://www.durmaplay.com/gocash-giftcard"]))
  ) body.categories-body,
  html:has(head link[rel="alternate"][hreflang="tr"][href="https://www.durmaplay.com/xbox-hediye-karti"]) body.categories-body:has(.card-product) {
    --gcr-accent-soft: #efd590;
    --gcr-page-bg: #050607;
    --gcr-text: #f8fafc;
    --gcr-border: rgba(255, 255, 255, 0.09);
    --gcr-border-strong: rgba(201, 161, 77, 0.58);
    --gcr-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
    --gcr-shadow-hover: 0 24px 60px rgba(44, 32, 10, 0.4);
    background: var(--gcr-page-bg);

    & .p-g-mod-body {
      display: flex;
      flex-direction: column;
      container: gcr / inline-size;
    }

    & .p-g-mod-body > h1:first-child {
      order: 1;
      position: relative;
      overflow: hidden;
      margin: 0 0 20px !important;
      padding: 32px 34px !important;
      border: 1px solid rgba(201, 161, 77, 0.28);
      border-radius: 20px;
      color: var(--gcr-text) !important;
      background:
        radial-gradient(circle at 84% 18%, rgba(201, 161, 77, 0.18), transparent 35%),
        linear-gradient(135deg, #111419 0%, #090b0f 62%, #0d0f12 100%);
      box-shadow: 0 20px 56px rgba(0, 0, 0, 0.28);
      font-size: clamp(28px, 2.7vw, 42px) !important;
      font-weight: 820 !important;
      line-height: 1.15 !important;
      letter-spacing: -0.03em;
    }

    & .p-g-mod-body > h1:first-child::before {
      content: "DIGITAL GIFT CARD";
      display: block;
      width: max-content;
      margin-bottom: 12px;
      padding: 6px 10px;
      border: 1px solid rgba(201, 161, 77, 0.38);
      border-radius: 999px;
      color: var(--gcr-accent-soft);
      background: rgba(201, 161, 77, 0.09);
      font-size: 9px;
      font-weight: 850;
      letter-spacing: 0.14em;
    }

    & .p-g-mod-body > .d-none.d-lg-block,
    & .p-g-mod-body > .d-none.d-lg-none {
      order: 2;
    }

    & .p-g-mod-body > .d-none.d-lg-block {
      margin: 0 0 18px !important;
      padding: 12px 14px !important;
      border: 1px solid var(--gcr-border);
      border-radius: 14px;
      background: linear-gradient(180deg, #16191e, #111317);
      box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    }

    & .category-filter-order-desktop {
      height: 40px !important;
      border: 1px solid rgba(255, 255, 255, 0.1) !important;
      border-radius: 10px !important;
      color: #f4f6f8 !important;
      background-color: #20242a !important;
      box-shadow: none !important;
      font-size: 12px !important;
    }

    & .p-g-mod-body > .row {
      order: 3;
      display: grid !important;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 18px;
      margin: 0 0 30px !important;
    }

    & .p-g-mod-body > .row > .s-c-list {
      display: block !important;
      width: auto !important;
      max-width: none !important;
      margin: 0 !important;
      padding: 0 !important;
    }

    & .category-short-description {
      order: 4;
    }

    & .card-product {
      height: 100%;
      margin: 0 !important;
      overflow: hidden !important;
      border: 1px solid var(--gcr-border) !important;
      border-radius: 18px !important;
      background: linear-gradient(180deg, #121419 0%, #0d0f12 100%) !important;
      box-shadow: var(--gcr-shadow) !important;
      transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease !important;
    }

    & .card-product:hover {
      z-index: 2;
      border-color: var(--gcr-border-strong) !important;
      box-shadow: var(--gcr-shadow-hover) !important;
      transform: translateY(-5px);
    }

    & .card-product .card-product-inner {
      display: flex !important;
      height: 100%;
      padding: 15px !important;
      flex-direction: column !important;
      gap: 12px;
    }

    & .card-product .image-wrapper {
      position: relative;
      overflow: hidden;
      border: 1px solid rgba(255, 255, 255, 0.07);
      border-radius: 13px !important;
      background: #090b0e !important;
    }

    & .card-product .image-wrapper::before {
      content: "OFFICIAL DIGITAL CODE";
      position: absolute;
      z-index: 3;
      top: 9px;
      left: 9px;
      padding: 6px 8px;
      border: 1px solid rgba(255, 255, 255, 0.13);
      border-radius: 999px;
      color: #fff;
      background: rgba(7, 9, 12, 0.76);
      font-size: 7px;
      font-weight: 850;
      letter-spacing: 0.1em;
    }

    & .card-product .image img {
      transition: transform 240ms ease !important;
    }

    & .card-product:hover .image img {
      transform: scale(1.035);
    }

    & .card-product .title {
      height: 46px !important;
      margin-bottom: 8px !important;
      color: var(--gcr-text) !important;
      font-size: 14px !important;
      font-weight: 750 !important;
      line-height: 1.5 !important;
    }

    & .card-product .nitelik-inline {
      display: flex !important;
      min-height: 28px;
      flex-wrap: wrap;
      gap: 6px;
    }

    & .card-product .nitelik-inline span {
      padding: 5px 7px !important;
      border: 1px solid rgba(201, 161, 77, 0.18) !important;
      border-radius: 999px !important;
      color: #d8dde5 !important;
      background: rgba(201, 161, 77, 0.065) !important;
      font-size: 9px !important;
      font-weight: 700 !important;
    }

    & .card-product .price-group {
      display: flex !important;
      height: 46px !important;
      margin-top: auto !important;
      padding: 0 11px !important;
      align-items: center;
      border: 1px solid rgba(255, 255, 255, 0.07) !important;
      border-radius: 11px !important;
      background: linear-gradient(180deg, #1a1d23, #12151a) !important;
    }

    & .card-product .price-group .prices,
    & .card-product .price-group .sale-price {
      color: var(--gcr-accent-soft) !important;
      font-size: 18px !important;
      font-weight: 850 !important;
    }

    & .card-product .card-bottom-actions {
      display: grid !important;
      grid-template-columns: minmax(86px, 0.42fr) minmax(0, 1fr);
      gap: 9px;
    }

    & .card-product .product-quantity,
    & .card-product .buttons .btn-cart {
      border-radius: 11px !important;
    }

    & .card-product .product-quantity {
      overflow: hidden;
      border: 1px solid rgba(255, 255, 255, 0.08) !important;
      background: #15181d !important;
    }

    & .card-product .buttons .btn-cart {
      height: 44px !important;
      border: 1px solid rgba(239, 213, 144, 0.24) !important;
      color: #111 !important;
      background: linear-gradient(135deg, #efd590, #c9a14d 58%, #ad8132) !important;
      box-shadow: 0 10px 24px rgba(118, 82, 17, 0.25) !important;
      font-size: 11px !important;
      font-weight: 850 !important;
      letter-spacing: 0.015em;
    }

    & .card-product .buttons .btn-cart:hover {
      background: linear-gradient(135deg, #f4dda0, #d0aa58 58%, #b78936) !important;
      transform: translateY(-1px);
    }
  }

  @container gcr (max-width: 1199.98px) {
    .category-pg-inner > .row {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .p-g-mod-body > .row {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }

  @container gcr (max-width: 767.98px) {
    .p-g-mod-body > h1:first-child {
      padding: 26px 20px !important;
      border-radius: 17px;
      font-size: 27px !important;
      line-height: 1.16 !important;
    }

    .category-pg-inner {
      padding: 16px;
      border-radius: 17px;
    }

    .category-pg-inner > .row,
    .p-g-mod-body > .row {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }

    .card-product {
      border-radius: 15px !important;
    }

    .card-product .card-product-inner {
      padding: 10px !important;
      gap: 9px;
    }

    .card-product .title {
      height: 38px !important;
      font-size: 12px !important;
    }

    .card-product .price-group {
      height: 42px !important;
      padding: 0 9px !important;
    }

    .card-product .price-group .prices,
    .card-product .price-group .sale-price {
      font-size: 15px !important;
    }

    .card-product .card-bottom-actions {
      grid-template-columns: 1fr;
      gap: 8px;
    }

    .card-product .buttons .btn-cart {
      height: 40px !important;
      font-size: 9px !important;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    @container gcr (min-width: 0px) {
      .card-category,
      .card-category img,
      .card-product,
      .card-product img,
      .card-product .btn-cart {
        transition: none !important;
      }
    }
  }
}