/* Global Styles */
:root {
    --text-color: #333;
    --bg-color: #fff;
    --light-bg: #f8f9fa;
    --border-color: #e9ecef;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
}

/* Responsive Table */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.site-header {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
}

.top-bar {
    background: #333;
    color: #fff;
    padding: 5px 0;
    font-size: 13px;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 19.5px 0;
}

/* Logo */
.logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo img {
    height: 48px;
    width: auto;
}

.logo-text {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
}

.main-nav ul {
    display: flex;
    gap: 20px;
}

.main-nav a {
    font-weight: 500;
    font-size: 16px;
}

.main-nav a:hover {
    color: var(--primary-color);
}

.user-actions a {
    margin-left: 15px;
    font-size: 18px;
    color: #555;
}

.user-actions a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: var(--light-bg);
    padding: 40px 0 60px;
    /* Reduced top padding significantly */
    text-align: center;
}

.hero h1 {
    font-size: 48px;
    margin-top: 0;
    /* Remove default browser margin */
    margin-bottom: 15px;
    color: #222;
}

.hero p {
    font-size: 18px;
    color: #666;
    margin-bottom: 25px;
}

.btn-shop {
    background: var(--primary-color);
    color: #fff;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 600;
    display: inline-block;
}

.btn-shop:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Products Grid */
.products-section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 32px;
    font-weight: 700;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    margin: 15px auto 0;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.product-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: 0.3s;
    background: #fff;
}

.product-card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

.product-img {
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    padding: 20px;
}

.product-img img {
    max-height: 100%;
    object-fit: contain;
}

.product-info {
    padding: 20px;
    text-align: center;
}

.product-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
    color: #333;
}

.product-price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 15px;
}

.btn-add-cart {
    display: block;
    width: 100%;
    padding: 10px;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 4px;
    font-weight: 600;
    transition: 0.3s;
    background: transparent;
    cursor: pointer;
}

.btn-add-cart:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Footer */
.site-footer {
    background: #222;
    color: #fff;
    padding: 60px 0 20px;
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 18px;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
    padding-bottom: 10px;
}

.footer-col p,
.footer-col a {
    color: #aaa;
    font-size: 14px;
    line-height: 1.8;
}

.footer-col a:hover {
    color: #fff;
}

.copyright {
    text-align: center;
    border-top: 1px solid #333;
    padding-top: 20px;
    color: #777;
    font-size: 14px;
}

/* Hero Search Form - UPDATED / COMPACT */
.hero-search-wrapper {
    margin: 20px auto;
    max-width: 500px;
}

.hero-search-form {
    display: flex;
    background: #fff;
    border-radius: 50px;
    padding: 3px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #ddd;
}

.hero-search-form input {
    flex: 1;
    border: none;
    padding: 10px 20px;
    border-radius: 50px 0 0 50px;
    outline: none;
    font-size: 14px;
}

.hero-search-form button {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.hero-search-form button:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

/* Responsive Search */
@media (max-width: 480px) {
    .hero-search-wrapper {
        margin: 15px auto;
        width: 90%;
    }

    .hero-search-form {
        border-radius: 30px;
    }

    .hero-search-form input {
        padding: 10px 15px;
        font-size: 13px;
    }

    .hero-search-form button {
        padding: 8px 15px;
        font-size: 13px;
    }
}

/* Dashboard Styles */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.dash-card {
    border: 1px solid #e0e0e0;
    padding: 25px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.dash-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.dash-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    opacity: 0;
    transition: 0.3s;
}

.dash-card:hover::before {
    opacity: 1;
}

.dash-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #f0f4ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.dash-info h3 {
    margin: 0 0 5px;
    font-size: 18px;
    color: #333;
}

.dash-info p {
    margin: 0;
    color: #777;
    font-size: 14px;
}

/* Dashboard Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border: none;
    width: 90%;
    max-width: 600px;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.close:hover {
    color: #333;
}

/* Mobile Menu */
.mobile-controls {
    display: none !important;
    /* Hidden by default on desktop */
}

.mobile-cart-btn {
    font-size: 20px;
    color: var(--primary-color);
}

.mobile-menu-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--primary-color);
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .header-flex {
        flex-wrap: wrap;
    }

    .mobile-controls {
        display: flex !important;
        /* Show on mobile */
    }

    .main-nav,
    .user-actions {
        width: 100%;
        display: none;
        /* Hidden by default on mobile */
        text-align: center;
        margin-top: 15px;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 15px;
    }

    .user-actions {
        display: none;
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
        border-top: 1px solid #eee;
        padding-top: 20px;
    }

    /* Active State for Mobile Menu */
    .main-nav.active,
    .user-actions.active {
        display: block;
        animation: fadeIn 0.3s;
    }

    .user-actions.active {
        display: flex;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .hero h1 {
        font-size: 32px;
    }
}

/* ==========================================
   ENHANCED MOBILE RESPONSIVENESS (USER SIDE)
   ========================================== */

@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }

    .section-title {
        font-size: 24px;
        margin-bottom: 25px;
    }

    .hero-slider-section {
        padding: 10px 0;
    }

    .slider-container {
        max-width: 95% !important;
    }

    .slide h2 {
        font-size: 16px;
    }

    .slide .btn-shop {
        padding: 6px 15px;
    }

    /* Product Grid for Mobile - 2 Columns */
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
        gap: 15px !important;
    }

    .product-card {
        padding: 0;
    }

    .product-img {
        height: 180px !important;
        padding: 10px !important;
    }

    .product-info {
        padding: 10px !important;
    }

    .product-title {
        font-size: 14px !important;
        height: 40px;
        overflow: hidden;
    }

    .product-price {
        font-size: 15px !important;
    }

    .btn-add-cart {
        padding: 8px 4px !important;
        font-size: 11px !important;
        gap: 2px !important;
    }

    /* Modal Tweaks */
    .modal-content {
        padding: 20px;
        margin: 10% auto;
        width: 95%;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr 1fr !important;
        /* Force 2 columns on very small screens */
    }

    .logo-text {
        font-size: 18px !important;
    }

    .hero h1 {
        font-size: 26px !important;
    }
}