/* Modern CSS Reset and Base Styles */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-gradient: linear-gradient(135deg, #fdbb2d 0%, #22c1c3 100%);
    --danger-gradient: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    --info-gradient: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    --dark-gradient: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    --light-bg: #f8f9fb;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --card-shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.15);
    --border-radius: 16px;
    --border-radius-sm: 12px;
    --transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-ease: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    --transition-fast: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    --transition-bounce: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --btn-height: 44px;
    --btn-small-height: 36px;
    --btn-radius: 12px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #1a202c;
    background: var(--light-bg);
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url('../images/servenow_brand_logo.png?v=2') center/420px no-repeat;
    opacity: 0.06;
    pointer-events: none;
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #2d3748;
}

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

/* Modern Header and Navigation */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo h1 {
    background: linear-gradient(45deg, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

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

nav ul li a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--transition-ease);
    position: relative;
}

nav ul li a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #ffffff;
    transition: var(--transition-ease);
    transform: translateX(-50%);
}

nav ul li a:hover::after {
    width: 100%;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.3s ease;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.cart-count {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    color: white;
    border-radius: 50%;
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 0.5rem;
    min-width: 20px;
    text-align: center;
}

/* Main content */
main:not(.app-content) {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Modern Hero Section */
.hero {
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5rem 2rem;
    border-radius: 20px;
    margin-bottom: 4rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

.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 1000 1000"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="25" r="0.5" fill="rgba(255,255,255,0.1)"/><circle cx="25" cy="75" r="0.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="1000" height="1000" fill="url(%23grain)"/></svg>');
    opacity: 0.1;
}

.hero h2 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

#getLocation {
    background: linear-gradient(45deg, #ffffff, #f8f9fa);
    color: #667eea;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 1.2rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition-ease);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

#getLocation:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    background: linear-gradient(45deg, #f8f9fa, #ffffff);
}

#getLocation:active {
    transform: translateY(0);
}

/* Modern Categories */
.categories {
    margin-bottom: 4rem;
}

.categories h3 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.category-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: var(--transition-bounce);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.category-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.category-card:hover::before {
    opacity: 1;
}

.category-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-card:hover img {
    transform: scale(1.05);
}

.category-card-content {
    padding: 2rem 1.5rem;
    position: relative;
    z-index: 2;
}

.category-card h4 {
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1rem;
    color: #2d3748;
}

.category-card a {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    transition: var(--transition-ease);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    text-align: center;
    width: 100%;
}

.category-card a:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    background: linear-gradient(45deg, #764ba2 0%, #667eea 100%);
}

/* Product image wrapper: smooth background matching + sensible fallback */
.product-image {
    position: relative;
    background-color: #eef2f7; /* neutral light fallback */
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    display: block;
    transition: background-color 450ms ease, opacity 300ms ease;
}
.product-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-position: center center;
    transition: transform 0.25s ease, opacity 0.25s ease;
    background: transparent;
}

/* Overlay to improve text contrast over images; uses CSS vars set by JS */
.product-image::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
    /* Colorized overlay blended with the image color (vars set by JS). */
    background: linear-gradient(
        to bottom,
        rgba(var(--product-bg-r,238), var(--product-bg-g,242), var(--product-bg-b,247), calc(var(--product-overlay-alpha, 0.25))) 0%,
        rgba(var(--product-bg-r,238), var(--product-bg-g,242), var(--product-bg-b,247), calc(var(--product-overlay-alpha, 0.25) + 0.12)) 100%
    );
    mix-blend-mode: multiply;
    transition: opacity 300ms ease, background 300ms ease;
}

