/* ============================================================
   YSM FITNESS STORE — Cart & Product Styles
   ============================================================ */

/* ---- Store Header ---- */
.store-header {
    background: linear-gradient(145deg, var(--espresso) 0%, #3a221b 100%);
    color: var(--white);
    padding: 18px 0;
    position: sticky;
    top: 68px;
    z-index: 80;
    border-bottom: 2px solid var(--gold);
}
.store-header .container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.store-header h2 {
    font-family: var(--font-heading);
    color: var(--white);
    font-size: 1.3rem;
    margin: 0;
}
.store-header h2 span { color: var(--gold); }

/* ---- Floating Cart Button ---- */
.cart-fab {
    position: fixed;
    bottom: 28px;
    right: 24px;
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--espresso);
    border: 2.5px solid var(--gold);
    box-shadow: 0 6px 24px rgba(36,23,19,0.35);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.cart-fab:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 32px rgba(36,23,19,0.4);
}
.cart-fab:active { transform: scale(0.96); }
.cart-fab-icon {
    font-size: 1.55rem;
    line-height: 1;
}
.cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    background: var(--gold);
    color: var(--espresso);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
    padding: 0 5px;
    border: 2px solid var(--white);
}

/* ---- Collection Lookbook Band ---- */
.catalog-band {
    background: var(--espresso);
    padding: 56px 0;
}
.catalog-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}
.catalog-text .section-kicker { color: var(--gold); margin-bottom: 10px; }
.catalog-text .section-title { color: var(--white); margin-bottom: 14px; }
.catalog-text .section-lede { color: rgba(255,255,255,0.75); font-size: 0.95rem; line-height: 1.7; margin-bottom: 20px; }
.catalog-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-bottom: 18px;
}
.catalog-icons span {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.catalog-tagline {
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
    margin: 0;
}
.catalog-img {
    width: 100%;
    border-radius: var(--radius);
    display: block;
    object-fit: cover;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
@media (max-width: 767px) {
    .catalog-inner {
        grid-template-columns: 1fr;
    }
    .catalog-img { order: -1; }
}

/* ---- Store Section ---- */
.store-section {
    padding: 48px 0;
    background: var(--linen);
}
.store-section-header {
    text-align: center;
    margin-bottom: 32px;
}
.store-section-header .section-kicker { margin-bottom: 6px; }
.store-section-header h2 { margin-bottom: 10px; }

/* ---- Category Tabs ---- */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 32px;
}
.category-tab {
    padding: 8px 20px;
    border-radius: 999px;
    border: 1.5px solid var(--line);
    background: var(--white);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s;
}
.category-tab:hover { border-color: var(--gold); color: var(--espresso); }
.category-tab.active {
    background: var(--espresso);
    color: var(--white);
    border-color: var(--espresso);
}

/* ---- Product Grid (Store) ---- */
.store-grid {
    display: grid;
    gap: 20px;
}
.store-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.22s, box-shadow 0.22s;
    display: flex;
    flex-direction: column;
}
.store-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}
.store-card-img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    object-position: center;
    display: block;
    background: var(--cream);
}
.store-card-body {
    padding: 18px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.store-card-body h3 {
    font-size: 1.1rem;
    color: var(--espresso);
    margin: 0;
}
.store-card-body .product-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--cocoa);
    background: var(--gold-light);
    padding: 3px 10px;
    border-radius: 999px;
    align-self: flex-start;
}
.store-card-body p {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.6;
    margin: 0;
    flex: 1;
}
.store-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}
.store-price {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--leaf);
}
.store-price .price-unit {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 400;
}
.btn-add-cart {
    background: var(--espresso);
    color: var(--white);
    border: none;
    border-radius: 999px;
    padding: 8px 16px;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 900;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    white-space: nowrap;
}
.btn-add-cart:hover { background: #5a332a; }
.btn-add-cart:active { transform: scale(0.96); }
.btn-add-cart.added {
    background: var(--leaf);
    pointer-events: none;
}

/* ---- Cart Sidebar / Drawer ---- */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(36, 23, 19, 0.5);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.cart-overlay.open { opacity: 1; pointer-events: auto; }

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 100%);
    background: var(--linen);
    z-index: 201;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: -12px 0 40px rgba(36, 23, 19, 0.2);
}
.cart-drawer.open { transform: translateX(0); }

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    background: var(--white);
}
.cart-header h3 {
    font-size: 1.2rem;
    color: var(--espresso);
    margin: 0;
}
.cart-header h3 span { color: var(--gold); }
.cart-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--line);
    background: var(--white);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.cart-close:hover { background: var(--cream); }

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

