/* ==========================================================================
   Category Showcase — Frontend Styles  v1.9.0
   ▸ font-family: Poppins is loaded by Breakdance — NOT imported here.
   ▸ Image aspect-ratio: 300/170 (matches YouTube sddefault thumbnail).
   ▸ Product title: h4, 20px, linked to product page.
   ▸ Description: 12 words, linked to product page.
   ▸ 3D button: 1.5px border, 20px icon, orange hover.
   ▸ display:none is belt-and-suspenders with PHP inline style="display:none".
   ▸ Modal styles handled by CPC Modal Engine.
   ========================================================================== */

/* ── Custom Properties ─────────────────────────────────────────────────────── */
.csc-drawer,
.csc-panel {
    --csc-orange:       #F4580D;
    --csc-black:        #111111;
    --csc-white:        #ffffff;
    --csc-card-bg:      #ffffff;
    --csc-card-shadow:  0 2px 12px rgba(0,0,0,.09);
    --csc-card-radius:  15px;
    --csc-btn-radius:   15px;
    --csc-sheet-radius: 20px 20px 0 0;
    --csc-gap:          16px;
    --csc-card-w:       260px;
    --csc-pad:          20px;
    --csc-ease:         cubic-bezier(0.32, 0, 0.67, 0);
    --csc-ease-out:     cubic-bezier(0.33, 1, 0.68, 1);
}

@media (min-width: 768px) {
    .csc-drawer, .csc-panel { --csc-pad: 36px; --csc-card-w: 280px; }
}
@media (min-width: 1024px) {
    .csc-drawer, .csc-panel { --csc-pad: 52px; --csc-card-w: 300px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   DRAWER — fixed overlay
   PHP also writes style="display:none" on the element — dual-layer guarantee.
   ════════════════════════════════════════════════════════════════════════ */

.csc-drawer {
    /* Poppins is already loaded by Breakdance — no @import needed */
    font-family: 'Poppins', sans-serif;
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
    align-items: flex-end;
}

.csc-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    transition: background 300ms ease;
    pointer-events: none;
}

.csc-drawer__sheet {
    position: relative;
    width: 100%;
    max-width: 100vw;
    max-height: 90vh;
    background: #f5f5f5;
    border-radius: var(--csc-sheet-radius);
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateY(100%);
    transition: transform 380ms var(--csc-ease);
    pointer-events: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--csc-orange) #eee;
}
.csc-drawer__sheet::-webkit-scrollbar       { width: 5px; }
.csc-drawer__sheet::-webkit-scrollbar-track { background: #eee; }
.csc-drawer__sheet::-webkit-scrollbar-thumb { background: var(--csc-orange); border-radius: 99px; }

@media (min-width: 1024px) {
    .csc-drawer__sheet { max-height: 82vh; }
}

.csc-drawer.is-open                      { pointer-events: auto; }
.csc-drawer.is-open .csc-drawer__backdrop {
    background: rgba(0,0,0,.45);
    pointer-events: auto;
}
.csc-drawer.is-open .csc-drawer__sheet {
    transform: translateY(0);
    transition: transform 380ms var(--csc-ease-out);
    pointer-events: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PANEL
   ════════════════════════════════════════════════════════════════════════ */

.csc-panel          { display: none; }
.csc-panel.is-active { display: block; }

.csc-panel__inner {
    padding: 28px var(--csc-pad) 32px;
    overflow: hidden;
    box-sizing: border-box;
}

.csc-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.csc-panel__label {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--csc-black);
    letter-spacing: .04em;
}
.csc-panel__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--csc-black);
    color: var(--csc-white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 150ms ease, transform 150ms ease;
}
.csc-panel__close:hover         { background: #333; transform: rotate(90deg); }
.csc-panel__close:focus-visible { outline: 3px solid var(--csc-orange); outline-offset: 2px; }

/* ═══════════════════════════════════════════════════════════════════════════
   PRODUCT CARD GRID
   ▸ Single horizontal row, scroll left/right.
   ▸ No negative margins — padding-left + ::after spacer handles edges safely.
   ════════════════════════════════════════════════════════════════════════ */

.csc-panel__grid {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--csc-gap);
    overflow-x: auto;
    overflow-y: visible;
    margin-left:  calc(-1 * var(--csc-pad));
    margin-right: calc(-1 * var(--csc-pad));
    padding-left:  var(--csc-pad);
    padding-right: 0;
    padding-bottom: 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--csc-orange) #eee;
}
.csc-panel__grid::-webkit-scrollbar       { height: 4px; }
.csc-panel__grid::-webkit-scrollbar-track { background: #eee; border-radius: 99px; }
.csc-panel__grid::-webkit-scrollbar-thumb { background: var(--csc-orange); border-radius: 99px; }

/* Right-edge spacer — guarantees last card full visibility without padding-right tricks */
.csc-panel__grid::after {
    content: '';
    display: block;
    flex: 0 0 var(--csc-pad);
    height: 1px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PRODUCT CARD
   ════════════════════════════════════════════════════════════════════════ */

.csc-card {
    flex: 0 0 var(--csc-card-w);
    width: var(--csc-card-w);
    background: var(--csc-card-bg);
    border-radius: var(--csc-card-radius);
    box-shadow: var(--csc-card-shadow);
    overflow: hidden;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    transition: transform 200ms ease, box-shadow 200ms ease;
}
@media (min-width: 1024px) {
    .csc-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 28px rgba(0,0,0,.13);
    }
}

/* ── Image link wrapper (tabindex=-1 aria-hidden=true — title link is primary) ── */
.csc-card__image-link {
    display: block;
    overflow: hidden;
    border-radius: var(--csc-card-radius) var(--csc-card-radius) 0 0;
    text-decoration: none;
}
@media (min-width: 1024px) {
    .csc-card__image-link:hover .csc-card__img {
        transform: scale(1.04);
        transition: transform 400ms ease;
    }
}

/* ── Image area: 300×170 matches YouTube sddefault thumbnail ratio ── */
.csc-card__image {
    width: 100%;
    aspect-ratio: 300 / 170;
    background: #e8e8e8;
}
.csc-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 400ms ease;
}

