/* 888 Go-To-Mart - Main Stylesheet */
/* Color Palette:
   Primary Red: #C8102E
   White: #FFFFFF
   Light Silver/Gray: #E0E0E0, #D3D3D3
   Vibrant Orange: #FF6F00
   Background: #FAFAFA, #F9F9F9
*/

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* Prevent horizontal scrolling */
html {
    overflow-x: hidden;
    width: 100%;
}

/* Force proper box-sizing inheritance */
*, *:before, *:after {
    box-sizing: inherit;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #FAFAFA;
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

html, body {
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* Container and Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.section {
    padding: 4rem 0;
}

.section-alt {
    background-color: #FFFFFF;
}

/* Header and Navigation */
.header {
    background: linear-gradient(135deg, #771212 0%, #b70202 100%);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(200, 16, 46, 0.2);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-img {
    width: 50px;
    height: 50px;
    justify-content: start;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.2s ease;
    max-width: 100%;
    height: auto;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

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

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(191, 48, 48, 0.1);
    transform: translateY(-1px);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 0.9rem;
    width: 200px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    background: white;
    width: 250px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.cart-button {
    position: relative;
    background: rgb(255, 0, 0);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 111, 0, 0.3);
}

.cart-button:hover {
    background: rgb(202, 0, 0);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 111, 0, 0.4);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: white;
    color: #C8102E;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    line-height: 1;
}

.btn-primary {
    background:#C8102E;
    color: white;
    border: 2px solid #858585;
}

.btn-primary:hover {
    background:#A00E26;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.4);
}

.btn-secondary {
    background: rgb(255, 0, 0);
    color: white;
    border: 2px solid #e8e2e2;
}

.btn-secondary:hover {
    background: #cb4903;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.4);
}

.btn-outline {
    background: white;
    color: rgb(0, 0, 0);
    border: 2px solid #ff002b;
}

.btn-outline:hover {
    background: rgb(223, 220, 220);
    color: rgb(0, 0, 0);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.4);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #bb1534 0%, #FF6F00 50%, #A00E26 100%);
    color: white;
    padding: 2rem 0 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    opacity: 0.1;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.hero-logo {
    width: 250px;
    height: 250px;
    margin: 2rem auto 2rem auto;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.25);
    max-width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.hero-logo:hover {
    transform: rotateY(180deg);
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 3rem;
    opacity: 0.95;
    font-weight: 400;
}

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

/* Product Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.product-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid #E0E0E0;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    border-color: #C8102E;
}

.product-image {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F9F9F9;
    border-radius: 8px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.product-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #C8102E;
    margin-bottom: 0.5rem;
}

.product-category {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
    text-transform: capitalize;
}

.product-stock {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
}

.in-stock {
    background: #E8F5E8;
    color: #2E7D32;
}

.out-of-stock {
    background: #FFEBEE;
    color: #C62828;
}

/* Category Filters */
.category-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.category-filter {
    padding: 0.5rem 1rem;
    border: 2px solid #E0E0E0;
    background: white;
    color: #666;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.category-filter:hover,
.category-filter.active {
    border-color: #C8102E;
    background: #C8102E;
    color: white;
    transform: translateY(-1px);
}

/* Filter Dropdown */
.filter-dropdown-container {
    position: relative;
    display: inline-block;
}

.filter-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-dropdown-content {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: white;
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    margin-top: 0.5rem;
    padding: 0.5rem 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.25rem;
}

@media (max-width: 768px) {
    .filter-dropdown-content {
        width: 90%;
        min-width: 150px;
        max-width: 280px;
        left: 50%;
        transform: translateX(-50%);
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }
    
    .filter-dropdown-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
        min-height: 44px;
    }
}

.dropdown-item {
    padding: 0.75rem 1rem;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
}

.dropdown-divider {
    height: 1px;
    background-color: #E0E0E0;
    margin: 0.5rem 0;
    transition: all 0.2s ease;
    color: #333;
    font-size: 0.9rem;
}

.dropdown-item:hover,
.dropdown-item.active {
    background: #f8f8f8;
    color: #C8102E;
}

/* Selected Filters */
.selected-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

@media (max-width: 768px) {
    .selected-filters {
        padding: 0 0.5rem;
    }
}

/* Subcategory Preview */
.subcategory-preview {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    text-align: center;
}

.subcategory-preview p {
    color: #666;
    font-size: 0.95rem;
    margin: 0;
}

.selected-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: #C8102E;
    color: white;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .selected-filter-tag {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

.clear-filter {
    background: none;
    border: none;
    color: white;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.clear-filter:hover {
    background: rgba(255,255,255,0.2);
}

@media (max-width: 768px) {
    .clear-filter {
        font-size: 0.9rem;
        margin-left: 0.3rem;
        padding: 0.2rem;
    }
}

/* Responsive adjustments for filter dropdown */
@media (max-width: 768px) {
    .filter-dropdown-content {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        min-width: 250px;
        max-width: 90vw;
        max-height: 50vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .category-filters {
        gap: 0.5rem;
        position: relative;
    }
    
    .category-filter {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .filter-dropdown-container {
        position: static;
        display: block;
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .filter-dropdown-btn {
        width: 100%;
        justify-content: center;
        background-color: #C8102E;
        color: white;
        border-color: #C8102E;
    }
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #C8102E;
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.modal {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #E0E0E0;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #F5F5F5;
    color: #C8102E;
}

/* Footer */
.footer {
    background: #333;
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

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

.footer-section h3 {
    color: #C8102E;
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-section p,
.footer-section a {
    color: #ccc;
    text-decoration: none;
    line-height: 1.6;
}

.footer-section a:hover {
    color: #FF6F00;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid #555;
    color: #999;
}

/* Mobile-First Responsive Enhancements */

/* Touch-friendly base styles for all mobile devices */
@media (max-width: 768px) {
    /* Mobile CSS Reset */
    html {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        width: 100%;
        overflow-x: hidden;
        margin: 0;
        padding: 0;
    }
    
    body {
        width: 100%;
        overflow-x: hidden;
        position: relative;
        min-width: 320px;
        margin: 0;
        padding: 0;
    }
    
    /* Improve touch targets and scrolling */
    * {
        -webkit-tap-highlight-color: rgba(200, 16, 46, 0.2);
        -webkit-touch-callout: none;
        max-width: 100%;
    }
    
    /* Smooth scrolling for mobile */
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Prevent zoom on input focus */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Optimize images for mobile */
    img {
        max-width: 100%;
        height: auto;
        image-rendering: -webkit-optimize-contrast;
        width: auto;
        display: block;
    }
    
    /* Prevent elements from breaking layout */
    div, section, article, aside, header, footer, nav {
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    /* Fix flex containers */
    .nav-container, .header-actions, .hero-actions {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Mobile-specific performance optimizations */
    .container {
        will-change: transform;
    }
    
    /* Improve button accessibility on mobile */
    button, .btn, a {
        min-height: 44px; /* Apple's recommended touch target size */
        min-width: 44px;
        position: relative;
    }
    
    /* Enhanced focus states for mobile */
    button:focus, .btn:focus, input:focus, textarea:focus, select:focus {
        outline: 2px solid #C8102E;
        outline-offset: 2px;
    }
    
    /* Prevent text selection on UI elements */
    .header, .modern-nav, .cart-button, .auth-buttons {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* Optimize animations for mobile */
    * {
        animation-duration: 0.2s !important;
        transition-duration: 0.2s !important;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem 0.5rem 0 0.5rem;
        align-items: stretch;
    }
    .logo {
        display: flex;
        align-items: center;
        gap: 0.15rem;
        margin: 0;
        padding: 0;
        background: none;
        border: none;
        min-width: 0;
        height: 28px;
        flex-shrink: 0;
    }
    .logo-img {
        width: 22px;
        height: 22px;
        object-fit: contain;
        border-radius: 4px;
        margin: 0;
    }
    .logo-text {
        font-size: 0.85rem;
        font-weight: 700;
        letter-spacing: -0.2px;
        margin: 0;
        line-height: 1;
        white-space: nowrap;
    }
    .modern-nav {
        width: 100%;
        background: rgba(255,255,255,0.05);
        border-radius: 10px;
        padding: 0.25rem 0;
        margin-bottom: 0.5rem;
    }
    .modern-nav ul {
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
        padding: 0;
        margin: 0;
    }
    .modern-nav li {
        flex: 1 1 0;
        display: flex;
        justify-content: center;
        align-items: center;
        min-width: 40px;
        margin: 0;
    }
    .modern-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        font-size: 0.95rem;
        padding: 0.3rem 0.1rem;
        width: 100%;
        color: white;
        text-decoration: none;
        border-radius: 8px;
        transition: background 0.2s;
    }
    .modern-nav a.active, .modern-nav a:hover {
        background: rgba(255,255,255,0.12);
    }
    .modern-nav i {
        font-size: 1.4rem;
        margin-bottom: 0.1rem;
        display: block;
        width: 100%;
        text-align: center;
    }
    .header-actions {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }
    .search-container {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    .search-input {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
        display: block;
    }
    .cart-button {
        margin-left: 0.5rem;
    }
    
    .hero {
        padding: 3rem 0;
        text-align: center;
    }
    
    .hero h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero p {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .search-input {
        width: 200px;
        padding: 0.75rem 1rem;
    }
    
    .search-input:focus {
        width: 250px;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        min-height: 44px; /* Touch-friendly */
    }
    
    .modern-nav ul {
        gap: 1.5rem;
    }
    
    .modern-nav a {
        font-size: 1rem;
    }
    
    .modern-nav i {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    /* Enhanced container and layout */
    .container {
        padding: 0 0.75rem;
        max-width: 100%;
    }
    
    /* Hero section optimizations */
    .hero {
        padding: 1.5rem 0;
        margin-bottom: 1rem;
    }
    
    .hero-content {
        padding: 0 0.5rem;
    }
    
    .hero-logo {
        width: 180px;
        height: 180px;
        margin: 1rem auto;
    }
    
    .hero h1 {
        font-size: 1.75rem;
        line-height: 1.1;
        margin-bottom: 0.75rem;
    }
    
    .hero p {
        font-size: 0.95rem;
        margin-bottom: 1.25rem;
        line-height: 1.4;
    }
    
    .hero-actions {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }
    
    .hero-actions .btn {
        width: 100%;
        max-width: 280px;
        min-height: 48px;
    }
    
    /* Enhanced product grid */
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem 0.5rem;
    }
    
    .product-card {
        margin-bottom: 0.75rem;
        padding: 1.25rem;
        border-radius: 12px;
    }
    
    .product-image {
        height: 180px;
        margin-bottom: 1rem;
    }
    
    .product-name {
        font-size: 1.1rem;
        line-height: 1.3;
    }
    
    .product-price {
        font-size: 1.4rem;
        margin-bottom: 0.75rem;
    }
    
    /* Category filters mobile optimization */
    .category-filters {
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 1.5rem;
        padding: 0 0.5rem;
    }
    
    .category-filter {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        min-height: 44px;
        flex: 1 1 calc(50% - 0.25rem);
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Enhanced modal responsiveness */
    .modal-overlay {
        padding: 0.5rem;
    }
    
    .modal {
        margin: 0;
        padding: 1.25rem;
        border-radius: 12px;
        max-height: 95vh;
        width: 100%;
        max-width: 100%;
    }
    
    .modal-header {
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }
    
    .modal-title {
        font-size: 1.25rem;
    }
    
    .modal-close {
        padding: 0.75rem;
        font-size: 1.25rem;
    }
    
    /* Form enhancements */
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    .form-input,
    .form-textarea,
    .form-select {
        padding: 0.875rem;
        font-size: 1rem;
        border-radius: 8px;
        min-height: 48px;
    }
    
    .form-textarea {
        min-height: 120px;
    }
    
    /* Button optimizations */
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
        min-height: 48px;
        border-radius: 8px;
        font-weight: 500;
    }
    
    .btn-small {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        min-height: 40px;
    }
    
    .btn-large {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
        min-height: 52px;
    }
    
    /* Navigation improvements */
    .nav-links {
        flex-direction: column;
        width: 100%;
        text-align: center;
        gap: 0.5rem;
    }
    
    .modern-nav {
        border-radius: 12px;
        padding: 0.4rem;
        margin: 0.5rem 0;
    }
    
    .modern-nav ul {
        gap: 0.75rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .modern-nav li {
        min-width: 48px;
        flex: 1 1 auto;
    }
    
    .modern-nav a {
        font-size: 0.8rem;
        padding: 0.4rem 0.2rem;
        min-height: 48px;
        border-radius: 8px;
    }
    
    .modern-nav i {
        font-size: 1.1rem;
        margin-bottom: 0.15rem;
    }
    
    .modern-nav span {
        font-size: 0.7rem;
        line-height: 1.1;
    }
    
    /* Auth buttons mobile layout */
    .auth-buttons {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
        align-items: stretch;
    }
    
    .auth-buttons .btn {
        width: 100%;
        max-width: 100%;
        min-height: 48px;
    }
    
    /* Footer mobile optimization */
    .footer {
        padding: 2rem 0 0;
        margin-top: 0;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    
    .footer-section {
        padding: 0 1rem;
    }
    
    .footer-section h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .footer-section p,
    .footer-section a {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .footer-bottom {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
        font-size: 0.75rem;
    }
    
    /* Loading and utility classes */
    .loading {
        padding: 2rem;
    }
    
    .spinner {
        width: 36px;
        height: 36px;
        border-width: 3px;
    }
    
    /* Touch-friendly improvements */
    .product-card:hover {
        transform: none; /* Disable hover effects on touch devices */
    }
    
    .category-filter:hover {
        transform: none;
    }
    
    /* Improved spacing utilities for mobile */
    .mt-1 { margin-top: 0.5rem; }
    .mt-2 { margin-top: 0.75rem; }
    .mt-3 { margin-top: 1rem; }
    .mt-4 { margin-top: 1.5rem; }
    
    .mb-1 { margin-bottom: 0.5rem; }
    .mb-2 { margin-bottom: 0.75rem; }
    .mb-3 { margin-bottom: 1rem; }
    .mb-4 { margin-bottom: 1.5rem; }
    
    .p-1 { padding: 0.5rem; }
    .p-2 { padding: 0.75rem; }
    .p-3 { padding: 1rem; }
    .p-4 { padding: 1.5rem; }
}

@media (max-width: 360px) {
    /* Ultra-compact layout for very small screens */
    .container {
        padding: 0 0.5rem;
        max-width: 100%;
    }
    
    /* Hero section for small screens */
    .hero {
        padding: 1rem 0;
    }
    
    .hero-logo {
        width: 150px;
        height: 150px;
        margin: 0.75rem auto;
    }
    
    .hero h1 {
        font-size: 1.5rem;
        line-height: 1.1;
        margin-bottom: 0.5rem;
    }
    
    .hero p {
        font-size: 0.85rem;
        margin-bottom: 1rem;
        line-height: 1.3;
    }
    
    .hero-actions {
        gap: 0.5rem;
    }
    
    .hero-actions .btn {
        max-width: 100%;
        min-height: 44px;
        font-size: 0.9rem;
    }
    
    /* Compact buttons */
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        min-height: 44px;
        border-radius: 6px;
    }
    
    .btn-small {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
        min-height: 36px;
    }
    
    .btn-large {
        padding: 0.8rem 1.25rem;
        font-size: 1rem;
        min-height: 48px;
    }
    
    /* Modal adjustments */
    .modal-overlay {
        padding: 0.25rem;
    }
    
    .modal {
        margin: 0;
        padding: 1rem;
        border-radius: 8px;
        max-height: 98vh;
    }
    
    .modal-header {
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    .modal-close {
        padding: 0.5rem;
        font-size: 1.1rem;
    }
    
    /* Compact navigation */
    .modern-nav {
        padding: 0.3rem;
        border-radius: 8px;
    }
    
    .modern-nav ul {
        gap: 0.4rem;
    }
    
    .modern-nav li {
        min-width: 38px;
        max-width: 55px;
        flex: 0 0 38px;
        min-height: 50px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    
    .modern-nav a {
        font-size: 0.7rem;
        padding: 0.3rem 0.1rem;
        min-height: 42px;
        border-radius: 6px;
    }
    
    .modern-nav i {
        font-size: 0.9rem;
        margin-bottom: 0.15rem;
    }
    
    .modern-nav span {
        font-size: 0.45rem;
        line-height: 1;
        white-space: normal;
        text-align: center;
        word-break: break-word;
        max-width: 100%;
        display: block;
    }
    
    /* Product grid ultra-compact */
    .products-grid {
        padding: 0.75rem 0.25rem;
        gap: 0.75rem;
    }
    
    .product-card {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .product-image {
        height: 150px;
        margin-bottom: 0.75rem;
    }
    
    .product-name {
        font-size: 1rem;
        line-height: 1.2;
    }
    
    .product-price {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    /* Category filters compact */
    .category-filters {
        gap: 0.4rem;
        margin-bottom: 1rem;
        padding: 0 0.25rem;
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE and Edge */
        padding-bottom: 0.5rem;
    }
    
    .category-filters::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }
    
    .category-filter {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
        min-height: 40px;
        border-radius: 20px;
        flex: 0 0 auto;
        white-space: nowrap;
    }
    
    .filter-dropdown-container {
        flex: 0 0 auto;
        width: auto;
        margin-top: 0;
    }
    
    .filter-dropdown-content {
        max-height: 60vh;
        max-width: 85vw;
    }
    
    /* Form elements compact */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-input,
    .form-textarea,
    .form-select {
        padding: 0.75rem;
        font-size: 0.9rem;
        min-height: 44px;
        border-radius: 6px;
    }
    
    .form-textarea {
        min-height: 100px;
    }
    
    /* Footer compact */
    .footer {
        padding: 1.5rem 0 0.75rem;
        margin-top: 1.5rem;
    }
    
    .footer-content {
        gap: 1rem;
    }
    
    .footer-section {
        padding: 0 0.5rem;
    }
    
    .footer-section h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .footer-section p,
    .footer-section a {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .footer-bottom {
        margin-top: 1rem;
        padding-top: 1rem;
        font-size: 0.75rem;
    }
    
    /* Loading spinner compact */
    .loading {
        padding: 1.5rem;
    }
    
    .spinner {
        width: 32px;
        height: 32px;
        border-width: 2px;
    }
    
    /* Auth buttons ultra-compact */
    .auth-buttons .btn {
        min-height: 44px;
        font-size: 0.85rem;
    }
    
    /* Utility spacing adjustments */
    .mt-1 { margin-top: 0.4rem; }
    .mt-2 { margin-top: 0.6rem; }
    .mt-3 { margin-top: 0.8rem; }
    .mt-4 { margin-top: 1.2rem; }
    
    .mb-1 { margin-bottom: 0.4rem; }
    .mb-2 { margin-bottom: 0.6rem; }
    .mb-3 { margin-bottom: 0.8rem; }
    .mb-4 { margin-bottom: 1.2rem; }
    
    .p-1 { padding: 0.4rem; }
    .p-2 { padding: 0.6rem; }
    .p-3 { padding: 0.8rem; }
    .p-4 { padding: 1.2rem; }
}

/* Loading States */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #E0E0E0;
    border-top: 4px solid #C8102E;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.hidden { display: none; }
.visible { display: block; }

/* Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #C8102E;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 3000;
}

.skip-link:focus {
    top: 6px;
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .btn,
    .modal {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .product-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

.auth-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Modern Navigation Bar */
.modern-nav {
    border-radius: 20px;
    padding: 0;
    display: flex;
    justify-content: center;
    margin: 0;
    max-width: 900px;
}

.modern-nav ul {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.modern-nav li {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-width: 60px;
}

.modern-nav a {
    color: #bbb;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: color 0.2s;
    font-size: 1.1rem;
}

.modern-nav i {
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
    transition: color 0.2s;
}

.modern-nav a span {
    display: block;
    height: 20px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.3s, transform 0.3s;
    margin-top: 0.3rem;
    text-align: center;
}

.modern-nav li:hover a span,
.modern-nav li.active a span {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.modern-nav li.active a,
.modern-nav a:hover {
    color: #FF6F00;
}

.modern-nav li.active i,
.modern-nav a:hover i {
    color: #FF6F00;
}

.modern-nav li.active a span,
.modern-nav li:hover a span {
    color: #FF6F00;
}

.modern-nav li {
    min-height: 60px;
}

.promo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

@media (max-width: 768px) {
  .modern-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, #771212 0%, #b70202 100%);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 0;
    border-radius: 0;
  }
  
  .modern-nav ul {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-around;
    gap: 0.3rem;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  
  .modern-nav li,
  .modern-nav a {
    min-width: 44px;
    max-width: 65px;
    flex: 0 0 44px;
    box-sizing: border-box;
    padding: 0.25rem 0.1rem;
    min-height: 55px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  
  .modern-nav a {
    color: white;
  }
  
  .modern-nav a:hover,
  .modern-nav a.active {
    color: #FF6F00;
  }
  
  .modern-nav i {
    color: white;
  }
  
  .modern-nav a:hover i,
  .modern-nav a.active i {
    color: #FF6F00;
  }
  
  .modern-nav i {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
  }
  
  .modern-nav span {
    font-size: 0.5rem;
    line-height: 1;
    white-space: normal;
    text-align: center;
    word-break: break-word;
    max-width: 100%;
    display: block;
  }
  

}

@media (max-width: 768px) {
  .header-actions {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 0.18rem;
    width: 100%;
    flex-wrap: nowrap;
  }
  .search-container {
    margin: 0;
    flex: 1 1 60px;
    min-width: 50px;
    max-width: 100px;
    display: flex;
    align-items: center;
  }
  .search-input {
    width: 100%;
    min-width: 50px;
    max-width: 100px;
    padding: 0.12rem 0.4rem;
    font-size: 0.75rem;
    height: 22px;
    border-radius: 12px;
  }
  .cart-button {
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
    padding: 0;
    font-size: 1rem;
    border-radius: 50%;
    margin: 0 0.10rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .cart-button i, .cart-button svg {
    font-size: 1rem;
  }
  .cart-count {
    width: 12px;
    height: 12px;
    font-size: 0.6rem;
    top: -3px;
    right: -3px;
  }
  .user-info {
    display: flex;
    align-items: center;
    gap: 0.10rem;
    min-width: 0;
  }
  .user-info span {
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
    display: inline-block;
  }
  .user-info .btn {
    height: 26px;
    font-size: 0.8rem;
    padding: 0 0.7rem;
    border-radius: 8px;
    margin: 0 0.05rem;
    min-width: 44px;
    max-width: 80px;
    box-sizing: border-box;
  }
}

@media (max-width: 768px) {
  .auth-buttons {
    display: flex;
    flex-direction: row;
    gap: 0.12rem;
    align-items: center;
    justify-content: flex-end;
    width: auto;
    margin: 0;
  }
  .auth-buttons .btn {
    height: 26px;
    font-size: 0.75rem;
    padding: 0 0.6rem;
    min-width: 60px;
    max-width: 90px;
    border-radius: 8px;
    margin: 0.05rem 0;
    box-sizing: border-box;
  }
}

@media (max-width: 768px) {
  .sticky-logo-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.3rem 1rem;
    min-height: 44px;
    background: linear-gradient(135deg, #771212 0%, #b70202 100%);
    box-shadow: 0 2px 10px rgba(200, 16, 46, 0.12);
    width: 100%;
  }
  .sticky-logo-bar .logo-img {
    width: 22px;
    height: 22px;
    display: inline-block;
    vertical-align: middle;
  }
  .sticky-logo-bar .logo-text {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.2px;
    line-height: 1;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
  }
}

/* Mobile Responsive Styles for My Messages Page */
@media (max-width: 768px) {
  /* Message Card Container */
  .message-card {
    padding: 1rem !important;
    margin-bottom: 1rem;
    border-radius: 8px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1) !important;
  }

  /* Message Header - Stack vertically on mobile */
  .message-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
  }

  /* Message From Name - Smaller font size */
  .message-from-name {
    font-size: 1rem !important;
    line-height: 1.3 !important;
    margin-bottom: 0.25rem !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Message Timestamp - Smaller font */
  .message-timestamp {
    font-size: 0.8rem !important;
    margin-bottom: 0.5rem !important;
  }

  /* Message Actions - Responsive button layout */
  .message-actions {
    display: flex !important;
    flex-direction: row !important;
    gap: 0.5rem !important;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  /* Status Badge - Smaller and more compact */
  .message-status-badge {
    padding: 0.2rem 0.6rem !important;
    font-size: 0.75rem !important;
    border-radius: 8px !important;
    white-space: nowrap;
  }

  /* Mark as Read Button - Smaller and more compact */
  .mark-read-btn {
    padding: 0.2rem 0.6rem !important;
    font-size: 0.75rem !important;
    border-radius: 6px !important;
    white-space: nowrap;
    min-width: auto;
  }

  /* Message Content - Proper padding */
  .message-content {
    padding: 0.75rem !important;
    margin-top: 0.5rem;
  }

  /* Message Text - Better line height */
  .message-text {
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
    margin-bottom: 0.75rem !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Conversation Thread - Mobile optimized */
  .conversation-thread {
    margin-top: 0.75rem !important;
    padding-top: 0.75rem !important;
  }

  .conversation-thread h6 {
    font-size: 0.9rem !important;
    margin-bottom: 0.5rem !important;
  }

  .conversation-container {
    max-height: 300px !important;
    padding: 0.25rem !important;
    gap: 0.5rem !important;
  }

  .conversation-item {
    padding: 0.5rem !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .conversation-sender {
    font-size: 0.8rem !important;
  }

  .conversation-timestamp {
    font-size: 0.7rem !important;
  }

  .conversation-text {
    font-size: 0.85rem !important;
    line-height: 1.3 !important;
  }

  /* Reply Form - Mobile optimized */
  .reply-form {
    margin-top: 0.75rem !important;
    padding-top: 0.75rem !important;
  }

  .reply-form h6 {
    font-size: 0.9rem !important;
    margin-bottom: 0.4rem !important;
  }

  .reply-textarea {
    min-height: 60px !important;
    padding: 0.5rem !important;
    font-size: 0.85rem !important;
  }

  .reply-actions {
    flex-direction: row !important;
    gap: 0.4rem !important;
    margin-top: 0.4rem !important;
    flex-wrap: wrap;
  }

  .reply-btn,
  .clear-btn {
    padding: 0.4rem 0.8rem !important;
    font-size: 0.8rem !important;
    border-radius: 6px !important;
    white-space: nowrap;
    min-width: auto;
  }

  /* Waiting Message - Mobile optimized */
  .waiting-message {
    padding: 0.75rem !important;
    margin-top: 0.75rem !important;
    font-size: 0.85rem !important;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .message-card {
    padding: 0.75rem !important;
  }

  .message-from-name {
    font-size: 0.95rem !important;
  }

  .message-timestamp {
    font-size: 0.75rem !important;
  }

  .message-actions {
    gap: 0.4rem !important;
  }

  .message-status-badge {
    padding: 0.15rem 0.5rem !important;
    font-size: 0.7rem !important;
  }

  .mark-read-btn {
    padding: 0.15rem 0.5rem !important;
    font-size: 0.7rem !important;
  }

  .message-content {
    padding: 0.5rem !important;
  }

  .message-text {
    font-size: 0.85rem !important;
  }

  .reply-textarea {
    min-height: 50px !important;
    padding: 0.4rem !important;
    font-size: 0.8rem !important;
  }

  .reply-btn,
  .clear-btn {
    padding: 0.3rem 0.6rem !important;
    font-size: 0.75rem !important;
  }

  .conversation-container {
    max-height: 250px !important;
  }

  .conversation-item {
    padding: 0.4rem !important;
  }

  .conversation-sender {
    font-size: 0.75rem !important;
  }

  .conversation-text {
    font-size: 0.8rem !important;
  }
}

/* Ultra small screens */
@media (max-width: 360px) {
  .message-card {
    padding: 0.6rem !important;
  }

  .message-from-name {
    font-size: 0.9rem !important;
  }

  .message-actions {
    flex-direction: column !important;
    gap: 0.3rem !important;
    width: 100%;
  }

  .message-status-badge,
  .mark-read-btn {
    width: 100%;
    text-align: center;
    padding: 0.3rem !important;
    font-size: 0.7rem !important;
  }

  .reply-actions {
    flex-direction: column !important;
    gap: 0.3rem !important;
  }

  .reply-btn,
  .clear-btn {
    width: 100%;
    padding: 0.4rem !important;
    font-size: 0.75rem !important;
  }

  .conversation-container {
    max-height: 200px !important;
  }
}

/* Mobile Responsive Styles for My Orders Page */
@media (max-width: 768px) {
  /* Status Filter Container */
  .status-filter-container {
    margin-bottom: 1.5rem !important;
    padding: 0 0.5rem;
  }

  /* Status Filter Buttons Container */
  .status-filter-buttons {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
    background: #f8f9fa !important;
    padding: 0.4rem !important;
    border-radius: 8px !important;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  /* Individual Status Filter Buttons */
  .status-filter-btn {
    padding: 0.4rem 0.8rem !important;
    font-size: 0.8rem !important;
    border-radius: 6px !important;
    white-space: nowrap;
    min-width: auto;
    flex: 0 1 auto;
    text-align: center;
    line-height: 1.2;
    font-weight: 500 !important;
  }

  /* Order Card Mobile Optimization */
  .order-card {
    padding: 1rem !important;
    margin-bottom: 1rem;
  }

  /* Order Header - Stack on mobile */
  .order-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
  }

  /* Order Status Badge */
  .order-status-badge {
    padding: 0.2rem 0.6rem !important;
    font-size: 0.75rem !important;
    border-radius: 12px !important;
    align-self: flex-start;
  }

  /* Order Items */
  .order-item {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
    padding: 0.5rem !important;
  }

  .order-item-image {
    min-width: auto !important;
    width: 100%;
    text-align: center;
  }

  .order-item-details {
    width: 100%;
  }

  .order-item-price {
    align-self: flex-end;
    margin-top: 0.25rem;
  }

  /* Order Summary - Stack on mobile */
  .order-summary {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
  }

  /* Order Actions */
  .order-actions {
    flex-direction: column !important;
    gap: 0.4rem !important;
    width: 100%;
  }

  .order-action-btn {
    padding: 0.4rem 0.8rem !important;
    font-size: 0.8rem !important;
    width: 100%;
    text-align: center;
  }

  /* Order Total */
  .order-total {
    font-size: 1.25rem !important;
    text-align: left !important;
    width: 100%;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .status-filter-container {
    margin-bottom: 1rem !important;
    padding: 0 0.25rem;
  }

  .status-filter-buttons {
    gap: 0.3rem !important;
    padding: 0.3rem !important;
  }

  .status-filter-btn {
    padding: 0.3rem 0.6rem !important;
    font-size: 0.75rem !important;
    border-radius: 4px !important;
  }

  .order-card {
    padding: 0.75rem !important;
  }

  .order-header {
    gap: 0.5rem !important;
  }

  .order-status-badge {
    padding: 0.15rem 0.5rem !important;
    font-size: 0.7rem !important;
  }

  .order-item {
    padding: 0.4rem !important;
    gap: 0.4rem !important;
  }

  .order-action-btn {
    padding: 0.3rem 0.6rem !important;
    font-size: 0.75rem !important;
  }

  .order-total {
    font-size: 1.1rem !important;
  }
}

/* Ultra small screens */
@media (max-width: 360px) {
  .status-filter-buttons {
    flex-direction: column !important;
    gap: 0.25rem !important;
    padding: 0.25rem !important;
  }

  .status-filter-btn {
    width: 100%;
    padding: 0.4rem !important;
    font-size: 0.75rem !important;
    border-radius: 4px !important;
  }

  .order-card {
    padding: 0.6rem !important;
  }

  .order-item {
    padding: 0.3rem !important;
  }

  .order-action-btn {
    padding: 0.4rem !important;
    font-size: 0.75rem !important;
  }

  .order-total {
    font-size: 1rem !important;
  }
}

/* Ensure buttons don't overflow on any screen size */
@media (max-width: 600px) {
  .status-filter-buttons {
    justify-content: center;
    flex-wrap: wrap;
  }

  .status-filter-btn {
    flex: 0 1 auto;
    max-width: calc(50% - 0.2rem);
  }
}

@media (max-width: 400px) {
  .status-filter-btn {
    max-width: calc(100% - 0.2rem);
  }
}

/* Mobile Responsive Styles for Filter Category Section */
@media (max-width: 768px) {
  /* Filter Section Container */
  .filter-section-container {
    margin: 2rem 0 1.5rem 0;
    padding: 1.5rem 0.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  }

  /* Filter Section Title - Centered */
  .filter-section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1.5rem;
    text-align: center !important;
    display: block;
    width: 100%;
  }

  /* Filter Dropdown Container - Centered under title */
  .filter-dropdown-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100%;
    margin-bottom: 1rem;
    text-align: center;
    position: relative !important;
  }

  /* Filter Dropdown Button - Enhanced Styling and Centered */
  .filter-dropdown-btn {
    padding: 0.6rem 1.2rem !important;
    font-size: 0.9rem !important;
    border-radius: 8px !important;
    background: white !important;
    border: 2px solid #C8102E !important;
    color: #C8102E !important;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center !important;
    min-width: 200px;
    max-width: 280px;
    justify-content: center !important;
    align-items: center !important;
    box-shadow: 0 2px 8px rgba(200, 16, 46, 0.15) !important;
    font-weight: 500 !important;
    display: flex !important;
    gap: 0.5rem;
  }

  .filter-dropdown-btn:hover,
  .filter-dropdown-btn.active {
    border-color: #C8102E !important;
    background: #C8102E !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(200, 16, 46, 0.25) !important;
  }

  /* Category Filters - Waterfall Layout (Vertical Stack) */
  .category-filters {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    justify-content: center !important;
    align-items: center !important;
    margin-bottom: 1rem !important;
    padding: 0.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 300px;
    text-align: center;
  }

  /* Category Filter Buttons - Full Width in Waterfall */
  .category-filter {
    padding: 0.5rem 1rem !important;
    font-size: 0.85rem !important;
    border-radius: 8px !important;
    white-space: nowrap;
    width: 100% !important;
    text-align: center !important;
    line-height: 1.2;
    justify-content: center;
    align-items: center;
    display: flex;
    gap: 0.5rem;
  }

  /* Filter Dropdown Content - Centered and Scrollable */
  .filter-dropdown-content {
    position: fixed !important;
    top: auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 90% !important;
    max-width: 280px !important;
    min-width: 200px !important;
    z-index: 9999 !important;
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15), 0 4px 16px rgba(0,0,0,0.1) !important;
    margin-top: 0.5rem !important;
    padding: 0.75rem 0 !important;
    max-height: 350px !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
  }

  /* Dropdown Items - Centered Text and Full Width */
  .dropdown-item {
    padding: 0.6rem 1rem !important;
    font-size: 0.85rem !important;
    text-align: center !important;
    width: 100% !important;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem;
  }

  .dropdown-item:hover,
  .dropdown-item.active {
    background: #f8f8f8 !important;
    color: #C8102E !important;
  }

  /* Dropdown Divider */
  .dropdown-divider {
    height: 1px !important;
    background-color: #E0E0E0 !important;
    margin: 0.4rem 0 !important;
    width: 100% !important;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .filter-section-container {
    margin: 1.5rem 0 1rem 0;
    padding: 0.75rem 0.25rem;
  }

  .filter-section-title {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    text-align: center !important;
  }

  .filter-dropdown-container {
    margin-bottom: 0.75rem;
  }

  .filter-dropdown-btn {
    padding: 0.5rem 1rem !important;
    font-size: 0.8rem !important;
    min-width: 180px;
    max-width: 250px;
  }

  .category-filters {
    gap: 0.4rem !important;
    padding: 0.4rem;
    margin-bottom: 0.75rem !important;
    max-width: 280px;
  }

  .category-filter {
    padding: 0.4rem 0.8rem !important;
    font-size: 0.8rem !important;
    border-radius: 6px !important;
  }

  .filter-dropdown-content {
    width: 95% !important;
    max-width: 250px !important;
    min-width: 180px !important;
    position: fixed !important;
    z-index: 9999 !important;
    border-radius: 10px !important;
    box-shadow: 0 6px 24px rgba(0,0,0,0.15), 0 3px 12px rgba(0,0,0,0.1) !important;
  }

  .dropdown-item {
    padding: 0.5rem 0.8rem !important;
    font-size: 0.8rem !important;
  }
}

/* Ultra small screens */
@media (max-width: 360px) {
  .filter-section-container {
    margin: 1rem 0 0.75rem 0;
    padding: 0.5rem 0.15rem;
  }

  .filter-section-title {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    text-align: center !important;
  }

  .filter-dropdown-container {
    margin-bottom: 0.5rem;
  }

  .filter-dropdown-btn {
    padding: 0.4rem 0.8rem !important;
    font-size: 0.75rem !important;
    min-width: 160px;
    max-width: 220px;
  }

  .category-filters {
    gap: 0.3rem !important;
    padding: 0.3rem;
    margin-bottom: 0.5rem !important;
    max-width: 260px;
  }

  .category-filter {
    padding: 0.35rem 0.7rem !important;
    font-size: 0.75rem !important;
    border-radius: 6px !important;
  }

  .filter-dropdown-content {
    width: 98% !important;
    max-width: 220px !important;
    min-width: 160px !important;
    position: fixed !important;
    z-index: 9999 !important;
  }

  .dropdown-item {
    padding: 0.4rem 0.6rem !important;
    font-size: 0.75rem !important;
  }
}

/* Ensure filter section is always visible and properly spaced */
@media (max-width: 768px) {
  /* Prevent filter section from being hidden */
  .filter-section-container {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 10;
  }

  /* Ensure proper spacing from other elements */
  .filter-section-container + .products-grid {
    margin-top: 1rem;
  }

  /* Improve touch targets */
  .category-filter,
  .filter-dropdown-btn {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Desktop styles for filter section centering and waterfall layout */
@media (min-width: 769px) {
  .filter-section-container {
    text-align: center;
    margin: 2rem 0 1.5rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  }

  .filter-section-title {
    text-align: center !important;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: #333;
  }

  .filter-dropdown-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin-bottom: 1rem;
    width: 100%;
  }

  .filter-dropdown-btn {
    padding: 0.6rem 1.2rem !important;
    font-size: 0.9rem !important;
    border-radius: 8px !important;
    background: white !important;
    border: 2px solid #C8102E !important;
    color: #C8102E !important;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center !important;
    min-width: 200px;
    justify-content: center !important;
    align-items: center !important;
    box-shadow: 0 2px 8px rgba(200, 16, 46, 0.15) !important;
    font-weight: 500 !important;
    display: flex !important;
    gap: 0.5rem;
  }

  .filter-dropdown-btn:hover,
  .filter-dropdown-btn.active {
    border-color: #C8102E !important;
    background: #C8102E !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(200, 16, 46, 0.25) !important;
  }

  /* Category Filters - Waterfall Layout for Desktop */
  .category-filters {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center;
    max-width: 350px;
    width: 100%;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }

  .category-filter {
    padding: 0.5rem 1rem !important;
    font-size: 0.9rem !important;
    border-radius: 8px !important;
    width: 100% !important;
    text-align: center !important;
    justify-content: center;
    align-items: center;
    display: flex;
    gap: 0.5rem;
  }
}

/* Admin Panel Mobile Styles */
@media (max-width: 768px) {
  /* Message Management Mobile Styles */
  .admin-message-container {
    padding: 1rem !important;
  }

  .admin-message-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
    margin-bottom: 1rem !important;
  }

  .admin-message-title {
    font-size: 1.5rem !important;
    margin: 0 !important;
  }

  .admin-message-filter {
    width: 100% !important;
    max-width: 200px !important;
    font-size: 0.8rem !important;
    padding: 0.5rem !important;
  }

  /* Message Card Mobile Styles */
  .admin-message-card {
    padding: 1rem !important;
    margin-bottom: 1rem !important;
  }

  .admin-message-header-content {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
    margin-bottom: 0.75rem !important;
  }

  .admin-message-customer-info {
    width: 100% !important;
  }

  .admin-message-customer-name {
    font-size: 1rem !important;
    margin-bottom: 0.25rem !important;
    word-break: break-word !important;
    line-height: 1.2 !important;
  }

  .admin-message-customer-email {
    font-size: 0.8rem !important;
    word-break: break-all !important;
    line-height: 1.2 !important;
  }

  .admin-message-timestamp {
    font-size: 0.75rem !important;
    margin-top: 0.25rem !important;
    line-height: 1.2 !important;
  }

  .admin-message-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    width: 100% !important;
    align-items: stretch !important;
  }

  .admin-message-status-badge {
    font-size: 0.7rem !important;
    padding: 0.25rem 0.5rem !important;
    text-align: center !important;
    width: 100% !important;
  }

  .admin-mark-read-btn {
    font-size: 0.7rem !important;
    padding: 0.25rem 0.5rem !important;
    width: 100% !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Message Content Mobile Styles */
  .admin-message-content {
    padding: 0.75rem !important;
  }

  .admin-message-text {
    font-size: 0.85rem !important;
    line-height: 1.4 !important;
    word-break: break-word !important;
  }

  /* Conversation Thread Mobile Styles */
  .admin-conversation-thread {
    margin-top: 0.75rem !important;
    padding-top: 0.75rem !important;
  }

  .admin-conversation-thread h6 {
    font-size: 0.8rem !important;
    margin-bottom: 0.5rem !important;
  }

  .admin-conversation-container {
    max-height: 300px !important;
    padding: 0.25rem !important;
  }

  .admin-conversation-item {
    padding: 0.5rem !important;
    margin-bottom: 0.5rem !important;
  }

  .admin-conversation-sender {
    font-size: 0.75rem !important;
    margin-bottom: 0.25rem !important;
    word-break: break-word !important;
    line-height: 1.2 !important;
  }

  .admin-conversation-timestamp {
    font-size: 0.65rem !important;
    line-height: 1.2 !important;
  }

  .admin-conversation-text {
    font-size: 0.8rem !important;
    line-height: 1.3 !important;
    word-break: break-word !important;
  }

  /* Reply Form Mobile Styles */
  .admin-reply-form {
    margin-top: 0.75rem !important;
    padding-top: 0.75rem !important;
  }

  .admin-reply-form h6 {
    font-size: 0.8rem !important;
    margin-bottom: 0.5rem !important;
  }

  .admin-reply-textarea {
    min-height: 60px !important;
    font-size: 0.8rem !important;
    padding: 0.5rem !important;
  }

  .admin-reply-actions {
    flex-direction: column !important;
    gap: 0.5rem !important;
    margin-top: 0.5rem !important;
  }

  .admin-reply-btn,
  .admin-clear-btn {
    font-size: 0.75rem !important;
    padding: 0.5rem !important;
    width: 100% !important;
    text-align: center !important;
  }
}

@media (max-width: 480px) {
  /* Smaller Mobile Styles */
  .admin-message-container {
    padding: 0.75rem !important;
  }

  .admin-message-title {
    font-size: 1.3rem !important;
  }

  .admin-message-card {
    padding: 0.75rem !important;
  }

  .admin-message-customer-name {
    font-size: 0.9rem !important;
  }

  .admin-message-customer-email {
    font-size: 0.75rem !important;
  }

  .admin-message-timestamp {
    font-size: 0.7rem !important;
  }

  .admin-message-status-badge {
    font-size: 0.65rem !important;
    padding: 0.2rem 0.4rem !important;
  }

  .admin-mark-read-btn {
    font-size: 0.65rem !important;
    padding: 0.2rem 0.4rem !important;
  }

  .admin-message-text {
    font-size: 0.8rem !important;
  }

  .admin-conversation-sender {
    font-size: 0.7rem !important;
  }

  .admin-conversation-timestamp {
    font-size: 0.6rem !important;
  }

  .admin-conversation-text {
    font-size: 0.75rem !important;
  }

  .admin-reply-textarea {
    min-height: 50px !important;
    font-size: 0.75rem !important;
  }

  .admin-reply-btn,
  .admin-clear-btn {
    font-size: 0.7rem !important;
    padding: 0.4rem !important;
  }
}

@media (max-width: 360px) {
  /* Extra Small Mobile Styles */
  .admin-message-container {
    padding: 0.5rem !important;
  }

  .admin-message-title {
    font-size: 1.2rem !important;
  }

  .admin-message-card {
    padding: 0.5rem !important;
  }

  .admin-message-customer-name {
    font-size: 0.85rem !important;
  }

  .admin-message-customer-email {
    font-size: 0.7rem !important;
  }

  .admin-message-timestamp {
    font-size: 0.65rem !important;
  }

  .admin-message-status-badge {
    font-size: 0.6rem !important;
    padding: 0.15rem 0.3rem !important;
  }

  .admin-mark-read-btn {
    font-size: 0.6rem !important;
    padding: 0.15rem 0.3rem !important;
  }

  .admin-message-text {
    font-size: 0.75rem !important;
  }

  .admin-conversation-sender {
    font-size: 0.65rem !important;
  }

  .admin-conversation-timestamp {
    font-size: 0.55rem !important;
  }

  .admin-conversation-text {
    font-size: 0.7rem !important;
  }

  .admin-reply-textarea {
    min-height: 45px !important;
    font-size: 0.7rem !important;
  }

  .admin-reply-btn,
  .admin-clear-btn {
    font-size: 0.65rem !important;
    padding: 0.35rem !important;
  }
}

/* Admin Panel Orders Mobile Styles */
@media (max-width: 768px) {
  /* Orders Container Mobile Styles */
  .admin-orders-container {
    padding: 0.5rem !important;
  }

  .admin-orders-content {
    padding: 1rem !important;
    margin-bottom: 1rem !important;
  }

  /* Orders Header Mobile Styles */
  .admin-orders-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
    margin-bottom: 1rem !important;
    position: relative !important;
    z-index: 1 !important;
  }

  .admin-orders-title {
    font-size: 1.5rem !important;
    margin: 0 !important;
    width: 100% !important;
  }

  .admin-orders-filters {
    width: 100% !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    align-items: stretch !important;
    margin-top: 0.5rem !important;
  }

  .admin-orders-search {
    width: 100% !important;
    min-width: auto !important;
    font-size: 0.9rem !important;
    padding: 0.75rem !important;
  }

  .admin-orders-filter {
    width: 100% !important;
    font-size: 0.9rem !important;
    padding: 0.75rem !important;
  }

  /* Order Card Mobile Styles */
  .admin-order-card {
    padding: 1rem !important;
    margin-bottom: 1rem !important;
    position: relative !important;
    z-index: 1 !important;
  }

  .admin-order-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
    margin-bottom: 1rem !important;
  }

  .admin-order-main-content {
    width: 100% !important;
  }

  .admin-order-id {
    font-size: 1.1rem !important;
    margin-bottom: 0.75rem !important;
  }

  .admin-order-details-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
    margin-bottom: 1rem !important;
  }

  .admin-order-customer-details,
  .admin-order-delivery-details,
  .admin-order-info-details {
    padding: 0.75rem !important;
    margin-bottom: 0 !important;
  }

  /* Order Status and Actions Mobile Styles */
  .admin-order-status-actions {
    width: 100% !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    align-items: stretch !important;
  }

  .admin-order-status-badge {
    font-size: 0.8rem !important;
    padding: 0.5rem !important;
    text-align: center !important;
    width: 100% !important;
  }

  .admin-order-status-select {
    width: 100% !important;
    font-size: 0.8rem !important;
    padding: 0.5rem !important;
  }

  /* Order Items Mobile Styles */
  .admin-order-items {
    padding: 0.75rem !important;
  }

  .admin-order-items h5 {
    font-size: 1rem !important;
    margin-bottom: 0.75rem !important;
  }

  .admin-order-item {
    padding: 0.5rem 0 !important;
    font-size: 0.85rem !important;
  }

  .admin-order-note {
    margin-top: 0.75rem !important;
    padding: 0.5rem !important;
    font-size: 0.8rem !important;
  }
}

@media (max-width: 480px) {
  /* Smaller Mobile Styles */
  .admin-orders-container {
    padding: 0.25rem !important;
  }

  .admin-orders-content {
    padding: 0.75rem !important;
  }

  .admin-orders-title {
    font-size: 1.3rem !important;
  }

  .admin-orders-search,
  .admin-orders-filter {
    font-size: 0.85rem !important;
    padding: 0.6rem !important;
  }

  .admin-order-card {
    padding: 0.75rem !important;
  }

  .admin-order-id {
    font-size: 1rem !important;
  }

  .admin-order-customer-details,
  .admin-order-delivery-details,
  .admin-order-info-details {
    padding: 0.6rem !important;
  }

  .admin-order-status-badge {
    font-size: 0.75rem !important;
    padding: 0.4rem !important;
  }

  .admin-order-status-select {
    font-size: 0.75rem !important;
    padding: 0.4rem !important;
  }

  .admin-order-items {
    padding: 0.6rem !important;
  }

  .admin-order-item {
    font-size: 0.8rem !important;
  }

  .admin-order-note {
    font-size: 0.75rem !important;
  }
}

@media (max-width: 360px) {
  /* Extra Small Mobile Styles */
  .admin-orders-container {
    padding: 0.2rem !important;
  }

  .admin-orders-content {
    padding: 0.5rem !important;
  }

  .admin-orders-title {
    font-size: 1.2rem !important;
  }

  .admin-orders-search,
  .admin-orders-filter {
    font-size: 0.8rem !important;
    padding: 0.5rem !important;
  }

  .admin-order-card {
    padding: 0.5rem !important;
  }

  .admin-order-id {
    font-size: 0.95rem !important;
  }

  .admin-order-customer-details,
  .admin-order-delivery-details,
  .admin-order-info-details {
    padding: 0.5rem !important;
  }

  .admin-order-status-badge {
    font-size: 0.7rem !important;
    padding: 0.35rem !important;
  }

  .admin-order-status-select {
    font-size: 0.7rem !important;
    padding: 0.35rem !important;
  }

  .admin-order-items {
    padding: 0.5rem !important;
  }

  .admin-order-item {
    font-size: 0.75rem !important;
  }

  .admin-order-note {
    font-size: 0.7rem !important;
  }
}