/* Empty state */
.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 12px;
    color: var(--muted);
    text-align: center;
}
.cart-empty span { font-size: 3rem; }
.cart-empty p { font-size: 1rem; }

/* Cart item row */
.cart-item {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    align-items: center;
}
.cart-item:last-child { border-bottom: none; }
.cart-item-img {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--cream);
}
.cart-item-info { min-width: 0; }
.cart-item-info h4 {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--espresso);
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cart-item-price {
    font-size: 0.85rem;
    color: var(--leaf);
    font-weight: 700;
}

/* Qty controls */
.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}
.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--line);
    background: var(--white);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    color: var(--espresso);
}
.qty-btn:hover { background: var(--cream); }
.qty-btn.remove-item {
    border-color: rgba(200, 70, 50, 0.3);
    color: #c84632;
    font-size: 0.8rem;
}
.qty-btn.remove-item:hover { background: rgba(200, 70, 50, 0.08); }
.cart-item-qty {
    font-size: 0.9rem;
    font-weight: 900;
    color: var(--espresso);
    min-width: 20px;
    text-align: center;
}

/* Cart footer */
.cart-footer {
    padding: 20px 24px;
    border-top: 2px solid var(--line);
    background: var(--white);
}
.cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    color: var(--muted);
    margin-bottom: 6px;
}
.cart-subtotal strong {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--espresso);
}
.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}
.cart-total strong {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--leaf);
}
.btn-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 999px;
    background: #1fa855;
    color: var(--white);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 900;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}
.btn-checkout:hover { background: #1a9449; }
.btn-checkout:active { transform: scale(0.97); }

/* ---- Size Picker ---- */
.size-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    margin: 0;
    transform: translateY(-6px);
    transition: max-height 0.28s cubic-bezier(0.22,1,0.36,1),
                opacity 0.22s ease,
                transform 0.22s ease,
                margin 0.22s ease;
    pointer-events: none;
}
.size-picker.open {
    max-height: 120px;
    opacity: 1;
    margin: 8px 0 4px;
    transform: translateY(0);
    pointer-events: auto;
}
.size-label {
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    margin-right: 2px;
    flex-shrink: 0;
}
.size-btn {
    padding: 5px 10px;
    border-radius: 6px;
    border: 1.5px solid var(--line);
    background: var(--white);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--espresso);
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.4;
}
.size-btn:hover {
    border-color: var(--espresso);
    background: var(--cream);
}
.size-btn.selected {
    background: var(--espresso);
    color: var(--white);
    border-color: var(--espresso);
}
.btn-add-cart.needs-size {
    background: #c84632;
    animation: shake 0.3s ease;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* ---- Cart item size badge ---- */
.cart-item-size {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--white);
    background: var(--espresso);
    padding: 2px 7px;
    border-radius: 999px;
    margin: 2px 0 3px;
}

/* ---- Back Link ---- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-weight: 700;
    font-size: 0.88rem;
    padding: 8px 14px;
    border-radius: 999px;
    transition: background 0.2s, color 0.2s;
}
.back-link:hover { background: var(--gold-light); color: var(--espresso); }

/* ---- Toast Notification ---- */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--espresso);
    color: var(--white);
    padding: 14px 24px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: var(--shadow-lg);
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    white-space: nowrap;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 640px) {
    .store-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .store-grid { grid-template-columns: repeat(3, 1fr); }
    .store-header h2 { font-size: 1.5rem; }
    .toast { bottom: 40px; }
    .cart-fab { bottom: 36px; right: 36px; }
}

/* Mobile: 2-column grid */
@media (max-width: 639px) {
    .store-header { top: 0; position: relative; }
    .store-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .store-card-body {
        padding: 12px 12px 14px;
        gap: 6px;
    }
    .store-card-body h3 {
        font-size: 0.82rem;
        line-height: 1.3;
    }
    .store-card-body p {
        font-size: 0.78rem;
        line-height: 1.5;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .store-price {
        font-size: 1.05rem;
    }
    .btn-add-cart {
        font-size: 0.75rem;
        padding: 7px 11px;
    }
    .size-btn {
        padding: 4px 7px;
        font-size: 0.7rem;
    }
    .product-tag {
        font-size: 0.62rem;
    }
}
