:root {
    --primary-color: #3b66f5;
    --bg-color: #f8f9fb;
    --text-color: #1a1d23;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --card-bg: #ffffff;
    --header-bg: #ffffff;
    --white: #ffffff;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.header-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.header-logo span {
    margin-top: -2px;
}

.header-logo-icon {
    width: 60px;
    height: 60px;
}

.search-bar {
    flex: 1;
    max-width: 500px;
}

.search-bar form {
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 14px 25px;
    padding-right: 120px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: #f3f4f6;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.search-bar input:focus {
    background: #fff;
    box-shadow: 0 10px 25px rgba(59, 102, 245, 0.1), 0 0 0 4px rgba(59, 102, 245, 0.05);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.search-submit-btn {
    position: absolute;
    right: 8px;
    top: 8px;
    bottom: 8px;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0 22px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(59, 102, 245, 0.2);
}

.search-submit-btn:hover {
    background: #2a52d9;
    transform: scale(1.02);
    box-shadow: 0 6px 15px rgba(59, 102, 245, 0.3);
}

.clear-search {
    position: absolute;
    right: 95px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    text-decoration: none;
    font-size: 22px;
    font-weight: 300;
    line-height: 1;
    padding: 5px;
    transition: color 0.2s;
}

.clear-search:hover {
    color: #333;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 12px 24px;
    border-radius: 14px;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.action-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5px;
}

.action-btn:hover {
    transform: translateY(-2px);
}

.btn-blue { background: var(--primary-color); color: white; }
.btn-gray { background: #4b5563; color: white; }

/* Sub-header */
.sub-header {
    background: white;
    padding: 12px 0;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border-color);
}

.sub-header-content {
    display: flex;
    gap: 30px;
    align-items: center;
    color: var(--text-muted);
    font-weight: 600;
}

.sub-header-content div {
    cursor: pointer;
    transition: color 0.2s;
}

.sub-header-content div:hover {
    color: var(--primary-color);
}

/* Banner */
.banner {
    background: linear-gradient(rgba(59, 102, 245, 0.85), rgba(30, 59, 179, 0.85)), url('../img/5787579104537284047.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 30px;
    padding: 60px;
    color: white;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(59, 102, 245, 0.15);
}

.banner-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
}

@media (max-width: 992px) {
    .banner {
        text-align: center;
        padding: 40px 20px;
    }
    
    .banner-content {
        max-width: 100%;
    }
}

.banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(59, 102, 245, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 1;
}

.banner::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -5%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(147, 51, 234, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 1;
}



.banner h1 {
    font-size: 3.8rem;
    font-weight: 900;
    margin-bottom: 15px;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: -1px;
}

.banner .badge {
    background: linear-gradient(90deg, #ffd700, #ffae00);
    color: #000;
    padding: 4px 16px;
    border-radius: 12px;
    font-size: 0.95em;
    font-weight: 800;
    display: inline-block;
    transform: rotate(-2deg);
    box-shadow: 0 8px 25px rgba(255, 174, 0, 0.4);
    position: relative;
    overflow: hidden;
    margin: 0 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.banner .badge::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 20%;
    height: 200%;
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(30deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -60%; }
    20% { left: 120%; }
    100% { left: 120%; }
}

.banner p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 500px;
    margin-bottom: 30px;
}

.banner-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
    position: relative;
    z-index: 2;
}

.stat-item {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(12px);
    padding: 12px 24px;
    border-radius: 16px;
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-3px);
    border-color: rgba(255,255,255,0.2);
}

/* Categories Nav */
.categories-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

.cat-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: white;
    border-radius: 15px;
    text-decoration: none;
    color: #4b5563;
    font-weight: 700;
    border: 1px solid #eee;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.cat-nav-item:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #f0f4ff;
    transform: translateY(-2px);
}

.cat-nav-item.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 10px 20px rgba(59, 102, 245, 0.2);
}

/* Product Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 50px;
}

/* Responsive Adaptation */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .container {
        max-width: 960px;
    }
}

