/* =========================================
   FANTOUKIS - "Personalize it" box on the product page
   -----------------------------------------
   The customer's choices (colors and text boxes) set up in the admin.
   product-options.js builds the steps; this file decides how they look.
   Colors and fonts come from the variables at the top of style.css.
   ========================================= */

.product-options {
    position: relative;
    background: var(--white, #FFFFFF);
    border: 1px solid var(--line, rgba(43, 34, 48, 0.12));
    border-radius: 22px;
    padding: 26px 26px 22px;
    margin: 8px 0 24px;
    box-shadow: 0 18px 40px rgba(43, 34, 48, 0.07);
    overflow: hidden;
}

/* A soft pastel stripe along the top of the box */
.product-options::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--pink, #F7C6D6), var(--yellow, #FFE9A8), var(--mint, #C4EBDF));
}

.product-options[hidden] { display: none; }

.product-options .options-title {
    font-size: 24px;
    margin: 4px 0 4px;
}

.product-options .options-intro {
    color: var(--muted, #6B5E66);
    font-size: 15px;
    line-height: 1.5;
    margin: 0 0 6px;
}

/* ----- The list of steps ----- */
.product-options .options-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: block;
}

.product-options .option {
    padding: 18px 0;
    border-top: 1px dashed var(--line, rgba(43, 34, 48, 0.12));
    border-radius: 0;
    background: none;
}

.product-options .option:first-child { border-top: none; }
.product-options .option:last-child { padding-bottom: 4px; }

/* Undo the browser's default box around color questions */
.product-options .option-fieldset {
    border: none;
    padding: 0;
    margin: 0;
    min-width: 0;
}

