/* Design Tokens */
:root {
    --bg-main: #0b0f19;
    --bg-card: #151d30;
    --bg-header: rgba(21, 29, 48, 0.85);
    --border-color: #24324f;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --accent-red: #ef4444;
    --accent-gold: #f59e0b;
    --accent-green: #10b981;
    --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header with Glassmorphism */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background-color: var(--bg-header);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-badge {
    background-color: var(--accent-red);
    color: white;
    font-weight: 800;
    font-size: 1.4rem;
    padding: 2px 10px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-gold);
    letter-spacing: 0.5px;
}

.search-bar {
    position: relative;
    width: 40%;
    max-width: 500px;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-bar input {
    width: 100%;
    background-color: rgba(11, 15, 25, 0.6);
    border: 1px solid var(--border-color);
    padding: 10px 20px 10px 45px;
    border-radius: 9999px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
}

.search-bar input:focus {
    border-color: var(--accent-gold);
    background-color: rgba(11, 15, 25, 0.9);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.cart-trigger {
    position: relative;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 10px 15px;
    border-radius: 8px;
    transition: var(--transition-smooth);
}

.cart-trigger:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-gold);
}

.cart-trigger i {
    font-size: 1.2rem;
    color: var(--accent-gold);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--accent-red);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 9999px;
}

/* Hero Section with Glowing Gradients */
.hero-section {
    padding-top: 130px;
    padding-bottom: 60px;
    background: radial-gradient(circle at 80% 20%, rgba(239, 68, 68, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 10% 80%, rgba(245, 158, 11, 0.1) 0%, transparent 50%);
}

.hero-content {
    max-width: 800px;
}

.hero-content h1 {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ffffff 30%, var(--accent-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.hero-stats {
    display: flex;
    gap: 40px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-red);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Main Layout Grid */
.main-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    padding-bottom: 100px;
}

/* Sidebar Styling */
.sidebar-block {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    position: sticky;
    top: 90px;
}

.sidebar-block h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-list {
    list-style: none;
}

.category-list li {
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
    margin-bottom: 5px;
}

.category-list li:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
}

.category-list li.active {
    color: var(--bg-main);
    background-color: var(--accent-gold);
    font-weight: 600;
}

/* Product Area */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.results-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.results-header span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* Product Card Styling */
.product-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-gold);
    box-shadow: var(--shadow-premium);
}

.card-img-container {
    height: 200px;
    background-color: rgba(11, 15, 25, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 15px;
}

.card-img-container img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: var(--transition-smooth);
}

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

.card-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--accent-gold);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.card-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-info h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    line-height: 1.3;
    min-height: 2.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-info .desc-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6rem;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.btn {
    border: none;
    outline: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--accent-gold);
    color: var(--bg-main);
}

.btn-primary:hover {
    background-color: #e08f06;
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--text-secondary);
}

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

.btn-success:hover {
    background-color: #0d9668;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Modals General Style */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

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

.modal-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    padding: 30px;
    box-shadow: var(--shadow-premium);
    transform: translateY(20px);
    transition: var(--transition-smooth);
}

.modal.active .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.close-modal:hover {
    color: var(--accent-red);
}

/* Modal Details Structure */
.modal-product-header {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.modal-img-container {
    background-color: rgba(11, 15, 25, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-img-container img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.modal-product-meta h2 {
    font-size: 1.8rem;
    margin-top: 8px;
    margin-bottom: 10px;
}

.modal-badge {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.price-range {
    font-size: 1.1rem;
    color: var(--accent-gold);
    font-weight: 500;
    margin-bottom: 25px;
}

.modal-details-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.tab-header {
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.tab-header.active {
    color: var(--accent-gold);
    border-bottom-color: var(--accent-gold);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.tab-pane table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.tab-pane th, .tab-pane td {
    border: 1px solid var(--border-color);
    padding: 12px;
    text-align: left;
    font-size: 0.9rem;
}

.tab-pane tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.01);
}

.tab-pane ul {
    margin-left: 20px;
    padding: 10px 0;
}

.tab-pane li {
    margin-bottom: 8px;
}

/* Cart Sidebar Slide Out */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    height: 100%;
    background-color: var(--bg-card);
    border-left: 1px solid var(--border-color);
    z-index: 300;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.4);
}

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

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

.close-cart {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.close-cart:hover {
    color: var(--accent-red);
}

.cart-items-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.cart-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    background-color: rgba(11, 15, 25, 0.4);
    border-radius: 6px;
    padding: 5px;
}

.cart-item-info {
    flex-grow: 1;
}

.cart-item-info h5 {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.cart-item-remove {
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
    align-self: center;
}

.cart-item-remove:hover {
    color: var(--accent-red);
}

.cart-total-section {
    padding: 20px;
    background-color: rgba(11, 15, 25, 0.4);
    border-top: 1px solid var(--border-color);
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.total-price {
    color: var(--accent-gold);
}

.price-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Checkout Form inside Cart */
.checkout-form-section {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background-color: rgba(11, 15, 25, 0.6);
}

.checkout-form-section h4 {
    margin-bottom: 12px;
    font-size: 1rem;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.form-group input {
    width: 100%;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
}

.form-group input:focus {
    border-color: var(--accent-gold);
}

/* Footer Styling */
.main-footer {
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
    background-color: rgba(11, 15, 25, 0.9);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-info h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.footer-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.footer-links p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Accents and Utils */
.icon-gold {
    color: var(--accent-gold);
}

.text-red {
    color: var(--accent-red);
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none; /* Hide category sidebar on mobile for simplicity */
    }
}

@media (max-width: 768px) {
    .search-bar {
        display: none; /* Hide search bar on small headers */
    }
    
    .hero-content h1 {
        font-size: 2.2rem;
    }
    
    .footer-container {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}
