/* UN Collections — Frontend styles */

/* ── Collection card ───────────────────────────────────────────────────── */

.un-collection-card {
    border: 1px solid var(--un-border);
    border-radius: var(--un-radius);
    overflow: hidden;
    background: var(--un-white);
    margin-bottom: 24px;
}

.un-collection-card__image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.un-collection-card__body {
    padding: 20px;
}

.un-collection-card__title {
    font-size: 1.2em;
    margin: 0 0 12px;
    font-weight: 600;
}
.un-collection-card__title a {
    color: inherit;
    text-decoration: none;
}
.un-collection-card__title a:hover {
    text-decoration: underline;
}

/* ── Status / action bar ───────────────────────────────────────────────── */

.un-collection-bar {
    background: var(--un-bg-soft);
    border: 1px solid var(--un-border);
    border-radius: var(--un-radius);
    padding: 14px 16px;
    margin-bottom: 18px;
}

.un-collection-bar__message {
    font-size: 0.88em;
    color: var(--un-text);
    margin-bottom: 10px;
    min-height: 1.3em;
    line-height: 1.4;
}

.un-collection-bar__row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.un-collection-add-btn {
    flex-shrink: 0;
    padding: 10px 18px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.un-collection-add-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.un-collection-bar__pricing {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.un-bar-badge {
    display: inline-block;
    background: var(--un-success-bg);
    color: var(--un-success);
    border: 1px solid var(--un-success);
    border-radius: var(--un-radius);
    padding: 2px 10px;
    font-size: 0.82em;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.un-bar-price-original {
    font-size: 0.9em;
    color: var(--un-text-2);
    text-decoration: line-through;
}

.un-bar-price-actual {
    font-size: 1.15em;
    font-weight: 700;
    color: var(--un-black);
}

.un-collection-add-notice {
    font-size: 0.85em;
    min-height: 1.2em;
    margin-top: 8px;
}
.un-notice-success { color: var(--un-success); }
.un-notice-error   { color: var(--un-error); }

/* ── Cart status (from cart page context) ──────────────────────────────── */

.un-collection-card__cart-status {
    margin-bottom: 12px;
    font-size: 0.9em;
    font-weight: 500;
}
.un-status-complete { color: var(--un-success); }
.un-status-partial  { color: var(--un-warning); }

/* ── Slot list (default layout) ────────────────────────────────────────── */

.un-collection-card__slots {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.un-collection-select-all {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    color: var(--un-text-2);
    cursor: pointer;
    margin-bottom: 4px;
}

.un-collection-slot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid var(--un-border);
    border-radius: var(--un-radius);
    background: var(--un-bg-soft);
    transition: background 0.15s;
}
.un-collection-slot:hover {
    background: var(--un-bg-soft);
}
.un-collection-slot.is-oos {
    opacity: 0.55;
}

.un-slot-checkbox-wrap {
    flex-shrink: 0;
    cursor: pointer;
}
.un-slot-checkbox-wrap input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--un-rose);
}

.un-slot-product {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.un-slot-product__image img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--un-radius);
    flex-shrink: 0;
    display: block;
}

.un-slot-product__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.un-slot-phase-label {
    font-size: 0.72em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--un-text-2);
}

.un-slot-product__name {
    font-size: 0.9em;
    font-weight: 500;
    color: var(--un-text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
a.un-slot-product__name:hover {
    text-decoration: underline;
}

.un-slot-product__price {
    font-size: 0.88em;
    color: var(--un-text);
}

.un-slot-oos-label,
.un-grid-item__oos {
    font-size: 0.78em;
    color: var(--un-error);
    font-style: italic;
}

.un-slot-empty-label {
    color: var(--un-text-2);
    font-style: italic;
    font-size: 0.85em;
}

/* ── Product grid layout (Look detail page) ─────────────────────────────── */

.un-collection-card.layout-look .un-collection-card__body {
    padding: 0;
}

.un-collection-grid {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 4px 0 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.un-collection-grid__item {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--un-border);
    border-radius: var(--un-radius);
    overflow: hidden;
    background: var(--un-white);
    scroll-snap-align: start;
    transition: opacity 0.2s, filter 0.2s;
}

.un-collection-grid__item.is-deselected {
    opacity: 0.45;
    filter: grayscale(80%);
}
.un-collection-grid__item.is-oos {
    opacity: 0.5;
    filter: grayscale(60%);
}

.un-grid-item__image-wrap {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
}
.un-grid-item__image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Checkbox overlay — top-right corner */
.un-grid-item__checkbox-wrap {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.9);
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,.18);
    cursor: pointer;
    z-index: 1;
}
.un-grid-item__checkbox-wrap input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--un-rose);
    margin: 0;
}