/* Ensure overlayed text inside the image sits above the overlay when needed */
.product-image .overlay-content {
    position: absolute;
    z-index: 2;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.75rem 1rem;
    color: var(--product-contrast, #fff);
}


/* Featured stores */
.featured-stores {
    margin-bottom: 3rem;
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.store-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: var(--border-radius);
    padding: 0; /* Remove padding to allow badge and image to be full width */
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.store-status-badge {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.status-open {
    background-color: #ecfdf5;
    color: #059669;
}

.status-closed {
    background-color: #fef2f2;
    color: #dc2626;
}

.store-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.store-card-content {
    padding: 1.5rem;
}

.store-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

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

.store-card:hover::before {
    opacity: 1;
}

.store-card * {
    position: relative;
    z-index: 2;
}

.store-card h4 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.store-card p {
    margin-bottom: 1rem;
    color: #666;
    font-size: 0.85rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

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

/* Modern Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--btn-height);
    padding: 0.625rem 1.125rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--btn-radius);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition);
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: var(--info-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(168, 237, 234, 0.4);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(168, 237, 234, 0.6);
}

.btn-success {
    background: var(--success-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.6);
}

.btn-warning {
    background: var(--warning-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(253, 187, 45, 0.4);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(253, 187, 45, 0.6);
}

.btn-danger {
    background: var(--danger-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 154, 158, 0.4);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 154, 158, 0.6);
}

.btn-small {
    min-height: var(--btn-small-height);
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 8px;
}

.btn-small.btn-primary {
    background: var(--primary-gradient);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-small.btn-secondary {
    background: var(--info-gradient);
    box-shadow: 0 2px 8px rgba(168, 237, 234, 0.3);
}

.btn-small:hover {
    transform: translateY(-1px);
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}

.btn:active {
    transform: translateY(0);
}

/* Cart */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.cart-item-info {
    flex-grow: 1;
}

.cart-item-price {
    font-weight: bold;
    margin-right: 1rem;
}

.cart-item-remove {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
}

.cart-total {
    text-align: right;
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

.cart-total::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    z-index: 1;
}

.cart-total * {
    position: relative;
    z-index: 2;
}

/* Product grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.product-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    /* Fill the container by stretching the image (may distort) to avoid overflow */
    object-fit: fill;
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

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

.product-card:hover::before {
    opacity: 1;
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

/* Image-fit mode overrides - toggle by adding class to <body> */
body.image-fit-cover .product-image img { object-fit: cover !important; }
body.image-fit-fill .product-image img { object-fit: fill !important; }

/* Orientation-aware fit classes applied per-image by JS */
.product-image img.fit-contain { object-fit: contain !important; }
.product-image img.fit-cover { object-fit: cover !important; }
.product-image img { object-position: center center; }

.product-card-content {
    padding: 1.5rem;
    position: relative;
    z-index: 2;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Variant selector styles - prevent overflow */
.variant-selector {
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.variant-selector-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.variant-options {
    overflow: hidden;
    flex-wrap: wrap;
}

.variant-option {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.variant-option span {
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    max-width: 100%;
}

.variant-price {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.variant-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-card h4 {
    margin-bottom: 0.5rem;
    color: #2d3748;
}

.product-card p {
    margin-bottom: 1rem;
    color: #4a5568;
    font-size: 0.9rem;
}

.product-card .price {
    font-weight: bold;
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.add-to-cart {
    background: var(--success-gradient);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    width: 100%;
    transition: var(--transition);
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.add-to-cart::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition);
}

.add-to-cart:hover::before {
    left: 100%;
}

.add-to-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.5);
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: 3rem;
}

/* Checkout styles */
.checkout-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

.checkout-form {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

.checkout-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    z-index: 1;
}

.checkout-form * {
    position: relative;
    z-index: 2;
}

.order-summary {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(255, 255, 255, 0.8);
    height: fit-content;
    position: relative;
    overflow: hidden;
}

.order-summary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    z-index: 1;
}

.order-summary * {
    position: relative;
    z-index: 2;
}

.checkout-item,
.order-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.checkout-total,
.order-total {
    font-weight: bold;
    font-size: 1.2rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #eee;
}

.delivery-fee {
    color: #666;
    margin-top: 0.5rem;
}

/* Confirmation styles */
.confirmation-section {
    text-align: center;
    padding: 3rem 0;
}

.confirmation-container {
    max-width: 600px;
    margin: 0 auto;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 3rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

.confirmation-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    z-index: 1;
}

.confirmation-container * {
    position: relative;
    z-index: 2;
}

.confirmation-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.order-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 1rem;
}

.order-details,
.delivery-info {
    text-align: left;
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f9f9f9 0%, #f0f4f8 100%);
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    max-height: 400px;
    overflow-y: auto;
}

.order-details::before,
.delivery-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%);
    z-index: 1;
}

.order-details *,
.delivery-info * {
    position: relative;
    z-index: 2;
}

.confirmation-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Store page styles */
.store-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(255, 255, 255, 0.8);
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.store-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    z-index: 1;
}

.store-header * {
    position: relative;
    z-index: 2;
}

.store-details {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.store-details p {
    margin: 0;
}

/* Modern Login/Register Forms */
.login-form,
.register-form {
    max-width: 450px;
    margin: 4rem auto;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 3rem 2.5rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

.login-form::before,
.register-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
}

.login-form h2,
.register-form h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    position: relative;
}

.login-form form,
.register-form form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    background: #ffffff;
    transition: var(--transition-ease);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.form-group input::placeholder {
    color: #a0aec0;
}

.login-form .btn-primary,
.register-form .btn-primary {
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-ease);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1rem;
}

.login-form .btn-primary:hover,
.register-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    background: linear-gradient(45deg, #764ba2 0%, #667eea 100%);
}

.login-form .btn-primary:active,
.register-form .btn-primary:active {
    transform: translateY(0);
}

.login-form p,
.register-form p {
    text-align: center;
    margin-top: 2rem;
    color: #718096;
    font-size: 0.9rem;
}

.login-form a,
.register-form a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.login-form a:hover,
.register-form a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Form validation styles */
.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.error-message {
    color: #e53e3e;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    display: block;
}

/* Modern Animations and Effects */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.category-card,
.store-card,
.product-card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.category-card:nth-child(1) { animation-delay: 0.1s; }
.category-card:nth-child(2) { animation-delay: 0.2s; }
.category-card:nth-child(3) { animation-delay: 0.3s; }
.category-card:nth-child(4) { animation-delay: 0.4s; }

.store-card:nth-child(1) { animation-delay: 0.1s; }
.store-card:nth-child(2) { animation-delay: 0.2s; }
.store-card:nth-child(3) { animation-delay: 0.3s; }

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #667eea;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success/Error Messages */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Enhanced Buttons */
.btn-secondary {
    background: linear-gradient(45deg, #a0aec0 0%, #718096 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-ease);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    background: linear-gradient(45deg, #718096 0%, #a0aec0 100%);
}

/* Modern Footer */
footer {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: white;
    text-align: center;
    padding: 3rem 2rem 2rem;
    margin-top: 4rem;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
}

footer p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-ease);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    z-index: 1000;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.scroll-to-top::after {
    content: "\2191";
    font-size: 1.2rem;
    font-weight: bold;
}

/* Orders Management */
.orders-section {
    margin-top: 2rem;
}

.orders-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab {
    padding: 0.75rem 1.5rem;
    border: none;
    background: #f7fafc;
    color: #4a5568;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-ease);
}

.tab.active {
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.order-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.order-header h3 {
    margin: 0;
    color: #2d3748;
}

.order-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending {
    background: #fef5e7;
    color: #f59e0b;
}

.status-confirmed {
    background: #dbeafe;
    color: #3b82f6;
}

.status-preparing {
    background: #fef3c7;
    color: #f59e0b;
}

.status-ready {
    background: #d1fae5;
    color: #10b981;
}

.status-out_for_delivery {
    background: #fed7d7;
    color: #ef4444;
}

.status-delivered {
    background: #c6f6d5;
    color: #38a169;
}

.status-cancelled {
    background: #fed7d7;
    color: #e53e3e;
}

/* Wallet Balance Info in Checkout */
.wallet-balance-info {
    margin-top: 10px;
    padding: 10px;
    border-radius: 5px;
    font-size: 14px;
}

.balance-container {
    padding: 10px;
    border-radius: 4px;
}

.balance-container.sufficient {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.balance-container.insufficient {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.error-text {
    color: #dc3545;
    font-weight: bold;
}

.error-text a {
    color: #0056b3;
    text-decoration: underline;
}

.header-balance {
    font-weight: bold;
    color: #ffd700; /* Gold color for balance */
}

.order-details p {
    margin: 0.5rem 0;
    color: #4a5568;
}

.order-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background: #c53030;
}

.btn-success {
    background: #38a169;
    color: white;
}

.btn-success:hover {
    background: #2f855a;
}

.btn-info {
    background: #3182ce;
    color: white;
}

.btn-info:hover {
    background: #2c5282;
}

/* ===== COMPREHENSIVE RESPONSIVE DESIGN ===== */

/* Large Desktop (1200px and above) - Already optimized */

/* Medium Desktop (1024px - 1199px) */
@media (max-width: 1199px) {
    nav {
        padding: 1rem 1.5rem;
    }

    .hero {
        padding: 4rem 2rem;
        margin-bottom: 3rem;
    }

    .hero h2 {
        font-size: 3rem;
    }

    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }

    .store-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .checkout-container {
        gap: 2rem;
    }
}

/* Small Desktop / Large Tablet (768px - 1023px) */
@media (max-width: 1023px) {
    /* Navigation */
    nav {
        padding: 1rem;
    }

    nav ul {
        gap: 1.5rem;
    }

    nav ul li a {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    /* Main content */
    main {
        padding: 1.5rem 1rem;
    }

    /* Hero section */
    .hero {
        padding: 3rem 1.5rem;
        margin-bottom: 3rem;
        border-radius: 16px;
    }

    .hero h2 {
        font-size: 2.5rem;
        margin-bottom: 1.5rem;
    }

    .hero p {
        font-size: 1.2rem;
        margin-bottom: 2rem;
    }

    #getLocation {
        padding: 1rem 2rem;
        font-size: 1rem;
    }

    /* Categories */
    .categories h3 {
        font-size: 2.2rem;
        margin-bottom: 2.5rem;
    }

    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1.5rem;
    }

    .category-card-content {
        padding: 1.5rem 1rem;
    }

    .category-card h4 {
        font-size: 1.1rem;
    }

    /* Store grid */
    .store-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }

    /* Product grid */
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1.5rem;
    }

    /* Forms */
    .login-form,
    .register-form {
        max-width: 500px;
        padding: 2.5rem 2rem;
    }

    .login-form h2,
    .register-form h2 {
        font-size: 1.8rem;
    }

    /* Checkout */
    .checkout-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Tables */
    .table-container {
        overflow-x: auto;
    }

    table {
        min-width: 600px;
    }

    /* Order cards */
    .order-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .order-actions button {
        width: 100%;
    }

    /* Footer */
    footer {
        padding: 2.5rem 1.5rem 1.5rem;
    }
}