/* ----- Step number + question ----- */
.product-options .option-label {
    float: left;          /* keeps the question inside the step, not on its border */
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    margin: 0 0 4px;
    font-family: var(--font-heading, sans-serif);
    font-weight: 600;
    font-size: 18px;
    color: var(--ink, #2B2230);
}

.product-options .option-fieldset > *:not(legend) { clear: both; }

.product-options .option-label .optional {
    font-family: var(--font-body, sans-serif);
    font-weight: 400;
    font-size: 14px;
    color: var(--muted, #6B5E66);
}

.product-options .option-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--mint, #C4EBDF);
    color: var(--ink, #2B2230);
    font-size: 15px;
    transition: background 0.25s ease, color 0.25s ease, transform 0.35s var(--spring, ease);
}

/* Once a step is answered, its number turns pink */
.product-options .option:has(input[type="radio"]:checked) .option-step,
.product-options .option:has(input[type="text"]:not(:placeholder-shown)) .option-step {
    background: var(--accent, #D9467A);
    color: var(--white, #FFFFFF);
    transform: scale(1.06);
}

.product-options .option-help {
    color: var(--muted, #6B5E66);
    font-size: 15px;
    line-height: 1.5;
    margin: 0 0 12px 42px;
}

/* ----- Colors: round chips with the color and its name ----- */
.product-options .swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0 0 42px;
}

.product-options .swatch {
    position: relative;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 6px 16px 6px 6px;
    border: 1.5px solid var(--line, rgba(43, 34, 48, 0.12));
    border-radius: 999px;
    background: var(--cream, #FFF8F1);
    cursor: pointer;
    user-select: none;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.3s var(--spring, ease), box-shadow 0.2s ease;
}

/* (only with a mouse: on phones a "hover" lift could look like a tap that didn't count) */
@media (hover: hover) {
    .product-options .swatch:hover {
        border-color: rgba(43, 34, 48, 0.3);
        transform: translateY(-2px);
    }
}
.product-options .swatch { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* The real round button is hidden; the chip is what people tap */
.product-options .swatch input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}

.product-options .swatch-dot {
    position: relative;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--swatch);
    border: none;
    box-shadow: inset 0 0 0 1.5px rgba(43, 34, 48, 0.14);
    transform: none;
    animation: none;
    transition: transform 0.35s var(--spring, ease);
}

.product-options .swatch-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--ink, #2B2230);
}

/* Multiple choice answers: the same chips, without a color dot */
.product-options .swatch-answer { padding: 10px 20px; }
/* An answer with its own price, e.g. "Large  €13" */
.product-options .swatch-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent, #D9467A);
    background: #FFF0F5;
    border-radius: 999px;
    padding: 2px 8px;
    margin-right: -8px;
}
.product-options .swatch:has(input:checked) .swatch-price { background: var(--white, #FFFFFF); }

/* Photo step: a big friendly "Attach a photo" button */
.product-options .photo-drop { margin: 10px 0 0 42px; }
.product-options .photo-pick {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 18px;
    border: 2px dashed rgba(217, 70, 122, 0.35);
    border-radius: 18px;
    background: var(--cream, #FFF8F1);
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, transform .3s var(--spring, ease);
}
@media (hover: hover) { .product-options .photo-pick:hover { border-color: var(--accent, #D9467A); background: #FFF0F5; transform: translateY(-2px); } }
.product-options .photo-pick:focus-within { outline: 2px solid var(--ink, #2B2230); outline-offset: 2px; }
.product-options .photo-pick input,
.product-options .photo-link input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.product-options .photo-pick-icon {
    flex: 0 0 auto; width: 46px; height: 46px; border-radius: 14px;
    display: grid; place-items: center;
    background: var(--pink, #F7C6D6); color: var(--accent, #D9467A);
}
.product-options .photo-pick-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.product-options .photo-pick-text { display: flex; flex-direction: column; gap: 2px; }
.product-options .photo-pick-text strong { font-size: 15.5px; color: var(--ink, #2B2230); }
.product-options .photo-pick-text small { font-size: 13.5px; color: var(--muted, #6B5E66); }

.product-options .photo-attached {
    display: flex; align-items: center; gap: 14px;
    padding: 8px 16px 8px 8px;
    border: 1.5px solid var(--accent, #D9467A);
    border-radius: 18px;
    background: #FFF0F5;
    box-shadow: 0 6px 16px rgba(217, 70, 122, 0.14);
    animation: options-pop 0.35s var(--spring, ease);
}
.product-options .photo-attached img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; background: #FCE4EC; }
.product-options .photo-attached-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.product-options .photo-attached-text strong { font-size: 15px; color: var(--ink, #2B2230); }
.product-options .photo-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.product-options .photo-link {
    position: relative; padding: 0; border: none; background: none; cursor: pointer;
    font: inherit; font-size: 14px; font-weight: 700; color: var(--accent, #D9467A);
    text-decoration: underline; text-underline-offset: 3px;
}
.product-options .photo-progress { display: block; width: 140px; height: 6px; border-radius: 99px; background: rgba(217, 70, 122, 0.15); overflow: hidden; }
.product-options .photo-progress i { display: block; width: 40%; height: 100%; border-radius: 99px; background: var(--accent, #D9467A); animation: photo-busy 1.1s ease-in-out infinite; }
.product-options .photo-attached.is-busy img { opacity: .6; }
@keyframes photo-busy { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.product-options .option.has-photo .option-step { background: var(--accent, #D9467A); color: var(--white, #FFFFFF); }
.product-options .option.is-invalid .photo-pick { border-color: var(--danger, #C2334D); animation: options-nudge 0.4s ease; }

/* The chosen color */
.product-options .swatch:has(input:checked) {
    border-color: var(--accent, #D9467A);
    background: #FFF0F5;
    box-shadow: 0 6px 16px rgba(217, 70, 122, 0.18);
}

.product-options .swatch input:checked + .swatch-dot {
    transform: scale(0.92);
    box-shadow: inset 0 0 0 1.5px rgba(43, 34, 48, 0.14), 0 0 0 2px var(--white, #FFFFFF), 0 0 0 3.5px var(--accent, #D9467A);
    animation: options-pop 0.35s var(--spring, ease);
}

.product-options .swatch input:checked ~ .swatch-name {
    font-weight: 700;
    color: var(--ink, #2B2230);
}

.product-options .swatch input:focus-visible + .swatch-dot {
    box-shadow: inset 0 0 0 1.5px rgba(43, 34, 48, 0.14), 0 0 0 2px var(--white, #FFFFFF), 0 0 0 3.5px var(--ink, #2B2230);
}

/* ----- Text boxes ----- */
.product-options .option-input {
    position: relative;
    margin: 10px 0 0 42px;
}

.product-options .option-input input {
    width: 100%;
    font-family: var(--font-body, sans-serif);
    font-size: 16px;   /* 16px stops phones from zooming in */
    color: var(--ink, #2B2230);
    background: var(--cream, #FFF8F1);
    border: 1.5px solid var(--line, rgba(43, 34, 48, 0.12));
    border-radius: 14px;
    padding: 13px 70px 13px 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.product-options .option-input input::placeholder { color: #A99DA4; }

.product-options .option-input input:hover { border-color: rgba(43, 34, 48, 0.3); }

.product-options .option-input input:focus {
    outline: none;
    background: var(--white, #FFFFFF);
    border-color: var(--accent, #D9467A);
    box-shadow: 0 0 0 4px rgba(217, 70, 122, 0.15);
}

.product-options .option-counter {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--muted, #6B5E66);
    background: var(--white, #FFFFFF);
    border-radius: 999px;
    padding: 2px 8px;
    pointer-events: none;
}

/* ----- Something missing ----- */
.product-options .option.is-invalid .option-step {
    background: var(--accent, #D9467A);
    color: var(--white, #FFFFFF);
}

.product-options .option.is-invalid .option-input input {
    border-color: var(--accent, #D9467A);
    background: #FFF0F4;
    animation: options-nudge 0.4s ease;
}

.product-options .option.is-invalid .swatch {
    border-color: rgba(217, 70, 122, 0.45);
}

.product-options .option.is-invalid .swatches {
    animation: options-nudge 0.4s ease;
}

.product-options .option-error {
    color: var(--accent-dark, #B8335F);
    font-weight: 600;
    font-size: 14px;
    margin: 10px 0 0 42px;
}

.product-options .option-error[hidden],
.product-options .form-error[hidden] { display: none; }

.product-options .form-error {
    color: var(--accent-dark, #B8335F);
    font-weight: 600;
    font-size: 15px;
    background: #FFF0F4;
    border-radius: 12px;
    padding: 10px 14px;
    margin: 14px 0 0;
}

@keyframes options-pop {
    0%   { transform: scale(0.7); }
    100% { transform: scale(0.92); }
}

@keyframes options-nudge {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-4px); }
    75%      { transform: translateX(4px); }
}

/* ----- Phones ----- */
@media (max-width: 600px) {
    .product-options {
        padding: 22px 16px 18px;
        border-radius: 18px;
    }

    .product-options .option-help,
    .product-options .swatches,
    .product-options .option-input,
    .product-options .photo-drop,
    .product-options .option-error {
        margin-left: 0;
    }

    .product-options .swatch {
        padding-right: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-options *,
    .product-options *::before {
        animation: none !important;
        transition: none !important;
    }
}

/* =========================================
   PHONE FIX: products with many photos
   A grid column grows to fit its widest content, so a long row of
   thumbnails (e.g. 9 photos) made the whole page wider than the phone
   screen. min-width: 0 lets the columns shrink, and the thumbnail row
   scrolls sideways inside its own box instead.
   ========================================= */
.product-layout > .gallery,
.product-layout > .product-info { min-width: 0; }
.gallery-thumbs { max-width: 100%; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.product-info h1 { overflow-wrap: anywhere; }

/* =========================================
   FOLLOW-UP QUESTIONS AND ANSWER ICONS
   ========================================= */
/* A follow-up question slides in when it starts to apply */
.product-options .option.is-appearing {
    animation: followup-in 0.45s var(--spring, ease) both;
}
@keyframes followup-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: none; }
}

/* A small icon next to an answer's name (e.g. a dog or a cat decal) */
.product-options .swatch-answer.has-icon { padding: 6px 18px 6px 8px; }
.product-options .swatch-icon {
    width: 30px;
    height: 30px;
    flex: none;
    object-fit: contain;
    border-radius: 8px;
    background: var(--white, #FFFFFF);
    box-shadow: inset 0 0 0 1px rgba(43, 34, 48, 0.08);
    padding: 2px;
    transition: transform 0.35s var(--spring, ease);
}
.product-options .swatch input:checked ~ .swatch-icon { transform: scale(1.08); }
/* Answers with a small photo of the product (e.g. each brand keychain): a bigger, square photo */
.product-options .swatch-answer.has-photo { padding: 5px 16px 5px 5px; }
.product-options .swatch-note { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted, #6B5E66); margin-top: 1px; }
.product-options .swatch-answer.has-photo .swatch-icon { width: 46px; height: 46px; object-fit: cover; padding: 0; border-radius: 10px; }

@media (prefers-reduced-motion: reduce) {
    .product-options .option.is-appearing { animation: none; }
}

/* ----- "Pick more than one" questions: tick boxes ----- */
.product-options .option-multi-hint { font-size: 13.5px; font-weight: 600; color: var(--muted, #6B5E66); margin: 2px 0 -2px 42px; }
@media (max-width: 600px) { .product-options .option-multi-hint { margin-left: 0; } }
.product-options .swatch-answer.is-multi { padding-left: 12px; }
.product-options .swatch-answer.is-multi.has-icon { padding-left: 10px; }
.product-options .swatch-tick {
    flex: none; width: 20px; height: 20px; border-radius: 6px;
    border: 2px solid var(--border-strong, #CFC7D3); background: var(--white, #FFFFFF);
    display: grid; place-items: center; transition: background 0.15s, border-color 0.15s;
}
.product-options .swatch-tick::after {
    content: ""; width: 10px; height: 6px; margin-top: -2px;
    border-left: 2.5px solid var(--white, #FFFFFF); border-bottom: 2.5px solid var(--white, #FFFFFF);
    transform: rotate(-45deg) scale(0); transition: transform 0.2s cubic-bezier(.34, 1.56, .64, 1);
}
.product-options .swatch input:checked ~ .swatch-tick { background: var(--accent, #D9467A); border-color: var(--accent, #D9467A); }
.product-options .swatch input:checked ~ .swatch-tick::after { transform: rotate(-45deg) scale(1); }
.product-options .swatch.is-full { opacity: 0.45; cursor: not-allowed; }
.product-options .pick-count {
    display: inline-block; margin-left: 6px; padding: 1px 9px; border-radius: 999px;
    background: var(--cream, #FFF6EC); border: 1px solid var(--border, #EADFD8); font-size: 12.5px; font-weight: 700;
}
.product-options .pick-count.is-done { background: #E2F5EA; border-color: #A9DEC2; color: #1F7A4D; }
.product-options .swatch input:focus-visible ~ .swatch-tick { box-shadow: 0 0 0 3px rgba(217, 70, 122, 0.3); }

/* ----- Wholesale box on every custom product (product.js renderWholesale) ----- */
.product-wholesale {
    display: flex; gap: 12px; align-items: flex-start; margin: 14px 0 6px; padding: 14px 16px;
    background: var(--yellow, #FFE9A8); border: 2.5px solid var(--ink, #2B2230); border-radius: 20px; box-shadow: 0 4px 0 var(--ink, #2B2230);
}
.product-wholesale[hidden] { display: none !important; }
.product-wholesale-icon { font-size: 34px; line-height: 1; flex: none; }
.product-wholesale-text { min-width: 0; flex: 1; }
.product-wholesale-text strong { display: block; font-family: var(--font-heading, inherit); font-size: 19px; line-height: 1.2; }
.product-wholesale-text p { margin: 2px 0 10px; font-weight: 600; }
.product-wholesale-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.product-wholesale-buttons .btn { padding: 8px 18px; font-size: 15px; margin: 0; }

/* ----- Big photo cards (every photo step, e.g. "What kind?" and "Choose the design"): see the product properly before picking ----- */
.product-options .swatches.is-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
@media (max-width: 600px) { .product-options .swatches.is-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.product-options .swatch-answer.is-card {
    flex-direction: column; align-items: stretch; gap: 6px;
    padding: 6px 6px 10px; border-radius: 18px; text-align: center;
}
.product-options .swatch-answer.is-card .swatch-icon {
    width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover;
    border-radius: 13px; padding: 0; background: var(--white, #FFFFFF);
}
.product-options .swatch-answer.is-card input:checked ~ .swatch-icon { transform: none; }
.product-options .swatch-answer.is-card .swatch-name { font-size: 14px; line-height: 1.25; padding: 0 4px; }
.product-options .swatch-answer.is-card .swatch-price { align-self: center; margin: 0; }
.product-options .swatch-answer.is-card .swatch-tick { position: absolute; top: 12px; left: 12px; z-index: 1; background: var(--white, #FFFFFF); }
.product-options .swatch-answer.is-card:has(input:checked) { box-shadow: 0 0 0 2px var(--accent, #D9467A); }

/* Finder for long lists (e.g. Pokémon): search box + group chips */
.product-options .option-finder { margin: 4px 0 12px 42px; display: grid; gap: 10px; }
@media (max-width: 600px) { .product-options .option-finder { margin-left: 0; } }
.product-options .finder-search { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; padding: 12px 14px 12px 40px; border-radius: 14px; border: 2px solid var(--line, #EADFD6); background: var(--white, #FFFFFF) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%236B5E66' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='M12.5 12.5 17 17'/%3E%3C/svg%3E") no-repeat 14px center; }
.product-options .finder-search:focus { outline: none; border-color: var(--pink, #E8457C); }
.product-options .finder-groups { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.product-options .finder-groups::-webkit-scrollbar { display: none; }
.product-options .finder-group { flex: none; font: inherit; font-size: 14px; font-weight: 700; padding: 7px 14px; border-radius: 999px; border: 2px solid var(--line, #EADFD6); background: var(--white, #FFFFFF); color: var(--ink, #2B2027); cursor: pointer; }
.product-options .finder-group[aria-pressed="true"] { background: var(--ink, #2B2027); border-color: var(--ink, #2B2027); color: var(--white, #FFFFFF); }
.product-options .finder-none { margin: 0; font-size: 14px; color: var(--muted, #6B5E66); }
.product-options .finder-more { display: block; margin: 12px auto 0; font: inherit; font-weight: 700; font-size: 15px; padding: 10px 22px; border-radius: 999px; border: 2px solid var(--ink, #2B2027); background: var(--white, #FFFFFF); color: var(--ink, #2B2027); cursor: pointer; }
.product-options .finder-more[hidden] { display: none; }

/* Tap-to-add cards (option.repeat): tap again to add the same one twice, "−" takes one off */
.count-card { position: relative; cursor: pointer; user-select: none; -webkit-user-select: none; }
.count-card.is-picked { border-color: var(--berry, #8A2C6E); box-shadow: 0 0 0 2px var(--berry, #8A2C6E) inset; }
.count-card .count-badge:empty, .count-card:not(.is-picked) .count-minus { display: none; }
.count-card .count-badge {
    position: absolute; top: 8px; right: 8px; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 999px;
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px;
    background: var(--berry, #8A2C6E); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.count-card .count-minus {
    position: absolute; top: 8px; left: 8px; width: 34px; height: 34px; border-radius: 999px; border: 2px solid var(--berry, #8A2C6E);
    background: #fff; color: var(--berry, #8A2C6E); font-size: 22px; font-weight: 800; line-height: 1; cursor: pointer; padding: 0;
}
.count-card.is-full { opacity: .45; }
