/* ========== DESIGN TOKENS ========== */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f4f4f5;
    --text-primary: #09090b;
    --text-secondary: #71717a;
    --accent: #000000;
    --border-color: #e4e4e7;
    --danger: #ef4444;

    --font-main: 'Inter', sans-serif;

    --radius-sm: 4px;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ========== NAVBAR ========== */
.navbar {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -1px;
    text-transform: uppercase;
}

.cart-toggle {
    font-size: 1.2rem;
    position: relative;
    color: var(--text-primary);
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ========== HERO ========== */
.hero {
    background-color: var(--bg-secondary);
    padding: 4rem 2rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    letter-spacing: -0.05em;
    margin-bottom: 0.5rem;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.filters-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.filter-btn.active,
.filter-btn:hover {
    background-color: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* ========== PRODUCT GRID ========== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    group: product;
    cursor: pointer;
}

.product-img-wrap {
    background-color: var(--bg-secondary);
    aspect-ratio: 4/5;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.product-img-wrap img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.product-card:hover .product-img-wrap img {
    transform: scale(1.05);
}

/* Quick Add Overlay on Hover */
.quick-add-overlay {
    position: absolute;
    bottom: -50px;
    left: 0;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    display: flex;
    justify-content: center;
    transition: bottom 0.3s ease;
}

.product-card:hover .quick-add-overlay {
    bottom: 0;
}

.btn-primary {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 0.8rem 1.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    width: 100%;
    border-radius: var(--radius-sm);
    transition: transform 0.1s;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-black {
    background: var(--accent);
    color: white;
}

.product-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.product-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.product-category {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.product-price {
    font-weight: 700;
}

/* ========== MODAL (QUICK VIEW / SIZE SELECT) ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    /* Bottom sheet on mobile */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.quick-view-modal {
    background: var(--bg-primary);
    width: 100%;
    max-width: 500px;
    border-radius: 12px 12px 0 0;
    padding: 2rem;
    position: relative;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media(min-width: 768px) {
    .modal-overlay {
        align-items: center;
    }

    .quick-view-modal {
        border-radius: 8px;
    }
}

.modal-overlay.active .quick-view-modal {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    color: var(--text-secondary);
}

/* Modal Content Styles */
.qv-details h2 {
    margin-bottom: 0.5rem;
}

.qv-price {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.qv-sizes {
    margin-bottom: 1.5rem;
}

.size-label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.size-grid {
    display: flex;
    gap: 0.5rem;
}

.size-btn {
    width: 45px;
    height: 45px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all 0.2s;
}

.size-btn:hover:not(:disabled) {
    border-color: var(--accent);
}

.size-btn.selected {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* OUT OF STOCK STATE */
.size-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: repeating-linear-gradient(45deg,
            transparent,
            transparent 10px,
            #e4e4e7 10px,
            #e4e4e7 11px);
}

.qv-add-btn {
    width: 100%;
}

/* ========== CART SIDEBAR ========== */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.cart-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.cart-sidebar {
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-lg);
}

.cart-overlay.active .cart-sidebar {
    right: 0;
}

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.empty-cart {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 2rem;
}

/* Cart Item */
.cart-item {
    display: flex;
    gap: 1rem;
}

.c-item-img {
    width: 80px;
    height: 100px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    object-fit: contain;
    padding: 0.5rem;
}

.c-item-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.c-item-title {
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
}

.c-item-remove {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.c-item-remove:hover {
    color: var(--danger);
}

.c-item-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: auto;
}

.c-item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.c-item-price {
    font-weight: 700;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-weight: 900;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.checkout-btn {
    width: 100%;
    padding: 1rem;
    background: var(--accent);
    color: white;
    font-weight: 700;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.checkout-btn:hover:not(:disabled) {
    background: #333;
}

.checkout-btn:disabled {
    background: var(--border-color);
    color: var(--text-secondary);
    cursor: not-allowed;
}