/* Tablet (640px - 767px) */
@media (max-width: 767px) {
    /* Navigation - Mobile style */
    nav {
        position: relative;
        padding: 1rem;
    }

    .menu-toggle {
        display: flex;
        order: 2;
    }

    nav ul {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition-ease);
        z-index: 999;
    }

    nav ul.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    nav ul li {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    nav ul li:last-child {
        border-bottom: none;
    }

    nav ul li a {
        display: block;
        padding: 1rem;
        width: 100%;
        border-radius: 0;
    }

    /* Hero section */
    .hero {
        padding: 2.5rem 1.5rem;
        margin-bottom: 2.5rem;
        border-radius: 12px;
    }

    .hero h2 {
        font-size: 2.2rem;
        margin-bottom: 1.2rem;
    }

    .hero p {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }

    #getLocation {
        padding: 0.9rem 1.8rem;
        font-size: 0.95rem;
    }

    /* Categories */
    .categories h3 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.2rem;
    }

    .category-card-content {
        padding: 1.2rem 1rem;
    }

    .category-card h4 {
        font-size: 1rem;
    }

    /* Store and Product grids */
    .store-grid,
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.2rem;
    }

    /* Forms */
    .login-form,
    .register-form {
        max-width: 90%;
        margin: 2rem auto;
        padding: 2rem 1.5rem;
        border-radius: 12px;
    }

    .login-form h2,
    .register-form h2 {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
    }

    /* Buttons */
    .btn-primary,
    .btn-secondary {
        padding: 0.9rem 1.5rem;
        font-size: 0.95rem;
    }

    /* Cart */
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .cart-item-price {
        margin-right: 0;
        align-self: flex-end;
    }

    /* Checkout */
    .checkout-container {
        gap: 1.5rem;
    }

    .checkout-form,
    .order-summary {
        padding: 1.5rem;
    }

    /* Confirmation */
    .confirmation-container {
        padding: 2rem 1.5rem;
    }

    .confirmation-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .confirmation-actions a,
    .confirmation-actions button {
        width: 100%;
        text-align: center;
    }

    /* Store details */
    .store-details {
        flex-direction: column;
        gap: 1rem;
    }

    /* Order management */
    .orders-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }

    .tab {
        text-align: center;
    }

    .order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* Scroll to top */
    .scroll-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }

    /* Footer */
    footer {
        padding: 2rem 1rem 1rem;
        text-align: center;
    }
}

