/*
 * [offers] v2 — «πρώτα το μέγεθος» (concarda_offers_v2() στο functions.php, js/offers.js), 2026-10-24.
 * Τύπος (κουμπιά με την κονκάρδα του τύπου) → μεγέθη σε πραγματική αναλογία → πακέτα σαν εισιτήρια.
 * Όλα κάτω από .coff2 (η σελίδα κειμένου — css/page.css .cpage-prose ul / li / h3 / a — δεν πρέπει να τα αλλάζει).
 * Χωρίς JS: όλα τα πακέτα ανοιχτά, ομαδοποιημένα · με JS (.is-js): ένας τύπος, ένα μέγεθος τη φορά.
 */

.coff2 {
    --coff2-ease: cubic-bezier(.2, .8, .2, 1);
    margin: 1.4em 0 2em;
}

.coff2-label {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--cc-text);
}

.coff2 :is(button, a):focus-visible {
    outline: 3px solid var(--cc-dark);
    outline-offset: 2px;
}

/* χωρίς JS τα κουμπιά δεν κάνουν τίποτα — φαίνονται μόνο οι ομάδες */
.coff2:not(.is-js) :is(.coff2-sizes, .coff2-label, .coff2-selectwrap) {
    display: none;
}

.coff2.is-js .coff2-group[data-off],
.coff2.is-js .coff2-panel:not(.is-on) {
    display: none;
}

/* ---------- Τύπος: η ΚΟΙΝΗ επιλογή τύπου (templates/newShop/typesel.twig · css/site.css .ns-typesel) — πριν 2026-10-24 κουμπιά-chips .coff2-type ---------- */
.coff2 span.coff2-label {
    display: block;
}

.coff2-selectwrap {
    max-width: 460px;
    margin: 0 0 26px;
}

/* ---------- Λωρίδα μεγεθών με οριζόντια κύλιση: .coff2-rail από το js/offers.js ----------
   Να φαίνεται ότι κυλάνε (χρήστης 2026-10-24): σβήσιμο στην άκρη που έχει κι άλλα + στρογγυλά βελάκια ‹ › όπως η λωρίδα του header.
   data-at = start | middle | end · χωρίς data-at = χωράνε όλα (τίποτα από τα δύο) */
.coff2-rail {
    position: relative;
}

.coff2-rail[data-at="start"] > :first-child {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent);
}

.coff2-rail[data-at="middle"] > :first-child {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 56px, #000 calc(100% - 56px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 56px, #000 calc(100% - 56px), transparent);
}

.coff2-rail[data-at="end"] > :first-child {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 56px);
    mask-image: linear-gradient(90deg, transparent, #000 56px);
}

.coff2 button.coff2-arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: none;
    place-items: center;
    width: 36px;
    height: 36px;
    margin-top: -18px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--cc-dark);
    font-size: 20px;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(20, 24, 25, .18), 0 6px 14px -6px rgba(20, 24, 25, .45);
    transition: opacity .2s var(--coff2-ease), transform .2s var(--coff2-ease);
}

.coff2-rail[data-at] > .coff2-arrow {
    display: grid;
}

.coff2 button.coff2-arrow:active {
    transform: scale(.92);
}

.coff2-arrow-prev {
    left: 0;
}

.coff2-arrow-next {
    right: 0;
}

