/* ========================================= */
/* CATALOG — catalog.css                     */
/* Extends style.css variables & base        */
/* ========================================= */

/* ---- Hero ---- */

.catalog-hero {
    position: relative;
    padding: 80px 0 60px;
    text-align: center;
    overflow: hidden;
}

.catalog-hero__glow {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 300px;
    background: radial-gradient(ellipse at center, rgba(138, 79, 255, 0.18) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.catalog-hero .container {
    position: relative;
    z-index: 1;
}

.catalog-hero__title {
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 18px;
}

.catalog-hero__sub {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 500px;
    margin: 0 auto;
}

/* ---- Toolbar ---- */

.catalog-section {
    padding-bottom: 100px;
}

.catalog-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 36px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-wrap: wrap;
    gap: 12px;
}

.catalog-toolbar__count {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.catalog-toolbar__right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.catalog-toolbar__label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.catalog-sort__select {
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    appearance: none;
    outline: none;
    transition: border-color 0.2s;
}

.catalog-sort__select:hover,
.catalog-sort__select:focus {
    border-color: rgba(138, 79, 255, 0.5);
}

/* ---- Grid ---- */

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
}

/* ---- Product card ---- */

.product-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.product-card:hover {
    border-color: rgba(138, 79, 255, 0.35);
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(138, 79, 255, 0.12);
}

/* Image area */

.product-card__image-wrap {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #1a1a24;
    text-decoration: none;
}

.product-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.product-card:hover .product-card__image {
    transform: scale(1.06);
}

/* Badge */

.product-card__badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--accent-gradient);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(138, 79, 255, 0.4);
    pointer-events: none;
}

.product-card__badge--limited {
    background: linear-gradient(90deg, #d859ff, #ff59a8);
}

/* Body */

.product-card__body {
    padding: 22px 22px 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-card__name {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

.product-card__desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
    flex: 1;
    margin-bottom: 20px;
}

.product-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.product-card__price {
    font-size: 1.4rem;
    font-weight: 800;
}

/* "Added" state on button */

.btn.add-to-cart.added {
    background: linear-gradient(90deg, #2ecc71, #27ae60);
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.35);
}

/* ========================================= */
/* CART FAB                                  */
/* ========================================= */

.cart-fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-gradient);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--btn-shadow), 0 8px 24px rgba(0,0,0,0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 40;
}

.cart-fab:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 0 28px rgba(138, 79, 255, 0.6), 0 12px 32px rgba(0,0,0,0.5);
}

.cart-fab__count {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    color: #8a4fff;
    font-size: 0.7rem;
    font-weight: 800;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-color);
}

/* ========================================= */
/* CART OVERLAY & DRAWER                     */
/* ========================================= */

.cart-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 48;
    transition: background 0.3s;
}

.cart-overlay.open {
    display: block;
    background: rgba(0, 0, 0, 0.65);
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 420px;
    background: #111118;
    border-left: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    flex-direction: column;
    z-index: 49;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.cart-drawer.open {
    transform: translateX(0);
}

.cart-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.cart-drawer__title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.cart-drawer__close {
    background: rgba(255,255,255,0.06);
    border: none;
    color: var(--text-muted);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.cart-drawer__close:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.cart-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    scrollbar-width: thin;
    scrollbar-color: rgba(138, 79, 255, 0.3) transparent;
}

.cart-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 60px 0;
    font-size: 0.95rem;
}

.cart-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cart-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-item__info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.cart-item__name {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
}

.cart-item__price {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.cart-item__controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-qty-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    border: none;
    color: var(--text-main);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}

.cart-qty-btn:hover {
    background: rgba(138, 79, 255, 0.25);
}

.cart-qty-val {
    min-width: 20px;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.cart-item__subtotal {
    margin-left: auto;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
}

.cart-drawer__footer {
    padding: 20px 24px 28px;
    border-top: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.cart-total__label {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.cart-total__value {
    font-size: 1.5rem;
    font-weight: 800;
}

/* ========================================= */
/* RESPONSIVE                                */
/* ========================================= */

@media (max-width: 768px) {
    .catalog-hero {
        padding: 56px 0 44px;
    }

    .catalog-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .product-card__body {
        padding: 16px;
    }

    .product-card__price {
        font-size: 1.15rem;
    }

    .cart-fab {
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .catalog-grid {
        grid-template-columns: 1fr;
    }

    .cart-drawer {
        max-width: 100%;
    }
}