.un-grid-item__info {
    padding: 10px 10px 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.un-grid-item__name {
    font-size: 0.85em;
    font-weight: 500;
    color: var(--un-text);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}
a.un-grid-item__name:hover {
    text-decoration: underline;
}

.un-grid-item__price {
    font-size: 0.88em;
    font-weight: 600;
    color: var(--un-text);
}

.un-grid-item__add-btn {
    margin: auto 10px 10px;
    font-size: 0.8em;
    padding: 6px 10px;
    width: calc(100% - 20px);
    text-align: center;
}

/* ── Archive grid ──────────────────────────────────────────────────────── */

.un-collection-archive {
    display: grid;
    gap: 24px;
}
.un-collection-archive.columns-1 { grid-template-columns: 1fr; }
.un-collection-archive.columns-2 { grid-template-columns: repeat(2, 1fr); }
.un-collection-archive.columns-3 { grid-template-columns: repeat(3, 1fr); }
.un-collection-archive.columns-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .un-collection-archive.columns-3,
    .un-collection-archive.columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .un-collection-grid__item {
        flex: 0 0 160px;
    }
}
@media (max-width: 480px) {
    .un-collection-archive {
        grid-template-columns: 1fr !important;
    }
    .un-collection-grid__item {
        flex: 0 0 140px;
    }
}

/* ── Cart panel ────────────────────────────────────────────────────────── */

.un-collection-cart-panel {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid var(--un-border);
}

.un-collection-cart-panel.un-sep-off {
    border-top: 0;
    padding-top: 0;
}

.un-collection-cart-panel__title {
    font-size: 1.15em;
    font-weight: 600;
    margin: 0 0 16px;
}

/* ── "Reproduisez ce look" — ChromaLab-results-style two-column block ───── */

.un-look-repro {
    display: flex;
    align-items: stretch;
    gap: 20px;
    border: 0;
    background: transparent;
    margin-bottom: 0;
}

/* LEFT: look card, stretched to the product band height. */
.un-look-repro__hero {
    flex: 0 0 230px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--un-rose-divider);
    border-radius: var(--un-radius);
    overflow: hidden;
    background: var(--un-white);
}

/* Image grows to absorb the column's slack (the body stays natural-height at the
   bottom), so the look card fills the matched height with no empty gap and its
   bottom border lands at the product-cards' button line. object-fit:cover keeps
   the subject undistorted. Flex container + align-self:stretch makes the <img>
   fill via layout (percentage heights fail on a flex-stretched replaced element). */
.un-look-repro__hero-img {
    display: flex;
    flex: 1 1 0;
    min-height: 120px;
    overflow: hidden;
    background: var(--un-bg-soft);
}

.un-look-repro__hero-img img {
    width: 100%;
    height: auto;
    object-fit: cover;
    align-self: stretch;
    min-height: 0;
    display: block;
    transition: transform 0.25s;
}

.un-look-repro__hero-img:hover img {
    transform: scale(1.04);
}

.un-look-repro__hero-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px 14px;
    flex: 0 0 auto;
    min-height: 0;
    border-top: 1px solid var(--un-rose-divider);
}

.un-look-repro__author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8em;
    color: var(--un-text-2);
}

.un-look-repro__author img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
}
.un-look-repro__author .un-rank-icon {
    width: 16px;
    height: 16px;
    border-radius: 0;
    flex-shrink: 0;
}

.un-look-repro__title {
    margin: 0;
    font-size: 1.05em;
    font-weight: 600;
    line-height: 1.25;
}

.un-look-repro__title a {
    color: inherit;
    text-decoration: none;
}

.un-look-repro__difficulty {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--un-text-2);
}

.un-look-repro__desc {
    margin: 2px 0 0;
    font-size: 0.85em;
    line-height: 1.45;
    color: var(--un-text-2);
}