.coff2-rail[data-at="start"] > .coff2-arrow-prev,
.coff2-rail[data-at="end"] > .coff2-arrow-next {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

/* το κάτω περιθώριο της λωρίδας περνά στο .coff2-rail: τα βελάκια στο κέντρο των κουμπιών, όχι λωρίδα + περιθώριο */
.coff2-rail > .coff2-sizes {
    margin-bottom: 0;
}

.coff2-rail-sizes {
    margin-bottom: 24px;
}

/* ---------- Μέγεθος: οι κονκάρδες σε πραγματική αναλογία (--w / --h από το PHP) ---------- */
.coff2-sizes {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    margin: 0 0 24px;
    padding: 4px 2px 6px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.coff2-size {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 76px;
    padding: 10px 8px 8px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--cc-text);
    transition: background-color .2s var(--coff2-ease);
}

.coff2-dot {
    position: relative;
    display: block;
    width: var(--w);
    height: var(--h);
    border-radius: 50%;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 0 0 2px #fff, 0 2px 3px rgba(20, 24, 25, .2), 0 7px 12px -5px rgba(20, 24, 25, .4);
    transition: transform .26s var(--coff2-ease), box-shadow .26s var(--coff2-ease);
}

.coff2-size.is-rect .coff2-dot {
    border-radius: 8px;
}

.coff2-dot img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.coff2-size.is-rect .coff2-dot img {
    transform: scale(1.12);
}

.coff2-mm {
    font-size: 15px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.coff2-size small {
    font-size: 12px;
    font-weight: 600;
    color: var(--cc-muted);
}

.coff2-size:hover {
    background: var(--cc-yellow-tint);
}

.coff2-size:hover .coff2-dot {
    transform: translateY(-3px) rotate(-8deg);
}

.coff2-size[aria-pressed="true"] {
    background: var(--cc-yellow-soft);
}

.coff2-size[aria-pressed="true"] .coff2-dot {
    box-shadow: 0 0 0 2px #fff, 0 0 0 5px var(--cc-dark), 0 7px 12px -5px rgba(20, 24, 25, .4);
}

/* ---------- Πακέτα ---------- */
.coff2 h3.coff2-ph {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    margin: 0 0 14px;
    font-size: 20px;
    font-weight: 800;
    color: var(--cc-dark);
}

.coff2-ph > span {
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--cc-dark);
    color: var(--cc-yellow);
    font-size: 14px;
}

.coff2 ul.coff2-packs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
    margin: 0 0 30px;
    padding: 0;
    list-style: none;
}

.coff2 li.coff2-pack {
    position: relative;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 20px 16px 16px;
    border: 1px solid var(--cc-line);
    border-radius: 16px;
    background: #fff;
    transition: box-shadow .2s var(--coff2-ease), transform .2s var(--coff2-ease);
}

.coff2 li.coff2-pack::marker {
    content: none;
}

.coff2 li.coff2-pack:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 26px -16px rgba(20, 24, 25, .35);
}

.coff2 li.coff2-pack.is-best {
    border: 2px solid var(--cc-yellow);
    background: var(--cc-yellow-tint);
}

.coff2-best {
    position: absolute;
    top: -11px;
    left: 14px;
    max-width: calc(100% - 20px); /* ποτέ έξω από το εισιτήριο (κινητό: οριζόντιο scroll της σελίδας) */
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--cc-yellow);
    color: var(--cc-dark);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.coff2-qty {
    font-size: 15px;
    color: var(--cc-muted);
}

.coff2-pack:has(.coff2-save) .coff2-qty {
    padding-right: 50px; /* χώρος για την ετικέτα -% πάνω δεξιά */
}

.coff2-qty strong {
    font-size: 26px;
    font-weight: 800;
    color: var(--cc-dark);
    font-variant-numeric: tabular-nums;
}

.coff2-unit {
    margin: 4px 0 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--cc-yellow-line);
    font-size: 14px;
    color: var(--cc-muted);
}

.coff2-unit strong {
    font-size: 22px;
    font-weight: 800;
    color: var(--cc-text);
    font-variant-numeric: tabular-nums;
}

.coff2-total {
    font-size: 16px;
    font-weight: 700;
    color: var(--cc-text);
    font-variant-numeric: tabular-nums;
}

.coff2-total del {
    font-size: 13px;
    font-weight: 500;
    color: var(--cc-muted);
}

.coff2-save {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--cc-red);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.coff2-time {
    margin: 6px 0 14px;
    font-size: 12.5px;
    color: var(--cc-muted);
}

.coff2-time.is-urgent {
    color: var(--cc-amber);
    font-weight: 600;
}

.coff2 a.coff2-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: auto;
    min-height: 44px;
    border-radius: 999px;
    background: var(--cc-yellow);
    color: var(--cc-dark);
    font-weight: 700;
    text-decoration: none;
    transition: background-color .2s var(--coff2-ease);
}

.coff2 a.coff2-btn:hover,
.coff2 a.coff2-btn:focus-visible {
    background: var(--cc-dark);
    color: var(--cc-yellow);
}

