/* Global Styles */
:root {
    --primary-color: #c30c0c;
    --text-color: #000000;
    --bg-color: #ffffff;
    --secondary-bg: #f4f4f4;
    --border-color: #e0e0e0;
    --font-main: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-main);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

.hidden {
    display: none !important;
}

ul {
    list-style: none;
}

/* Header */
.main-header {
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
}

.main-logo {
    height: 100px;
    /* Significantly increased size */
    width: auto;
    display: block;
}

.search-bar {
    flex: 1;
    max-width: 600px;
    margin: 0 2rem;
    display: flex;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-right: none;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: var(--primary-color);
}

.search-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 1.5rem;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.search-button:hover {
    background-color: #a00a0a;
}

.header-icons {
    display: flex;
    gap: 1.5rem;
}

.icon-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #333;
    font-size: 0.8rem;
    position: relative;
    /* For badge positioning */
}

.icon-link svg {
    margin-bottom: 0.25rem;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: 5px;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    display: none;
    /* Hidden by default */
}

/* Navigation Bar */
.nav-bar {
    background-color: #1a1a1a;
    color: white;
    padding: 0 2rem;
    height: 50px;
}

.nav-container {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 2rem;
}

.departments-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 1.5rem;
    height: 50px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.departments-btn:hover {
    background-color: #a00a0a;
}

.nav-list {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-item a {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
    transition: color 0.2s;
}

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

/* Departments Menu (Sidebar) */
.departments-menu {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background-color: white;
    z-index: 2000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.departments-menu.active {
    left: 0;
}

.departments-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

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

.menu-header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-header h3 {
    font-size: 1.1rem;
    text-transform: uppercase;
    font-weight: 700;
}

.close-menu-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.departments-list {
    flex: 1;
    padding: 1rem 0;
}

.dept-item {
    border-bottom: 1px solid #f0f0f0;
}

.dept-item>a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #333;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background-color 0.2s, color 0.2s;
}

.dept-item>a:hover {
    background-color: #f9f9f9;
    color: var(--primary-color);
}

/* Submenu */
.submenu {
    display: none;
    background-color: #f9f9f9;
    padding: 0.5rem 0;
    border-top: 1px solid #eee;
}

.dept-item:hover .submenu {
    display: block;
}

.submenu li a {
    display: block;
    padding: 0.5rem 2.5rem;
    color: #666;
    font-size: 0.9rem;
}

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

/* Responsive */
@media (max-width: 768px) {
    .nav-bar {
        padding: 0;
    }

    .nav-container {
        gap: 0;
        justify-content: space-between;
        width: 100%;
    }

    .departments-btn {
        flex: 1;
        justify-content: center;
    }

    .nav-list {
        display: none;
        /* Hide secondary links on mobile for now */
    }

    .main-header {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
    }

    .main-logo {
        height: 50px;
        /* Reduce logo size on mobile */
    }

    .logo-container {
        grid-column: 1;
        grid-row: 1;
        display: flex;
        align-items: center;
    }

    .header-icons {
        grid-column: 2;
        grid-row: 1;
        gap: 0.75rem;
    }

    .search-bar {
        grid-column: 1 / -1;
        grid-row: 2;
        max-width: none;
        margin-top: 0.5rem;
    }

    .nav-bar {
        display: block;
        padding: 0 1rem;
        overflow-x: auto;
        /* Allow scrolling if nav items overflow */
    }

    .nav-list {
        gap: 1rem;
        white-space: nowrap;
    }
}

/* Hero Section */
.hero-section {
    background-color: #222;
    color: white;
    padding: 4rem 2rem;
    text-align: center;
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('https://images.unsplash.com/photo-1530267981375-f0de937f5f13?q=80&w=2070&auto=format&fit=crop');
    /* Placeholder industrial image */
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    max-width: 800px;
}

.hero-subtitle {
    font-size: 1.2rem;
    font-weight: 400;
    color: #e0e0e0;
    margin-bottom: 2rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    border: none;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    display: inline-block;
}

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

/* Product Grid */
.products-section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

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

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

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

.product-card {
    background-color: white;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.product-image {
    width: 100%;
    height: 200px;
    background-color: var(--secondary-bg);
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
}

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

.product-category {
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.product-price {
    display: flex;
    flex-direction: column;
    margin-top: auto;
    padding-top: 1rem;
}

.old-price {
    font-size: 0.9rem;
    color: #999;
    text-decoration: line-through;
    font-weight: 500;
}

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

.product-actions {
    margin-top: 1rem;
}

.btn-add-cart {
    width: 100%;
    padding: 0.75rem;
    background-color: black;
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-add-cart:hover {
    background-color: var(--primary-color);
}

.btn-add-cart:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.stock-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.stock-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ccc;
    /* Default gray */
    display: inline-block;
}

.stock-indicator.in-stock {
    background-color: #28a745;
    /* Green */
}

.stock-indicator.out-of-stock {
    background-color: #dc3545;
    /* Red */
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .products-section {
        padding: 2rem 1rem;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 columns on mobile */
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
        /* 1 column on very small screens */
    }
}

/* Add to Cart Confirmation Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.confirmation-modal {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.show .confirmation-modal {
    transform: translateY(0);
}

.modal-icon {
    width: 64px;
    height: 64px;
    background-color: #e8f5e9;
    color: #4CAF50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #333;
}

.modal-message {
    color: #666;
    margin-bottom: 2rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-continue {
    padding: 0.75rem 1.5rem;
    border: 1px solid #ddd;
    background-color: white;
    color: #333;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-continue:hover {
    background-color: #f5f5f5;
    border-color: #ccc;
}

.btn-checkout {
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-checkout:hover {
    background-color: #a30a0a;
}

@media (max-width: 480px) {
    .modal-actions {
        flex-direction: column;
    }

    .btn-continue,
    .btn-checkout {
        width: 100%;
    }
}

/* Footer */
.main-footer {
    background-color: #1a1a1a;
    color: #e0e0e0;
    padding: 3rem 0 1rem;
    margin-top: 3rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    color: white;
    font-size: 1.1rem;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-links li,
.footer-contact li {
    margin-bottom: 0.75rem;
}

.footer-links a,
.footer-contact a {
    color: #999;
    transition: color 0.2s;
}

.footer-links a:hover,
.footer-contact a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid #333;
    padding-top: 1.5rem;
    margin-top: 2rem;
    color: #666;
    font-size: 0.9rem;
}