/* ============================================================
   GenePeak — Ortak aroma sunum ve seçim katmanı

   Çok aromalı kartlarda açılır ikon seçici; tek/sabit aromalı kartlarda
   salt okunur ikon + ad sunar. PDP'nin mevcut aroma seçicisi ayrı kalır.
   Hızlı satın alma kartının (storefront.js buildCard) boyut ve aroma
   çipleri de buradadır: kart sayfaları bu dosyayı zaten yükler.
   ============================================================ */

/* ---------- Ürün kartı satırı (/urunler ve dinamik Shopify kartları) ---------- */
.gp-fb {
    display: flex; align-items: center; gap: 9px;
    margin: 0 0 10px; min-height: 30px; line-height: 1;
}
.gp-fb__img {
    display: block; width: 30px; height: 30px; flex: none;
    aspect-ratio: 1 / 1; object-fit: cover; border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 1px var(--line, #dbe3f7);
}
.gp-fb__text { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.gp-fb__eyebrow {
    font: 700 10px/1 'Inter', sans-serif;
    letter-spacing: .09em; text-transform: uppercase;
    color: rgba(0, 71, 171, .62); flex: none;
}
.gp-fb__name {
    font: 600 12.5px/1.2 'Inter', sans-serif;
    color: #434653; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
/* Sabit aromalı ürünlerde tek-varyant metadata satırı ("VARYANT 336 GR")
   gizlenir; aroma satırı kimliği zaten veriyor. Satır Tailwind'in .flex
   utility'sini taşıdığı için HTML [hidden] niteliği yetmez — bu kural
   yeterli önceliği garanti eder. */
[data-variant-meta][data-gp-fb-hide-meta] { display: none !important; }

/* Görsel yüklenemezse yalnızca görsel kaldırılır, metin kalır. */
.gp-fb[data-img-failed="1"] .gp-fb__img { display: none; }

/* ---------- Çok aromalı ürün kartı: açılır ikon seçici ---------- */
.gp-cf { position: relative; margin: 0 0 10px; }
.gp-cf__trigger {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%; min-height: 50px; padding: 7px 11px;
    border: 1px solid var(--line, #dbe3f7); border-radius: 10px;
    background: #fff; color: var(--ink, #0d1c32); text-align: left;
    cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
    -webkit-tap-highlight-color: transparent;
}
.gp-cf__trigger:hover { border-color: var(--icy-300, #b1c5ff); }
.gp-cf__trigger:focus-visible {
    outline: 2px solid var(--cobalt-500, #0a57c9); outline-offset: 2px;
}
.gp-cf[data-open="1"] .gp-cf__trigger {
    border-color: var(--cobalt-700, #0047ab);
    box-shadow: 0 0 0 3px rgba(0,71,171,.11);
    background: #fbfdff;
}
.gp-cf__current { display: flex; align-items: center; gap: 9px; min-width: 0; }
.gp-cf__current-img {
    display: block; width: 30px; height: 30px; flex: none;
    border-radius: 50%; object-fit: cover; background: #fff;
    box-shadow: 0 0 0 1px var(--line, #dbe3f7);
}
.gp-cf__current-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gp-cf__eyebrow {
    font: 700 8.5px/1 'Inter', sans-serif; letter-spacing: .1em;
    text-transform: uppercase; color: rgba(0,71,171,.67);
}
.gp-cf__current-name {
    font: 650 12.5px/1.1 'Inter', sans-serif; color: var(--ink, #0d1c32);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gp-cf__chevron {
    flex: none; font-size: 20px; color: #52627a;
    transition: transform .18s ease;
}
.gp-cf[data-open="1"] .gp-cf__chevron { transform: rotate(180deg); }
.gp-cf__panel {
    margin-top: 8px; padding: 12px 10px 11px;
    border: 1px solid var(--line, #dbe3f7); border-radius: 12px;
    background: #f8faff; box-shadow: 0 10px 24px rgba(0,36,91,.08);
}
.gp-cf__panel[hidden] { display: none !important; }
.gp-cf__fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.gp-cf__grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
    align-items: start; gap: 12px 7px;
}
.gp-cf__item {
    position: relative; display: flex; flex-direction: column; align-items: center;
    gap: 6px; min-width: 0; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.gp-cf__input {
    position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 48px; height: 48px; margin: 0; opacity: 0; pointer-events: none;
    appearance: none; -webkit-appearance: none;
}
.gp-cf__swatch {
    position: relative; display: block; width: 48px; height: 48px; flex: none;
    border-radius: 50%; background: #fff;
    box-shadow: 0 0 0 1px var(--line, #dbe3f7);
    transition: transform .18s ease, box-shadow .18s ease;
}
.gp-cf__swatch img {
    display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
}
.gp-cf__input:checked ~ .gp-cf__swatch {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--cobalt-700, #0047ab);
}
.gp-cf__tick {
    position: absolute; right: -2px; bottom: -2px; width: 17px; height: 17px;
    border-radius: 50%; background: var(--cobalt-700, #0047ab);
    box-shadow: 0 0 0 2px #fff; opacity: 0; transform: scale(.55);
    transition: opacity .16s ease, transform .16s ease;
}
.gp-cf__tick::after {
    content: ""; position: absolute; left: 5.5px; top: 3px; width: 3.5px; height: 7px;
    border: solid #fff; border-width: 0 1.7px 1.7px 0; transform: rotate(45deg);
}
.gp-cf__input:checked ~ .gp-cf__swatch .gp-cf__tick { opacity: 1; transform: scale(1); }
.gp-cf__input:focus-visible ~ .gp-cf__swatch {
    outline: 2px solid var(--cobalt-500, #0a57c9); outline-offset: 4px;
}
.gp-cf__item[data-unavailable="1"]:focus-visible { outline: none; }
.gp-cf__item[data-unavailable="1"]:focus-visible .gp-cf__swatch {
    outline: 2px solid var(--cobalt-500, #0a57c9); outline-offset: 4px;
}
.gp-cf__name {
    max-width: 100%; font: 600 10px/1.2 'Inter', sans-serif; color: #434653;
    text-align: center; overflow-wrap: anywhere;
}
.gp-cf__input:checked ~ .gp-cf__name { color: var(--cobalt-700, #0047ab); }
.gp-cf__sold { display: none; }
.gp-cf__item[data-unavailable="1"] { cursor: not-allowed; }
.gp-cf__item[data-unavailable="1"] .gp-cf__swatch img { filter: grayscale(.62); opacity: .56; }
.gp-cf__item[data-unavailable="1"] .gp-cf__name { color: #737c8d; }
.gp-cf__item[data-unavailable="1"] .gp-cf__swatch::after {
    content: ""; position: absolute; left: 50%; top: 50%; width: 50px; height: 1.5px;
    border-radius: 2px; background: #7a8294; transform: translate(-50%,-50%) rotate(-45deg);
}
.gp-cf__item[data-unavailable="1"] .gp-cf__sold {
    display: block; margin-top: -3px; font: 700 8px/1 'Inter', sans-serif;
    letter-spacing: .04em; text-transform: uppercase; color: #737c8d; text-align: center;
}
.gp-cf__swatch[data-img-failed="1"] { background: var(--silver, #e8eeff); }
.gp-cf__swatch[data-img-failed="1"] img { display: none; }
[data-gp-cf-native], [data-gp-cf-native-label] { display: none !important; }

@media (hover: hover) {
    .gp-cf__item:not([data-unavailable="1"]):hover .gp-cf__swatch { transform: translateY(-2px); }
}

/* ---------- Hızlı satın alma kartı: boyut ve aroma çipleri ----------
   storefront.js buildCard çizer. Seçenekler kartın alt bloğunda, "Sepete
   Ekle"nin hemen üstündedir; satırdaki kartların düğmeleri hizalı kalır.
   Dokunma hedefleri en az 40 px (mobil deste ve iki sütunlu ızgara dahil). */
.gp-qc { display: grid; gap: 12px; }
.gp-qc[hidden] { display: none !important; }
.gp-qc__group { min-width: 0; }
.gp-qc__label {
    display: flex; align-items: baseline; gap: 7px; min-width: 0; margin: 0 0 8px;
    font: 700 10px/1.2 'Inter', sans-serif; letter-spacing: .09em;
    text-transform: uppercase; color: rgba(0, 71, 171, .62);
}
.gp-qc__current {
    min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
    font: 600 12.5px/1.2 'Inter', sans-serif; letter-spacing: 0;
    text-transform: none; color: #434653;
}
.gp-qc__chips { display: flex; flex-wrap: wrap; gap: 8px; }
/* Tek gramajlı ürün: seçim yok, "BOYUT 300 GR" salt okunur satır. */
.gp-qc__fixed { margin: 0; }
/* Sabit aroma rozeti hızlı kartta boyut satırından sonra gelir; aralıklar
   çip gruplarıyla aynı (12 px), düğmeye mesafeyi düğmenin kendi payı verir. */
[data-gp-quick-card] .gp-fb { margin: 0; }
[data-gp-quick-card] .gp-qc:not([hidden]) + .gp-fb { margin-top: 12px; }

/* Metin çipi: boyut, görseli eşlenmemiş aroma ve diğer seçenekler. */
.gp-qc__chip {
    display: inline-flex; flex: 1 1 0; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; min-width: 64px; min-height: 40px; margin: 0; padding: 6px 10px;
    border: 1px solid var(--line, #dbe3f7); border-radius: 8px;
    background: #fff; color: var(--ink, #0d1c32);
    font: 600 13px/1.15 'Inter', sans-serif; text-align: center;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}
.gp-qc__chip-text { max-width: 100%; overflow-wrap: anywhere; }
.gp-qc__chip[aria-pressed="true"] {
    border-color: var(--cobalt-700, #0047ab); background: #f3f7ff; color: var(--cobalt-700, #0047ab);
    box-shadow: inset 0 0 0 1px var(--cobalt-700, #0047ab);
}
.gp-qc__chip:focus-visible { outline: 2px solid var(--cobalt-500, #0a57c9); outline-offset: 2px; }
.gp-qc__chip:disabled { border-style: dashed; background: #f7f9fd; color: #8a93a6; cursor: not-allowed; }
.gp-qc__chip[aria-pressed="true"]:disabled {
    border-style: solid; border-color: #8a93a6; box-shadow: inset 0 0 0 1px #8a93a6; color: #5b6475;
}
.gp-qc__chip-status {
    font: 700 8.5px/1 'Inter', sans-serif; letter-spacing: .04em;
    text-transform: uppercase; color: #737c8d;
}

/* Görselli aroma çipi: data/flavors.json ikonu; seçili aromanın adı grup başlığında. */
.gp-qc__swatch {
    position: relative; display: block; flex: none; width: 44px; height: 44px;
    margin: 0; padding: 0; border: 0; border-radius: 50%; background: #fff;
    box-shadow: 0 0 0 1px var(--line, #dbe3f7);
    cursor: pointer; -webkit-tap-highlight-color: transparent;
    transition: transform .18s ease, box-shadow .18s ease;
}
.gp-qc__swatch img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.gp-qc__swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--cobalt-700, #0047ab); }
.gp-qc__swatch:focus-visible { outline: 2px solid var(--cobalt-500, #0a57c9); outline-offset: 5px; }
.gp-qc__tick {
    position: absolute; right: -3px; bottom: -3px; width: 17px; height: 17px;
    border-radius: 50%; background: var(--cobalt-700, #0047ab);
    box-shadow: 0 0 0 2px #fff; opacity: 0; transform: scale(.55);
    transition: opacity .16s ease, transform .16s ease;
}
.gp-qc__tick::after {
    content: ""; position: absolute; left: 5.5px; top: 3px; width: 3.5px; height: 7px;
    border: solid #fff; border-width: 0 1.7px 1.7px 0; transform: rotate(45deg);
}
.gp-qc__swatch[aria-pressed="true"] .gp-qc__tick { opacity: 1; transform: scale(1); }
.gp-qc__swatch:disabled { cursor: not-allowed; }
.gp-qc__swatch:disabled img { filter: grayscale(.62); opacity: .5; }
.gp-qc__swatch:disabled::after {
    content: ""; position: absolute; left: 50%; top: 50%; width: 46px; height: 1.5px;
    border-radius: 2px; background: #7a8294; transform: translate(-50%, -50%) rotate(-45deg);
}
.gp-qc__swatch-text { display: none; }
/* Görsel yüklenemezse aromanın adı dairenin içinde okunur. */
.gp-qc__swatch[data-img-failed="1"] { background: var(--silver, #e8eeff); }
.gp-qc__swatch[data-img-failed="1"] img { display: none; }
.gp-qc__swatch[data-img-failed="1"] .gp-qc__swatch-text {
    position: absolute; inset: 0; display: grid; place-items: center; padding: 4px; overflow: hidden;
    font: 700 8.5px/1.1 'Inter', sans-serif; color: #434653; text-align: center;
}

@media (hover: hover) {
    .gp-qc__chip:not(:disabled):not([aria-pressed="true"]):hover { border-color: var(--icy-300, #b1c5ff); }
    .gp-qc__swatch:not(:disabled):hover { transform: translateY(-2px); }
}
@media (max-width: 430px) {
    .gp-qc__chips { gap: 7px; }
    .gp-qc__chip { min-width: 56px; padding-inline: 8px; font-size: 12.5px; }
}

/* ---------- PDP kimlik bloğu ---------- */
.gp-fb-pdp {
    display: flex; align-items: center; gap: 14px;
    margin: 0 0 18px; padding: 0;
}
.gp-fb-pdp__img {
    display: block; width: 56px; height: 56px; flex: none;
    aspect-ratio: 1 / 1; object-fit: cover; border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 1px var(--line, #dbe3f7);
}
.gp-fb-pdp__text { min-width: 0; }
.gp-fb-pdp__eyebrow {
    display: block;
    font: 700 11px/1 'Inter', sans-serif;
    letter-spacing: .09em; text-transform: uppercase;
    color: rgba(0, 71, 171, .7); margin-bottom: 5px;
}
.gp-fb-pdp__name {
    display: block;
    font: 600 16px/1.25 'Inter', sans-serif;
    color: var(--ink, #0d1c32);
}
.gp-fb-pdp__note {
    display: block; margin-top: 3px;
    font: 400 12px/1.4 'Inter', sans-serif;
    color: #6b7280;
}
.gp-fb-pdp[data-img-failed="1"] .gp-fb-pdp__img { display: none; }

@media (max-width: 430px) {
    /* Mobil kartlarda aroma adı KISALTILMAZ. "Tropikal Meyve" gibi uzun adlar
       gerekirse iki satıra sarılır; AROMA etiketi tek satır kalır. Kart
       hizası korunur: satır yukarıdan hizalanır, buton .mt-auto ile altta kalır. */
    .gp-fb { align-items: flex-start; min-height: 0; }
    .gp-fb__img { margin-top: 1px; }
    .gp-fb__text { align-items: flex-start; min-width: 0; }
    .gp-fb__eyebrow { white-space: nowrap; line-height: 1.3; padding-top: 2px; }
    .gp-fb__name {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.3;
        overflow-wrap: anywhere;
    }

    .gp-cf__trigger { padding-inline: 9px; }
    .gp-cf__current { gap: 7px; }
    .gp-cf__current-name { max-width: 68px; font-size: 11.5px; }
    .gp-cf__panel { padding: 11px 8px 10px; }
    .gp-cf__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 6px; }
    .gp-cf__swatch, .gp-cf__input { width: 44px; height: 44px; }
    .gp-cf__item[data-unavailable="1"] .gp-cf__swatch::after { width: 46px; }
    .gp-cf__name { font-size: 9.5px; }

    .gp-fb-pdp { gap: 12px; }
    .gp-fb-pdp__img { width: 50px; height: 50px; }
    .gp-fb-pdp__name { font-size: 15px; }
}

/* ---------- Yüksek kontrast ---------- */
@media (forced-colors: active) {
    .gp-fb__img, .gp-fb-pdp__img, .gp-cf__current-img, .gp-cf__swatch, .gp-qc__swatch { forced-color-adjust: none; }
    .gp-cf__input:checked ~ .gp-cf__swatch { outline: 3px solid Highlight; outline-offset: 2px; }
    .gp-qc__swatch[aria-pressed="true"], .gp-qc__chip[aria-pressed="true"] { outline: 3px solid Highlight; outline-offset: 2px; }
}

@media (prefers-reduced-motion: reduce) {
    .gp-cf__trigger, .gp-cf__chevron, .gp-cf__swatch, .gp-cf__tick { transition: none; }
    .gp-cf__item:hover .gp-cf__swatch { transform: none; }
    .gp-qc__chip, .gp-qc__swatch, .gp-qc__tick { transition: none; }
    .gp-qc__swatch:hover { transform: none; }
}
/* Ortak LANSMAN rozeti: tüm ürün ve hazır paket görsellerinde aynı kare. */
.gp-promo-host { position: relative; }
.gp-promo-badge { position: absolute; top: 0; right: 0; z-index: 5; display: grid; align-content: center; justify-items: center; gap: 3px; width: 60px; height: 60px; padding: 8px; box-sizing: border-box; border: 0; border-radius: 0; background: #d82a1b; color: #fff; text-align: center; pointer-events: none; }
.gp-promo-badge[hidden] { display: none !important; }
.gp-promo-badge strong { font: 800 22px/1.1 'Inter', sans-serif; letter-spacing: -.02em; white-space: nowrap; }
.gp-promo-badge small { font: 700 8px/1.2 'Inter', sans-serif; letter-spacing: .03em; }
.gph-result__promo { position: relative; flex: 0 0 60px; width: 60px; height: 60px; }
@media (max-width: 599px) {
    .gp-promo-badge { width: 46px; height: 46px; padding: 6px; gap: 3px; }
    .gp-promo-badge strong { font-size: 16px; }
    .gp-promo-badge small { font-size: 6.5px; }
    .gph-result__promo { flex-basis: 46px; width: 46px; height: 46px; }
}