/* κινητό / tablet: λωρίδα μεγεθών χωρίς scrollbar (βελάκια .coff2-rail) */
@media (max-width: 767.98px) {
    .coff2-sizes {
        scrollbar-width: none;
    }

    .coff2-sizes::-webkit-scrollbar {
        display: none;
    }
}

@media (max-width: 575.98px) {
    /* minmax(0, 1fr): οι στήλες ΔΕΝ μεγαλώνουν πάνω από το μισό πλάτος (το 1fr κρατούσε το πλάτος του κουμπιού —
       με μεγάλη γραμματοσειρά συστήματος η 2η στήλη έβγαινε έξω: χωρίς κενό δεξιά + οριζόντιο scroll, χρήστης 2026-10-24) */
    .coff2 ul.coff2-packs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .coff2 li.coff2-pack {
        min-width: 0;
        padding: 18px 12px 12px;
        overflow-wrap: anywhere;
    }

    .coff2 a.coff2-btn {
        gap: 6px;
        padding-inline: 8px;
        font-size: 15px;
        text-align: center;
    }

    .coff2-qty strong {
        font-size: 22px;
    }

    .coff2-unit strong {
        font-size: 18px;
    }

    .coff2-best {
        left: 8px;
        font-size: 11px;
    }
}

/* πολύ στενά κινητά: ένα εισιτήριο ανά γραμμή */
@media (max-width: 359.98px) {
    .coff2 ul.coff2-packs {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---------- Τιμοκατάλογος ([pricelist_table] → concarda_pricelist_v2, ίδιο στυλ) ---------- */
/* τύπος: η κοινή επιλογή τύπου — βλ. «Τύπος» πιο πάνω */

.coff2-plist .coff2-pack:has(.coff2-save) .coff2-qty {
    padding-right: 50px; /* χώρος για την ετικέτα -% πάνω δεξιά */
}

.coff2-qty strong {
    font-size: 22px;
}

/* προσφορές του τύπου (concarda_pricelist_v2 → .coff2-offers, 2026-10-24): κάτω από τις κλίμακες, σε κίτρινο πλαίσιο — ίδια εισιτήρια με το [offers] */
.coff2-offers {
    margin: 26px 0 0;
    padding: 18px 18px 20px;
    border: 1px solid var(--cc-yellow-line);
    border-radius: 18px;
    background: var(--cc-yellow-soft);
}

.coff2 .coff2-offers h3.coff2-ph {
    margin-top: 0;
}

.coff2-offers h3.coff2-ph > .fa {
    color: var(--cc-red);
}

.coff2-osize {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--cc-dark);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    vertical-align: 2px;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .coff2-offers {
        margin-inline: -4px;
        padding: 14px 12px 16px;
    }

    .coff2-osize {
        display: table;
        margin: 4px 0 0;
    }
}

/* σημείωση τιμών: κάτω από τα εισιτήρια (2026-10-24) */
.coff2-plist .cplist-note {
    margin: 18px 0 14px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--cc-line);
    color: var(--cc-muted);
    font-size: 14px;
    line-height: 1.5;
}

.coff2-plist .cplist-note strong {
    color: var(--cc-dark);
}

.coff2-plist .cplist-more {
    margin: 4px 0 0;
    padding: 14px 18px;
    border-radius: 12px;
    background: var(--cc-yellow-soft);
    font-weight: 600;
}

.coff2-eg {
    font-size: 13px;
    font-weight: 500;
    color: var(--cc-muted);
}

.coff2-unit del {
    font-size: 13px;
    color: var(--cc-muted);
}

/* μετά από επιλογή τύπου / μεγέθους (js/offers.js → .is-new): τα πακέτα «ανεβαίνουν» — ότι κάτι άλλαξε */
.coff2-panel.is-new .coff2-ph,
.coff2-panel.is-new li.coff2-pack {
    animation: coff2-in .45s var(--coff2-ease) both;
}

.coff2-panel.is-new li.coff2-pack:nth-child(2) { animation-delay: .05s; }
.coff2-panel.is-new li.coff2-pack:nth-child(3) { animation-delay: .1s; }
.coff2-panel.is-new li.coff2-pack:nth-child(n+4) { animation-delay: .15s; }

@keyframes coff2-in {
    from {
        opacity: .2;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

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

    .coff2-size:hover .coff2-dot,
    .coff2 li.coff2-pack:hover {
        transform: none;
    }
}