/* Mobile (480px - 639px) */
@media (max-width: 639px) {
    /* Typography */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }

    /* Navigation */
    .logo h1 {
        font-size: 1.3rem;
    }

    /* Main content */
    main {
        padding: 1rem 0.75rem;
    }

    /* Hero */
    .hero {
        padding: 2rem 1.2rem;
        margin-bottom: 2rem;
        border-radius: 10px;
    }

    .hero h2 {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }

    .hero p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    #getLocation {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }

    /* Categories */
    .categories h3 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }

    .category-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .category-card-content {
        padding: 1rem;
    }

    .category-card h4 {
        font-size: 0.95rem;
    }

    /* Grids */
    .store-grid,
    .product-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .store-card,
    .product-card {
        margin: 0 auto;
        max-width: 300px;
    }

    /* Forms */
    .login-form,
    .register-form {
        max-width: 95%;
        padding: 1.5rem 1.2rem;
        margin: 1.5rem auto;
    }

    .login-form h2,
    .register-form h2 {
        font-size: 1.4rem;
        margin-bottom: 1.2rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.8rem 0.9rem;
        font-size: 0.9rem;
    }

    /* Buttons */
    .btn,
    .btn-primary,
    .btn-secondary {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
    }

    /* Cart items */
    .cart-item {
        padding: 0.8rem;
    }

    /* Checkout */
    .checkout-form,
    .order-summary {
        padding: 1.2rem;
    }

    /* Tables */
    table th,
    table td {
        padding: 0.8rem 0.5rem;
        font-size: 0.85rem;
    }

    /* Order cards */
    .order-card {
        padding: 1.2rem;
    }

    .order-header h3 {
        font-size: 1rem;
    }

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

    .stat-card {
        padding: 1rem;
        text-align: center;
    }

    .stat-card h3 {
        font-size: 1.5rem;
    }

    /* Modals */
    .modal-content {
        margin: 1rem;
        padding: 1.5rem;
        width: auto;
    }

    /* Confirmation */
    .confirmation-container {
        padding: 1.5rem 1.2rem;
    }

    .confirmation-icon {
        font-size: 3rem;
    }

    .order-number {
        font-size: 1.2rem;
    }
}

