/* ========================================
   Products Page Styles
   ======================================== */

/* Page Hero */
.page-hero {
    position: relative;
    padding: 160px 0 80px;
    text-align: center;
    overflow: hidden;
}

.page-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 0%, var(--green-subtle) 0%, transparent 50%),
        linear-gradient(180deg, var(--grey-900) 0%, var(--grey-800) 100%);
    z-index: -1;
}

.page-hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(57, 255, 20, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(57, 255, 20, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

.page-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--white);
    margin-bottom: 16px;
}

.page-subtitle {
    font-size: 1.15rem;
    color: var(--grey-300);
    max-width: 600px;
    margin: 0 auto;
}

/* Category Filter */
.category-filter {
    padding: 30px 0;
    background: var(--grey-800);
    border-bottom: 1px solid var(--grey-700);
    position: sticky;
    top: 80px;
    z-index: 100;
}

.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 12px 28px;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--grey-300);
    background: transparent;
    border: 1px solid var(--grey-600);
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-tab:hover {
    color: var(--green-primary);
    border-color: var(--green-primary);
    background: var(--green-subtle);
}

.filter-tab.active {
    color: var(--grey-900);
    background: var(--green-primary);
    border-color: var(--green-primary);
}

/* Products Section */
.products-section {
    padding: 60px 0 100px;
    background: var(--grey-900);
}

.products-section .products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 0;
}

/* Enhanced Product Card */
.products-section .product-card {
    position: relative;
    background: var(--grey-800);
    border: 1px solid var(--grey-700);
    border-radius: 12px;
    overflow: hidden;
    transition: all var(--transition-medium);
    display: flex;
    flex-direction: column;
}

.products-section .product-card:hover {
    border-color: var(--green-primary);
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4), 0 0 40px var(--green-glow);
}

.products-section .product-card.hidden {
    display: none;
}

/* Product Badge */
.product-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 6px 14px;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--grey-900);
    background: var(--green-primary);
    border-radius: 4px;
    z-index: 10;
    box-shadow: 0 4px 15px var(--green-glow);
}

.product-badge.new {
    background: #3b82f6;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

/* Product Image */
.products-section .product-image {
    height: 260px;
    background: linear-gradient(135deg, var(--grey-700) 0%, var(--grey-800) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.products-section .product-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 30%, var(--grey-800) 100%);
    opacity: 0.5;
}

.products-section .product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 1;
    transition: transform var(--transition-medium);
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

.products-section .product-card:hover .product-image img {
    transform: scale(1.08);
}

/* Product Info */
.products-section .product-info {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.products-section .product-category {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--green-primary);
    margin-bottom: 8px;
}

.products-section .product-name {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 10px;
    line-height: 1.2;
}

.products-section .product-desc {
    font-size: 0.9rem;
    color: var(--grey-300);
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
}

/* Product Specs */
.product-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--grey-700);
}

.product-specs .spec {
    font-size: 0.8rem;
    color: var(--grey-400);
    background: var(--grey-700);
    padding: 6px 12px;
    border-radius: 4px;
}

.product-specs .spec strong {
    color: var(--grey-200);
}

/* Product Footer */
.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--grey-700);
}

.product-price {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--green-primary);
}

.btn-add-cart {
    padding: 12px 24px;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Cart Button in Nav */
.cart-btn {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--grey-900);
    background: var(--green-primary);
    border-radius: 50%;
    padding: 0 4px;
    box-shadow: 0 2px 8px var(--green-glow);
    transition: transform var(--transition-fast);
}

.cart-count.pulse {
    animation: cartPulse 0.4s ease;
}

@keyframes cartPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* Cart Sidebar */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-medium);
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 100%;
    height: 100vh;
    background: var(--grey-800);
    border-left: 1px solid var(--grey-700);
    z-index: 1600;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--transition-medium);
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.5);
}

.cart-sidebar.active {
    transform: translateX(0);
}

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

.cart-header h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
}

.cart-close {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--grey-700);
    border: 1px solid var(--grey-600);
    border-radius: 4px;
    color: var(--grey-300);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.cart-close:hover {
    color: var(--green-primary);
    border-color: var(--green-primary);
}

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

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--grey-500);
    text-align: center;
    gap: 16px;
}

.cart-empty p {
    font-size: 1.1rem;
}

/* Cart Item */
.cart-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: var(--grey-700);
    border: 1px solid var(--grey-600);
    border-radius: 8px;
    margin-bottom: 16px;
    transition: all var(--transition-fast);
}

.cart-item:hover {
    border-color: var(--grey-500);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    background: var(--grey-600);
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    font-size: 0.95rem;
    color: var(--green-primary);
    font-weight: 600;
    margin-bottom: 12px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quantity-control {
    display: flex;
    align-items: center;
    background: var(--grey-800);
    border: 1px solid var(--grey-600);
    border-radius: 4px;
    overflow: hidden;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--grey-300);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 1.2rem;
}

.quantity-btn:hover {
    background: var(--green-subtle);
    color: var(--green-primary);
}

.quantity-value {
    width: 40px;
    text-align: center;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--white);
    border-left: 1px solid var(--grey-600);
    border-right: 1px solid var(--grey-600);
    padding: 6px 0;
}

.remove-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--grey-600);
    border-radius: 4px;
    color: var(--grey-400);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.remove-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

/* Cart Footer */
.cart-footer {
    padding: 24px;
    border-top: 1px solid var(--grey-700);
    background: var(--grey-900);
}

.cart-subtotal,
.cart-tax {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    color: var(--grey-300);
    font-size: 0.95rem;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    padding-top: 16px;
    margin-bottom: 20px;
    border-top: 1px solid var(--grey-700);
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--white);
}

.cart-total span:last-child {
    color: var(--green-primary);
}

.cart-footer .btn {
    margin-bottom: 12px;
}

.cart-footer .btn:last-child {
    margin-bottom: 0;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: var(--grey-800);
    border: 1px solid var(--green-primary);
    border-radius: 8px;
    color: var(--green-primary);
    font-family: var(--font-heading);
    font-weight: 600;
    z-index: 2000;
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--transition-medium);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 30px var(--green-glow);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Active Nav Link */
.nav-link.active {
    color: var(--green-primary);
    background: var(--green-subtle);
}

/* Responsive */
@media (max-width: 768px) {
    .page-hero {
        padding: 140px 0 60px;
    }

    .filter-tabs {
        gap: 8px;
    }

    .filter-tab {
        padding: 10px 20px;
        font-size: 0.85rem;
    }

    .products-section .products-grid {
        grid-template-columns: 1fr;
    }

    .cart-sidebar {
        width: 100%;
    }

    .product-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .product-price {
        text-align: center;
    }

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

    .toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
}

@media (max-width: 480px) {
    .category-filter {
        padding: 20px 0;
    }

    .filter-tabs {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-tab {
        width: 100%;
    }

    .cart-item {
        flex-direction: column;
    }

    .cart-item-image {
        width: 100%;
        height: 120px;
    }
}
