:root {
    --primary-green: #2d8659;
    --light-green: #4caf7a;
    --dark-green: #1e5d3f;
    --white: #ffffff;
    --light-gray: #f5f5f5;
    --gray: #e0e0e0;
    --dark-gray: #666;
    --text-dark: #333;
    --bg-color: #ffffff;
    --card-bg: #ffffff;
}

[data-theme="dark"] {
    --primary-green: #4caf7a;
    --light-green: #6bcf9a;
    --dark-green: #2d8659;
    --white: #1e293b;
    --light-gray: #334155;
    --gray: #475569;
    --dark-gray: #94a3b8;
    --text-dark: #f1f5f9;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--light-green) 100%);
    color: var(--white);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    text-decoration: none;
    color: var(--white);
}

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

.nav-links a {
    color: var(--white);
    text-decoration: none;
    transition: opacity 0.3s;
}

.nav-links a:hover {
    opacity: 0.8;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 0.25rem;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--white);
    border-radius: 3px;
    transition: all 0.3s ease;
}

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

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

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

/* Mobile Menu Styles */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Show mobile cart icon */
    .cart-link-mobile {
        display: flex !important;
    }
    
    /* Hide cart from mobile menu */
    .nav-links .cart-link {
        display: none !important;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 280px;
        background: linear-gradient(135deg, var(--primary-green) 0%, var(--light-green) 100%);
        flex-direction: column;
        align-items: flex-start;
        padding: 5rem 2rem 2rem;
        gap: 1.5rem;
        transition: right 0.3s ease;
        box-shadow: -2px 0 10px rgba(0,0,0,0.2);
        z-index: 1000;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links li {
        width: 100%;
    }
    
    .nav-links a {
        display: block;
        padding: 0.75rem 0;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        width: 100%;
    }
    
    .nav-links .theme-toggle {
        width: 100%;
        justify-content: flex-start;
        padding: 0.75rem 0;
    }
    
    /* Overlay when menu is open */
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .nav-overlay.active {
        display: block;
    }
}

.btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: var(--primary-green);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--dark-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-secondary {
    background-color: var(--white);
    color: var(--primary-green);
    border: 2px solid var(--primary-green);
}

/* Ensure btn-secondary in header has good contrast */
header .btn-secondary {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--white);
    border: 2px solid var(--white);
    backdrop-filter: blur(10px);
}

[data-theme="dark"] header .btn-secondary {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border: 2px solid var(--white);
}

header .btn-secondary:hover {
    background-color: var(--white);
    color: var(--primary-green);
    border-color: var(--white);
}

[data-theme="dark"] header .btn-secondary:hover {
    background-color: var(--white);
    color: var(--dark-green);
    border-color: var(--white);
}

/* Regular btn-secondary outside header */
[data-theme="dark"] .btn-secondary:not(header .btn-secondary) {
    background-color: var(--card-bg);
    color: var(--primary-green);
    border: 2px solid var(--primary-green);
}

.btn-secondary:hover:not(header .btn-secondary) {
    background-color: var(--primary-green);
    color: var(--white);
    border-color: var(--primary-green);
}

[data-theme="dark"] .btn-secondary:hover:not(header .btn-secondary) {
    background-color: var(--primary-green);
    color: var(--white);
    border-color: var(--primary-green);
}

.btn-danger {
    background-color: #dc3545;
    color: var(--white);
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-success {
    background-color: #28a745;
    color: var(--white);
}

.btn-success:hover {
    background-color: #218838;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, rgba(45, 134, 89, 0.1) 0%, rgba(76, 175, 122, 0.1) 100%);
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    color: var(--primary-green);
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    color: var(--dark-gray);
    margin-bottom: 2rem;
}

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

.product-card {
    background: var(--card-bg);
    transition: background-color 0.3s ease;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.sort-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    box-shadow: 0 2px 6px rgba(0, 214, 89, 0.927);
}

.sort-control label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.sort-select {
    background: transparent;
    color: var(--text-dark);
    border: none;
    outline: none;
    font-size: 0.95rem;
    min-width: 180px;
    cursor: pointer;
}

.sort-select option {
    color: #111;
}

.product-image-wrapper {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: var(--light-gray);
    cursor: zoom-in;
}

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

.product-image-wrapper:hover .product-image {
    transform: scale(1.1);
}

.product-image-wrapper::after {
    content: '🔍';
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.product-image-wrapper:hover::after {
    opacity: 1;
}

.product-info {
    padding: 1.5rem;
}

.product-category {
    color: var(--primary-green);
    font-size: 0.9rem;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-name {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.product-description {
    color: var(--dark-gray);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    min-height: 40px;
}

.product-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-green);
    margin-bottom: 0.5rem;
}

.bulk-pricing {
    font-size: 0.85rem;
    color: var(--dark-gray);
    margin-bottom: 1rem;
}

.bulk-pricing span {
    display: block;
    margin: 0.2rem 0;
}

/* Forms */
.form-container {
    max-width: 500px;
    margin: 3rem auto;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease;
}

/* Links in form container - ensure good contrast */
.form-container a {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.3s ease;
}

.form-container a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

[data-theme="dark"] .form-container a {
    color: var(--light-green);
}

[data-theme="dark"] .form-container a:hover {
    color: var(--primary-green);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--gray);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-green);
}

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