/* Small Mobile (320px - 479px) */
@media (max-width: 479px) {
    /* Base adjustments */
    body {
        font-size: 14px;
    }

    /* Navigation */
    nav {
        padding: 0.75rem;
    }

    .logo h1 {
        font-size: 1.2rem;
    }

    nav ul li a {
        padding: 0.8rem;
        font-size: 0.85rem;
    }

    /* Main content */
    main {
        padding: 0.75rem 0.5rem;
    }

    /* Hero */
    .hero {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
    }

    .hero h2 {
        font-size: 1.6rem;
        margin-bottom: 0.8rem;
    }

    .hero p {
        font-size: 0.9rem;
        margin-bottom: 1.2rem;
    }

    #getLocation {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
    }

    /* Categories */
    .categories h3 {
        font-size: 1.5rem;
        margin-bottom: 1.2rem;
    }

    .category-card-content {
        padding: 0.8rem;
    }

    /* Cards */
    .store-card,
    .product-card,
    .category-card {
        border-radius: 8px;
    }

    /* Forms */
    .login-form,
    .register-form {
        padding: 1.2rem 1rem;
        margin: 1rem auto;
    }

    .login-form h2,
    .register-form h2 {
        font-size: 1.2rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.7rem 0.8rem;
        font-size: 0.85rem;
    }

    /* Buttons */
    .btn,
    .btn-primary,
    .btn-secondary {
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
    }

    /* Cart */
    .cart-total {
        padding: 0.8rem;
        font-size: 0.9rem;
    }

    /* Checkout */
    .checkout-item,
    .order-item {
        padding: 0.4rem 0;
        font-size: 0.9rem;
    }

    /* Confirmation */
    .confirmation-container {
        padding: 1.2rem 1rem;
    }

    .confirmation-icon {
        font-size: 2.5rem;
    }

    /* Tables */
    table th,
    table td {
        padding: 0.6rem 0.4rem;
        font-size: 0.8rem;
    }

    /* Stats */
    .stat-card {
        padding: 0.8rem;
    }

    .stat-card h3 {
        font-size: 1.2rem;
    }

    /* Modals */
    .modal-content {
        margin: 0.5rem;
        padding: 1rem;
    }

    .modal-header h3 {
        font-size: 1.1rem;
    }

    /* Footer */
    footer {
        padding: 1.5rem 0.75rem 0.75rem;
    }

    footer p {
        font-size: 0.8rem;
    }

    /* Scroll to top */
    .scroll-to-top {
        bottom: 0.75rem;
        right: 0.75rem;
        width: 40px;
        height: 40px;
    }
}

