:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    
    /* Semantic Colors */
    --success: #10b981;
    --success-bg: #d1fae5;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --offer: #ec4899;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Radii */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 1rem;
    
    /* Layout */
    --max-width: 1200px;
}

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

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

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary);
}

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

button, input, select {
    font-family: inherit;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.hidden {
    display: none !important;
}

.section-title {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-main);
}

/* Header */
.header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.025em;
}

.search-container {
    flex: 1;
    max-width: 24rem;
    position: relative;
    margin: 0 2rem;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

#search-input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: 9999px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-size: 0.875rem;
}

#search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
}

.mobile-nav {
    display: none;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 1rem 0;
}

.mobile-nav.active {
    display: block;
}

.mobile-nav-link {
    display: block;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #1e1b4b 0%, var(--primary) 100%);
    color: white;
    padding: 5rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    max-width: 36rem;
    margin-inline: auto;
}

.cta-button {
    display: inline-block;
    background-color: white;
    color: var(--primary);
    padding: 0.875rem 2rem;
    border-radius: 9999px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--primary);
}

.hero-promotion {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fca5a5;
}

/* Categories */
.categories {
    padding: 2rem 0;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.category-list {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none; /* Firefox */
}

.category-list::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.category-pill {
    padding: 0.5rem 1.25rem;
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.category-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.category-pill.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Offers Section */
.offers-section {
    padding: 4rem 0 2rem;
}

.offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.offer-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--offer);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.offer-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--offer);
    margin-bottom: 0.5rem;
}

.offer-desc {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.offer-expiry {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: auto;
}

/* Product Catalogue */
.catalogue {
    padding: 2rem 0 5rem;
}

.catalogue-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.catalogue-header h2 {
    margin-bottom: 0;
}

.controls {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-controls {
    display: flex;
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.checkbox-label input {
    accent-color: var(--primary);
}

.sort-select {
    padding: 0.5rem 2rem 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--bg-card);
    font-size: 0.875rem;
    color: var(--text-main);
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.sort-select:focus {
    border-color: var(--primary);
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin: 2rem 0;
}

.empty-icon {
    color: var(--text-muted);
    opacity: 0.5;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius);
    color: var(--text-main);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background-color: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.product-image-container {
    aspect-ratio: 1;
    overflow: hidden;
    position: relative;
    background-color: #f1f5f9;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.badge {
    position: absolute;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10;
}

.badge-offer {
    top: 0.75rem;
    right: 0.75rem;
    background-color: var(--offer);
    color: white;
}

.product-info {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-category {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.product-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.price-container {
    margin-top: auto;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.current-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.old-price {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.stock-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    align-self: flex-start;
}

.stock-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.stock-in {
    background-color: var(--success-bg);
    color: #065f46;
}
.stock-in::before { background-color: var(--success); }

.stock-low {
    background-color: var(--warning-bg);
    color: #92400e;
}
.stock-low::before { background-color: var(--warning); }

.stock-out {
    background-color: var(--danger-bg);
    color: #991b1b;
}
.stock-out::before { background-color: var(--danger); }

/* About Placeholder */
.about-section {
    padding: 4rem 0;
    background-color: var(--bg-card);
    text-align: center;
}
.about-text {
    max-width: 40rem;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 1.125rem;
}

/* Footer */
.footer {
    background-color: #1e293b;
    color: #cbd5e1;
    padding: 4rem 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-logo {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.footer-col h3 {
    color: white;
    font-size: 1.125rem;
    margin-bottom: 1.25rem;
}

.footer-col a, .footer-col p {
    display: block;
    margin-bottom: 0.75rem;
    color: #94a3b8;
}

.footer-col a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.footer-col .social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background-color: #334155;
    border-radius: 50%;
    color: white !important;
    font-size: 0.875rem;
    font-weight: bold;
    margin-bottom: 0;
}

.footer-col .social-icon:hover {
    background-color: var(--primary);
}

.footer-bottom {
    background-color: #0f172a;
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.875rem;
    color: #64748b;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    display: flex !important; /* Override the standard .hidden utility */
}

.modal-content {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.hidden .modal-content {
    transform: scale(0.95);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-main);
    border: none;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    z-index: 10;
    transition: all 0.2s;
}

.modal-close:hover {
    background-color: var(--danger-bg);
    color: var(--danger);
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .modal-body {
        grid-template-columns: 1fr 1fr;
    }
}

.modal-image-container {
    background-color: #f1f5f9;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.modal-info {
    padding: 2.5rem;
}

.modal-info .product-category {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.modal-info .product-name {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: block;
}

.modal-info .price-container {
    margin-bottom: 1.5rem;
}

.modal-info .current-price {
    font-size: 1.5rem;
}

.modal-info .old-price {
    font-size: 1.125rem;
}

.modal-offer-banner {
    background-color: #fdf2f8;
    border: 1px solid #fbcfe8;
    color: #db2777;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
    color: var(--text-main);
}

.modal-description {
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.modal-specs {
    list-style: none;
    margin-top: 0.75rem;
}

.modal-specs li {
    display: flex;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.modal-specs li:last-child {
    border-bottom: none;
}

.modal-specs li span {
    color: var(--text-muted);
    width: 40%;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        padding: 0 1rem;
    }
    
    .category-list {
        flex-wrap: wrap;
    }
    
    .search-container {
        display: none; /* Hide in header, maybe show below in a real app, but for now we'll keep it simple */
    }
    
    .nav-links {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .catalogue-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sort-select {
        width: 100%;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .product-info {
        padding: 1rem;
    }
    
    .product-name {
        font-size: 0.875rem;
    }
    
    .current-price {
        font-size: 1.125rem;
    }
    
    .modal-info {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .product-info {
        padding: 0.75rem;
    }

    .product-name {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }

    .current-price {
        font-size: 0.9rem;
    }

    .old-price {
        font-size: 0.7rem;
    }
    
    .stock-status {
        padding: 0.2rem 0.4rem;
        font-size: 0.65rem;
    }
}