/* Tables */
.table-container {
    overflow-x: auto;
    margin: 2rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 10px;
    overflow: hidden;
}

table thead {
    background: var(--primary-green);
    color: var(--white);
}

table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray);
}

table tbody tr:hover {
    background: var(--light-gray);
}

table tbody tr:last-child td {
    border-bottom: none;
}
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 10px;
    overflow: hidden;
}

thead {
    background: var(--primary-green);
    color: var(--white);
}

th, td {
    padding: 1rem;
    text-align: left;
}

tbody tr {
    border-bottom: 1px solid var(--gray);
}

tbody tr:hover {
    background: var(--light-gray);
}

tbody tr:last-child {
    border-bottom: none;
}

/* Dashboard */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--light-green) 100%);
    color: var(--white);
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.stat-card p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin: 1rem 0;
}

.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;
}

/* Alert Modal */
.alert-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1.5rem;
}

.alert-modal {
    background: var(--card-bg);
    color: var(--text-color);
    width: 100%;
    max-width: 420px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
}

.alert-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

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

.alert-modal-close {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.alert-modal-body {
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 1.25rem;
    white-space: pre-line;
}

.alert-modal-actions {
    display: flex;
    justify-content: flex-end;
}

.alert-modal-success {
    border-color: rgba(40, 167, 69, 0.4);
}

.alert-modal-error {
    border-color: rgba(220, 53, 69, 0.4);
}

.alert-modal-info {
    border-color: rgba(23, 162, 184, 0.4);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 10px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray);
}

.modal-header .close {
    font-size: 2rem;
    font-weight: bold;
    color: var(--dark-gray);
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    line-height: 1;
}

.modal-header .close:hover {
    color: var(--text-dark);
}

.close {
    color: var(--dark-gray);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: var(--text-dark);
}

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

.cart-summary {
    background: var(--light-gray);
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        flex-direction: column;
        gap: 1rem;
    }

    .hero.has-banner {
        background-size: contain;
        background-position: top center;
        min-height: 800px;
    }

    .hero h1 {
        font-size: 2rem;
    }

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

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

    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 0.5rem;
    }
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--dark-gray);
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background-color: #28a745;
    color: var(--white);
}

.badge-warning {
    background-color: #ffc107;
    color: var(--text-dark);
}

.badge-danger {
    background-color: #dc3545;
    color: var(--white);
}

.badge-info {
    background-color: #17a2b8;
    color: var(--white);
}

/* Cart Badge */
.cart-link {
    position: relative;
    text-decoration: none;
    transition: opacity 0.2s;
}

.cart-link:hover {
    opacity: 0.8;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
    animation: pulse 1.5s infinite;
}

.notification-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff3b30;
    box-shadow: 0 0 6px rgba(255, 59, 48, 0.6);
    display: inline-block;
}

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

/* Referral Code */
.referral-box {
    background: linear-gradient(135deg, rgba(45, 134, 89, 0.1) 0%, rgba(76, 175, 122, 0.1) 100%);
    padding: 1.5rem;
    border-radius: 10px;
    margin: 1rem 0;
    text-align: center;
}

[data-theme="dark"] .referral-box {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(30, 41, 59, 0.9) 100%);
}

.wallet-chart-intro {
    color: var(--dark-gray);
    font-size: 0.9rem;
    margin: 0 0 1rem 0;
    line-height: 1.55;
    text-align: center;
    max-width: 40rem;
    margin-left: auto;
    margin-right: auto;
}