/* Extra Small Mobile (up to 319px) */
@media (max-width: 319px) {
    /* Emergency responsive for very small screens */
    nav {
        padding: 0.5rem;
    }

    main {
        padding: 0.5rem 0.25rem;
    }

    .hero {
        padding: 1rem 0.75rem;
    }

    .login-form,
    .register-form {
        max-width: 100%;
        margin: 0.5rem;
        padding: 1rem 0.75rem;
    }

    .category-grid,
    .store-grid,
    .product-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* High-resolution displays */
@media (min-width: 1200px) {
    .hero h2 {
        font-size: 4rem;
    }

    .hero p {
        font-size: 1.4rem;
    }

    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Print styles */
@media print {
    header,
    footer,
    .scroll-to-top,
    nav ul li:not(:first-child) {
        display: none !important;
    }

    .hero {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }

    .btn,
    .menu-toggle {
        display: none !important;
    }

    .category-card,
    .store-card,
    .product-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here if required */
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .category-card,
    .store-card,
    .product-card,
    .login-form,
    .register-form {
        border: 2px solid currentColor;
    }

    nav ul li a:hover {
        background: currentColor;
        color: white;
    }
}

/* Mobile Landscape Login Form - Fit in single screen */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        margin: 0;
        padding: 0;
    }

    .login-form,
    .register-form {
        max-width: 85vw;
        margin: 0.2rem auto;
        padding: 0.6rem 0.8rem;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .login-form::before,
    .register-form::before {
        height: 2px;
    }

    .login-form h2,
    .register-form h2 {
        margin-bottom: 0.4rem;
        font-size: 1.1rem;
        font-weight: 600;
    }

    .login-form form,
    .register-form form {
        gap: 0.5rem;
    }

    .form-group {
        position: relative;
        margin-bottom: 0;
    }

    .form-group label {
        margin-bottom: 0;
        font-size: 0.7rem;
        display: none;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
        border-radius: 6px;
        margin-bottom: 0.3rem;
    }

    .form-group input::placeholder,
    .form-group select::placeholder,
    .form-group textarea::placeholder {
        font-size: 0.8rem;
    }

    .login-form .btn-primary,
    .register-form .btn-primary {
        padding: 0.5rem 1.2rem;
        font-size: 0.85rem;
        margin-top: 0.3rem;
        border-radius: 8px;
    }

    .login-form p,
    .register-form p {
        margin-top: 0.4rem;
        margin-bottom: 0;
        font-size: 0.75rem;
    }

    .login-form a,
    .register-form a {
        font-size: 0.75rem;
    }
}

/* Center form headings */
.checkout-form h3,
.order-summary h3,
.order-details h3,
.delivery-info h3 {
    text-align: center;
}

/* ===== TOAST NOTIFICATION SYSTEM ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    min-width: 300px;
    position: relative;
    overflow: hidden;
}

.toast-icon {
    font-size: 20px;
    font-weight: bold;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin: 0;
}

.toast-message {
    font-size: 13px;
    opacity: 0.8;
    margin: 0;
}

.toast-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    opacity: 1;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
}

/* Toast Types */
.toast.success {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-left: 4px solid #10b981;
}

.toast.success .toast-icon {
    color: #10b981;
}

.toast.success .toast-title {
    color: #059669;
}

.toast.success .toast-progress {
    background: linear-gradient(90deg, #10b981, #6ee7b7);
}

.toast.error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-left: 4px solid #ef4444;
}

.toast.error .toast-icon {
    color: #ef4444;
}

.toast.error .toast-title {
    color: #dc2626;
}

.toast.error .toast-progress {
    background: linear-gradient(90deg, #ef4444, #fca5a5);
}

.toast.warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-left: 4px solid #f59e0b;
}

.toast.warning .toast-icon {
    color: #f59e0b;
}

.toast.warning .toast-title {
    color: #d97706;
}

.toast.warning .toast-progress {
    background: linear-gradient(90deg, #f59e0b, #fde68a);
}

.toast.info {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left: 4px solid #0ea5e9;
}

.toast.info .toast-icon {
    color: #0ea5e9;
}

.toast.info .toast-title {
    color: #0284c7;
}

.toast.info .toast-progress {
    background: linear-gradient(90deg, #0ea5e9, #7dd3fc);
}

/* Toast Animations */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

@keyframes popIn {
    0% {
        transform: scale(0.8) rotate(-5deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes progressBar {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

.toast.slideIn {
        border-radius: var(--border-radius);
}

.toast.slideOut {
    animation: slideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.popIn {
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Mobile responsive - toast container */
@media (max-width: 480px) {
    .toast-container {
        left: 10px;
        right: 10px;
        max-width: none;
    }
    
    .toast {
        min-width: auto;
    }
}