@media (max-width: 992px) {
    .header-top {
        flex-wrap: wrap;
        gap: 15px;
    }
    .search-bar {
        order: 3;
        max-width: 100%;
    }
    .banner {
        padding: 40px;
        min-height: auto;
    }
    .banner h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    .header-actions {
        gap: 8px;
    }
    .action-btn {
        padding: 10px 15px;
        font-size: 0.85rem;
        gap: 8px;
    }
    .banner h1 {
        font-size: 2rem;
    }
    .banner p {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    .header-top {
        justify-content: center;
    }
    .header-logo {
        margin-bottom: 10px;
    }
    .header-actions {
        width: 100%;
        justify-content: center;
    }
    .action-btn {
        flex: 1;
        justify-content: center;
    }
    .banner {
        padding: 30px 20px;
    }
    .banner-stats {
        flex-direction: column;
    }
    .stat-item {
        width: 100%;
        text-align: center;
    }
    .categories-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }
    .cat-nav-item {
        flex-shrink: 0;
    }
}

.product-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    width: 100%;
    cursor: pointer;
    text-decoration: none; /* In case we use <a> */
}

.product-card:active {
    transform: scale(0.98);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
    border-color: rgba(59, 102, 245, 0.2);
}

.product-card-header {
    display: flex;
    justify-content: center;
    margin-bottom: 5px;
    transition: transform 0.3s ease;
}

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

.product-card-img {
    width: 249px;
    height: 160px;
    object-fit: contain;
}

.product-card-title {
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    height: 2.8rem;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: #333;
    margin-bottom: 5px;
}

.product-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stock-info {
    color: #333;
}

.price-tag {
    color: #000;
}

.buy-btn-full {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
    width: 100%;
}

.buy-btn-full:hover {
    background: #2b55e0;
}

.cart-icon-svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Modal Styling Update */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 28px;
    width: 95%;
    max-width: 850px;
    position: relative;
    box-shadow: 0 35px 70px -15px rgba(0, 0, 0, 0.3);
    animation: modalSlide 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-product-info {
    display: flex;
    gap: 40px;
    margin-bottom: 30px;
    align-items: flex-start;
}

.modal-product-img {
    width: 300px;
    height: 300px;
    object-fit: contain;
    border-radius: 20px;
    background: #f8f9fb;
    padding: 25px;
    flex-shrink: 0;
    border: 1px solid #f0f0f0;
}

.modal-product-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.modal-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-color);
    line-height: 1.2;
    padding-right: 40px;
    margin: 0;
}

.modal-description {
    font-size: 1.05rem;
    color: #4b5563;
    line-height: 1.7;
    margin-bottom: 25px;
    white-space: pre-line;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 10px;
}

/* Custom Scrollbar for description */
.modal-description::-webkit-scrollbar {
    width: 6px;
}
.modal-description::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
.modal-description::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}
.modal-description::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

.modal-external-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    background: var(--primary-color);
    color: white;
    padding: 18px;
    border-radius: 16px;
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 12px 25px rgba(59, 102, 245, 0.25);
}

.modal-external-btn:hover {
    background: #2b55e0;
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(59, 102, 245, 0.35);
}

@media (max-width: 768px) {
    .modal-content {
        padding: 30px 20px;
    }
    .modal-product-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 25px;
    }
    .modal-product-img {
        width: 220px;
        height: 220px;
    }
    .modal-header h2 {
        font-size: 1.5rem;
        text-align: center;
        padding-right: 0;
    }
    .modal-header {
        justify-content: center;
        position: relative;
    }
    .close-modal {
        position: absolute;
        right: 0;
        top: -10px;
    }
}

@keyframes modalSlide {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-header h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-color);
    line-height: 1.2;
    padding-right: 20px;
    margin: 0;
}

.close-modal {
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.close-modal:hover { color: #333; }

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--primary-color);
}

.modal-footer {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.total-price-block {
    font-size: 1.2rem;
    font-weight: 800;
    text-align: center;
    padding: 15px;
    background: #f8f9fb;
    border-radius: 12px;
}

.checkout-btn {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.checkout-btn:hover {
    background: #2b55e0;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .banner h1 { font-size: 2rem; }
    .header-top { flex-direction: column; align-items: stretch; }
    .search-bar { order: 3; max-width: none; }
}