.wallet-chart-wrap {
    position: relative;
    height: min(320px, 70vw);
    min-height: 260px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0.75rem 0.5rem 0.25rem;
    border-radius: 14px;
    background: linear-gradient(165deg, rgba(45, 134, 89, 0.07) 0%, rgba(255, 255, 255, 0.4) 42%, transparent 72%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

[data-theme="dark"] .wallet-chart-wrap {
    background: linear-gradient(165deg, rgba(52, 211, 153, 0.08) 0%, rgba(15, 23, 42, 0.5) 45%, transparent 75%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.referral-code {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-green);
    margin: 0.5rem 0;
    font-family: monospace;
}

/* QR Code Container */
.qr-code-wrapper {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
    border: 3px solid var(--primary-green);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(45, 134, 89, 0.2), 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    margin: 0.5rem 0;
}

[data-theme="dark"] .qr-code-wrapper {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(30, 41, 59, 0.98) 100%);
    border-color: var(--light-green);
    box-shadow: 0 4px 12px rgba(76, 175, 122, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.qr-code-wrapper:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(45, 134, 89, 0.3), 0 4px 8px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .qr-code-wrapper:hover {
    box-shadow: 0 6px 16px rgba(76, 175, 122, 0.4), 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Campaign Banners */
.campaign-banners {
    margin-bottom: 2rem;
}

.campaign-banner {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--light-green) 100%);
    color: var(--white);
    padding: 2rem;
    margin: 1rem 0;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.campaign-banner:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.campaign-banner.has-image {
    background-size: cover;
    background-position: center;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.campaign-banner.has-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1;
}

.campaign-banner-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
}

.campaign-banner h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--white);
}

.campaign-banner p {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    opacity: 0.95;
}

.campaign-banner .discount-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    margin-top: 1rem;
}

/* Discounts Banner */
.discounts-banner {
    background: linear-gradient(135deg, rgba(45, 134, 89, 0.1) 0%, rgba(76, 175, 122, 0.1) 100%);
    padding: 2rem;
    border-radius: 10px;
    margin: 2rem 0;
}

.discounts-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.discount-item {
    background: var(--white);
    padding: 1rem;
    border-radius: 8px;
    border: 2px solid var(--primary-green);
    flex: 1;
    min-width: 200px;
    text-align: center;
}

.discount-code {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-green);
    font-family: monospace;
    margin: 0.5rem 0;
}

.discount-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--dark-green);
    margin: 0.5rem 0;
}

/* Product Discount Badge */
.product-discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc3545;
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    z-index: 10;
}

/* Product Preview Lightbox */
.product-preview-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-preview-overlay.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.product-preview-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.product-preview-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
}

.product-preview-info {
    color: var(--white);
    text-align: center;
    padding: 0 20px;
}

.product-preview-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.product-preview-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: var(--white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10001;
}

.product-preview-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.product-preview-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: var(--white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10001;
}

.product-preview-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.product-preview-nav.prev {
    left: 20px;
}

.product-preview-nav.next {
    right: 20px;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .product-preview-container {
        max-width: 95vw;
        padding: 20px;
    }
    
    .product-preview-image {
        max-height: 70vh;
    }
    
    .product-preview-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .product-preview-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .product-preview-nav.prev {
        left: 10px;
    }
    
    .product-preview-nav.next {
        right: 10px;
    }
    
    .product-preview-info h3 {
        font-size: 1.2rem;
    }
}

/* Quantity selector styles */
.qty-btn {
    background: var(--light-gray);
    border: none;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.2s;
    user-select: none;
}

.qty-btn:hover {
    background: var(--gray);
}

.qty-btn:active {
    background: var(--dark-gray);
    color: var(--white);
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid var(--gray);
    border-radius: 5px;
    overflow: hidden;
}

.quantity-selector input[type="number"] {
    width: 50px;
    text-align: center;
    border: none;
    padding: 0.5rem;
    font-size: 1rem;
    -moz-appearance: textfield;
}

.quantity-selector input[type="number"]::-webkit-inner-spin-button,
.quantity-selector input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Modern cart item styles */
.cart-item {
    transition: transform 0.2s, box-shadow 0.2s;
}

.cart-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* File upload styles */
input[type="file"] {
    padding: 0.5rem;
    border: 2px dashed var(--gray);
    border-radius: 5px;
    background: var(--light-gray);
    cursor: pointer;
    transition: border-color 0.3s;
    width: 100%;
}

input[type="file"]:hover {
    border-color: var(--primary-green);
}

/* Admin product grid view */
.admin-products-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem;
    margin-top: 2rem;
}

.admin-product-card {
    background: var(--white);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.admin-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.admin-product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 1rem;
}

/* Modal improvements */
.modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

@media (max-width: 480px) {
    .product-image-wrapper {
        height: 200px;
    }
    
    .product-preview-image {
        max-height: 60vh;
    }
}

/* Order Progress Bar Styles */
.order-progress-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 1rem;
    margin: 2rem 0;
    background: #f9f9f9;
    border-radius: 10px;
    position: relative;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
    z-index: 2;
}

.progress-step-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: #e0e0e0;
    color: #999;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    border: 3px solid #e0e0e0;
}

.progress-step.completed .progress-step-icon {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.2);
}

.progress-step.current .progress-step-icon {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.3);
    animation: pulse 2s infinite;
}