/* ── Card body ── */
.csc-card__body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

/* ── Title: h4, 20px, uppercase, linked ── */
.csc-drawer .csc-card__title {
    font-size: 20px !important;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--csc-black);
    margin: 0;
    padding: 0;
    line-height: 1.2;
    letter-spacing: .025em;
}
.csc-card__title-link {
    color: inherit;
    text-decoration: none;
    display: block;
}
.csc-card__title-link:focus-visible { outline: 3px solid var(--csc-orange); border-radius: 3px; }
@media (min-width: 1024px) {
    .csc-card__title-link:hover { text-decoration: underline; text-decoration-thickness: 2px; }
}

/* ── Description: 12-word plain text, only the ellipsis is an orange link ── */
.csc-card__desc {
    font-size: 13px;
    font-weight: 400;
    color: #555;
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Actions block — pinned to the bottom of the card via margin-top:auto */
.csc-card__actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.csc-card__row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════════════════════ */

.csc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    border-radius: var(--csc-btn-radius);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
    min-height: 44px;
    transition: opacity 150ms ease, transform 150ms ease, background 150ms ease, border-color 150ms ease, color 150ms ease;
}
.csc-btn:focus-visible { outline: 3px solid var(--csc-orange); outline-offset: 2px; }

.csc-btn--phone {
    background: var(--csc-black);
    color: var(--csc-white);
    font-size: 12px;
    padding: 10px 12px;
    flex: 1;
}
.csc-btn--phone a,
.csc-btn--phone a:visited,
.csc-btn--phone a:hover {
    color: var(--csc-white) !important;
    text-decoration: none !important;
    font-weight: 600;
}

/* 3D button: 1.5px border (was 2px — thicker than icon), 20px icon */
.csc-btn--3d {
    background: transparent;
    border: 1.5px solid var(--csc-black);
    color: var(--csc-black);
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    flex-shrink: 0;
}
@media (min-width: 1024px) {
    .csc-btn--3d:hover {
        background: var(--csc-orange);
        border-color: var(--csc-orange);
        color: var(--csc-white);
    }
}

.csc-btn--unlock {
    background: var(--csc-orange);
    color: var(--csc-white);
    font-size: 13px;
    font-weight: 700;
    padding: 13px 16px;
    width: 100%;
    letter-spacing: .01em;
}
@media (min-width: 1024px) {
    .csc-btn--unlock:hover { background: #d9490a; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   EXPLORE ALL
   ════════════════════════════════════════════════════════════════════════ */

.csc-explore-all { margin-top: 24px; text-align: center; }
.csc-explore-all__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--csc-orange);
    font-weight: 700;
    font-size: clamp(0.9rem, 2vw, 1rem);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    padding-bottom: 2px;
    min-height: 44px;
    transition: border-color 200ms ease;
}
.csc-explore-all__link:focus-visible { outline: 3px solid var(--csc-orange); border-radius: 3px; }
@media (min-width: 1024px) {
    .csc-explore-all__link:hover { border-color: var(--csc-orange); }
    .csc-explore-all__link:hover .csc-explore-all__arrow { transform: translateX(4px); }
}
.csc-explore-all__arrow { font-size: 18px; transition: transform 200ms ease; }

/* ═══════════════════════════════════════════════════════════════════════════
   CARD ENTRY ANIMATION
   ════════════════════════════════════════════════════════════════════════ */

@keyframes csc-fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.csc-drawer.is-open .csc-panel.is-active .csc-card { animation: csc-fade-up 300ms ease both; }
.csc-drawer.is-open .csc-panel.is-active .csc-card:nth-child(1) { animation-delay: .05s; }
.csc-drawer.is-open .csc-panel.is-active .csc-card:nth-child(2) { animation-delay: .09s; }
.csc-drawer.is-open .csc-panel.is-active .csc-card:nth-child(3) { animation-delay: .13s; }
.csc-drawer.is-open .csc-panel.is-active .csc-card:nth-child(4) { animation-delay: .17s; }
.csc-drawer.is-open .csc-panel.is-active .csc-card:nth-child(5) { animation-delay: .21s; }
.csc-drawer.is-open .csc-panel.is-active .csc-card:nth-child(6) { animation-delay: .25s; }
.csc-drawer.is-open .csc-panel.is-active .csc-card:nth-child(7) { animation-delay: .29s; }
.csc-drawer.is-open .csc-panel.is-active .csc-card:nth-child(8) { animation-delay: .33s; }

/* ═══════════════════════════════════════════════════════════════════════════
   BODY SCROLL LOCK
   ════════════════════════════════════════════════════════════════════════ */

body.csc-drawer-open {
    overflow: hidden;
    padding-right: var(--csc-scrollbar-width, 0px);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ERROR
   ════════════════════════════════════════════════════════════════════════ */

.csc-error {
    padding: 12px 16px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #333;
    border-radius: 0 4px 4px 0;
}