/* Inline "more" link after the description ellipsis. */
.un-look-repro__more {
    white-space: nowrap;
    color: var(--un-rose, #916F73);
    font-weight: 600;
    text-decoration: none;
}

.un-look-repro__more:hover {
    text-decoration: underline;
}

/* Button variant (theme guideline secondary: white bg, black border, radius 0). */
.un-look-repro__btn {
    align-self: flex-start;
    margin-top: 4px;
    display: inline-block;
    text-align: center;
    padding: 9px 16px;
    background: var(--un-white);
    color: var(--un-black);
    border: 1px solid var(--un-black);
    border-radius: 0;
    font-size: 0.85em;
    font-weight: 400;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.un-look-repro__btn:hover {
    background: var(--un-black);
    color: var(--un-white);
}

/* RIGHT: floating bar + product band. */
.un-look-repro__main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Floating pill: missing count + price (left) · black/ghost CTA (right). */
.un-look-repro__pill {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: 12px;
    max-width: 100%;
    padding: 8px 8px 8px 16px;
    border-radius: var(--un-radius);
    background: var(--un-white);
    border: 1px solid var(--un-black);
    font-size: 13px;
}

.un-look-repro__missing {
    font-weight: 600;
    color: var(--un-black);
    white-space: nowrap;
}

.un-look-repro__missing--complete {
    color: var(--un-success, #2f855a);
}

.un-look-repro__pill-sep {
    width: 1px;
    height: 18px;
    background: var(--un-border-strong, var(--un-border));
    flex-shrink: 0;
}

.un-look-repro__pill .un-collection-bar__pricing {
    margin: 0;
}

.un-look-repro__pill .un-bar-price-actual {
    font-weight: 700;
    color: var(--un-black);
}

.un-look-repro__pill-cta {
    margin: -8px -8px -8px 0;
    align-self: stretch;
    padding: 0 18px;
    background: var(--un-black);
    color: var(--un-white);
    border: 1px solid var(--un-black);
    border-radius: 0 var(--un-radius) var(--un-radius) 0;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.un-look-repro__pill-cta:hover:not(:disabled) {
    background: var(--un-white);
    color: var(--un-black);
}

.un-look-repro__pill-cta:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.un-look-repro .un-collection-add-notice {
    min-height: 0;
    margin: 0;
}

/* Higher specificity than `.un-reco { margin: 2rem 0 }` so the carousel sits
   flush — its inherited 32px top/bottom margin was the gap between the pill and
   the cards, and the slack below the cards that broke the bottom alignment. */
.un-reco.un-look-repro__carousel {
    margin: 0;
}

/* ── Mobile: stack, and turn the look card into a compact banner strip ──── */
@media (max-width: 767px) {
    .un-look-repro {
        flex-direction: column;
        gap: 14px;
    }

    /* Hero: horizontal banner (image left, text right) instead of a full-width
       square card — mirrors the ChromaLab Results cat-box mobile strip. */
    .un-look-repro__hero {
        flex: 0 0 auto;
        flex-direction: row;
        align-items: stretch;
        overflow: hidden;
    }

    .un-look-repro__hero-img {
        flex: 0 0 96px;
        width: 96px;
        min-height: 0;
        align-self: stretch;
    }

    /* Divider sits between image (left) and text (right) on mobile; body fills
       the remaining width. */
    .un-look-repro__hero-body {
        flex: 1 1 auto;
        padding: 8px 14px;
        gap: 3px;
        justify-content: center;
        border-top: 0;
        border-left: 1px solid var(--un-rose-divider);
    }
}

/* Narrow phones only: let the pill wrap its CTA onto a full-width row. Above
   this it stays inline (count · price · CTA all on one line). */
@media (max-width: 520px) {
    .un-look-repro__pill {
        display: flex;
        flex-wrap: wrap;
        align-self: stretch;
        width: 100%;
    }

    .un-look-repro__pill-cta {
        flex-basis: 100%;
        margin: 8px -8px -8px -16px;
        padding: 12px 18px;
        text-align: center;
        border-radius: 0;
    }
}

/* ── Product widget wrapper ────────────────────────────────────────────── */

.un-collection-product-widget {
    margin-top: 32px;
}
.un-collection-product-widget__title {
    font-size: 1.3em;
    font-weight: 600;
    margin: 0 0 16px;
}
.un-collection-product-widget.layout-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}
@media (max-width: 600px) {
    .un-collection-product-widget.layout-grid {
        grid-template-columns: 1fr;
    }
}