.progress-step.pending .progress-step-icon {
    background: #e0e0e0;
    color: #999;
    border-color: #e0e0e0;
}

.progress-step.cancelled .progress-step-icon {
    background: #f44336;
    color: white;
    border-color: #f44336;
}

.progress-step-label {
    font-size: 0.85rem;
    color: var(--text-dark);
    text-align: center;
    font-weight: 500;
    max-width: 100px;
}

.progress-step.completed .progress-step-label {
    color: var(--primary-green);
    font-weight: 600;
}

.progress-step.current .progress-step-label {
    color: var(--primary-green);
    font-weight: 700;
}

.progress-step.cancelled .progress-step-label {
    color: #f44336;
    font-weight: 600;
}

.progress-line {
    flex: 1;
    height: 3px;
    background: #e0e0e0;
    margin: 0 0.5rem;
    position: relative;
    top: -25px;
    z-index: 1;
    transition: background 0.3s ease;
}

.progress-line.completed {
    background: var(--primary-green);
}

.progress-step-indicator {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: var(--primary-green);
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--primary-green);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.3);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(76, 175, 80, 0.1);
    }
}

.order-item {
    transition: background 0.2s ease;
}

.order-item:hover {
    background: #f0f0f0;
}

/* Dark Mode Toggle Switch */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-toggle-label {
    font-size: 0.875rem;
    cursor: pointer;
    user-select: none;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.3);
    transition: 0.3s;
    border-radius: 24px;
}

.theme-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .theme-slider {
    background-color: rgba(255, 255, 255, 0.5);
}

input:checked + .theme-slider:before {
    transform: translateX(26px);
}

.theme-slider:hover {
    opacity: 0.8;
}

[data-theme="dark"] table tbody tr:hover {
    background: var(--gray);
}

@media (max-width: 768px) {
    .order-progress-container {
        flex-direction: column;
        padding: 1.5rem 0.5rem;
    }
    
    .progress-step {
        margin-bottom: 1rem;
    }
    
    .progress-line {
        display: none;
    }
    
    .progress-step-label {
        max-width: none;
    }
}

/* Product Detail Page Styles */
.product-detail-container {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-detail-grid {
    animation: fadeIn 0.5s ease-in;
}

@media (max-width: 768px) {
    .product-detail-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    .product-image-section img {
        min-height: 300px !important;
    }
    
    .product-info-section h1 {
        font-size: 2rem !important;
    }
    
    /* Ensure quantity selector is visible in product detail page */
    .add-to-cart-section {
        position: relative !important;
        z-index: 1 !important;
        visibility: visible !important;
        display: block !important;
    }
    
    .add-to-cart-section .quantity-selector {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 0 1rem 0 !important;
    }
    
    .add-to-cart-section .quantity-selector > div {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        border: 2px solid var(--border-color) !important;
        background: var(--card-bg) !important;
    }
    
    .add-to-cart-section .qty-btn {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        background: var(--light-gray) !important;
        color: var(--text-color) !important;
        border: none !important;
    }
    
    .add-to-cart-section .qty-input {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        background: var(--bg-color) !important;
        color: var(--text-color) !important;
        border: none !important;
        -webkit-appearance: textfield !important;
        -moz-appearance: textfield !important;
    }
    
    /* Dashboard mobile layout */
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }
    
    .quick-actions-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Cart mobile layout */
    .cart-item {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    
    .cart-item img {
        width: 100% !important;
        height: 200px !important;
        object-fit: cover !important;
    }
    
    .cart-item-actions {
        width: 100% !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
    }
    
    .cart-quantity-wrapper {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .cart-remove-btn {
        width: 100% !important;
        max-width: 200px;
        margin: 0.5rem auto 0 !important;
        font-size: 0.85rem !important;
        padding: 0.4rem 0.6rem !important;
    }
    
    .cart-item-total {
        width: 100% !important;
        text-align: center !important;
        min-width: auto !important;
        margin-top: 0.5rem;
    }
    
    .quantity-selector {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }
    
    /* Order progress tracker mobile alignment */
    .order-progress-tracker {
        gap: 0.1rem !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
        padding-right: 0.5rem !important;
        justify-content: flex-start !important;
    }
    
    .order-progress-tracker::-webkit-scrollbar {
        display: none;
    }
    
    .progress-step-item {
        min-width: 45px !important;
        flex-shrink: 0 !important;
        flex: 0 0 auto !important;
    }
    
    .progress-step-item > div:first-child {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.9rem !important;
        margin-bottom: 0.3rem !important;
        border-width: 2px !important;
    }
    
    .progress-step-label {
        font-size: 0.65rem !important;
        line-height: 1.1 !important;
        padding: 0 0.1rem;
        word-break: break-word;
    }
}

