/* CStore — Design System */

/* ============================================
   CSS Custom Properties (Theme)
   ============================================ */
:root {
    /* Primary colors set dynamically from PHP via inline style */
    --bg: #f8f9fa;
    --card-bg: #ffffff;
    --text: #1a1a2e;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --success: #10b981;
    --success-bg: #ecfdf5;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --info: #3b82f6;
    --info-bg: #eff6ff;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 24px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
    --transition: 0.2s ease;
    --font: 'IBM Plex Sans Arabic', sans-serif;
    --navbar-height: 64px;
}

/* ============================================
   Reset & Base
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ============================================
   Navbar
   ============================================ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.navbar-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--navbar-height);
    padding: 0 1.25rem;
    gap: 1rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
}

.navbar-logo {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.navbar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--primary-lighter);
}

.nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.wallet-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    background: var(--success-bg);
    color: var(--success);
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 20px;
    cursor: pointer;
}

/* User dropdown */
.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: var(--border-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    transition: all var(--transition);
}

.user-menu-btn:hover {
    border-color: var(--primary);
}

.user-menu-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    z-index: 200;
    overflow: hidden;
}

.user-menu-dropdown.show {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    color: var(--text);
    transition: background var(--transition);
}

.dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all var(--transition);
}

.hamburger.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}

.hamburger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile nav */
.mobile-nav {
    display: none;
    flex-direction: column;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 0.5rem;
}

.mobile-nav.show {
    display: flex;
}

.mobile-nav-link {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
    min-height: calc(100vh - var(--navbar-height));
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg, 16px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(.25, .8, .25, 1), box-shadow 0.3s cubic-bezier(.25, .8, .25, 1);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.06);
}

.card-body {
    padding: 1rem 1.1rem 1.15rem;
}

.card-img-wrap {
    position: relative;
    overflow: hidden;
    background: var(--bg-secondary, #f5f5f5);
}

.card-img-wrap::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.08), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover .card-img-wrap::after {
    opacity: 1;
}

.card-img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    transition: transform 0.45s cubic-bezier(.25, .8, .25, 1);
}

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

.card-delivery-pill {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.68rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-weight: 700;
    letter-spacing: 0.01em;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2;
    line-height: 1.3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.card-delivery-pill.auto {
    background: rgba(16, 185, 129, 0.88);
    color: #fff;
}

.card-delivery-pill.manual {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.45;
    margin-bottom: 0.4rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-price {
    display: inline-block;
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    padding: 0.2rem 0.65rem;
    border-radius: 8px;
    margin-top: 0.35rem;
    letter-spacing: -0.01em;
}

.card-no-hover:hover {
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* ============================================
   Product Grid
   ============================================ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1.1rem;
}

.products-grid .card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.products-grid .card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.products-grid .card .card-price,
.products-grid .card .contact-only-badge {
    margin-top: auto;
}

.category-section {
    margin-bottom: 2rem;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-light);
    color: var(--text);
    text-decoration: none;
    transition: color var(--transition);
}

.category-title:hover {
    color: var(--primary);
}

/* ============================================
   Hero Carousel
   ============================================ */
.hero-carousel {
    position: relative;
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 2rem;
    aspect-ratio: 21/9;
    background: var(--border-light);
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-slide .slide-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
}

.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all var(--transition);
}

.carousel-dot.active {
    background: white;
    width: 20px;
    border-radius: 4px;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    min-height: 44px;
}

.btn:active {
    transform: scale(0.97);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

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

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

.btn-success:hover {
    background: color-mix(in srgb, var(--success) 85%, black);
    color: white;
}

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

.btn-danger:hover {
    background: color-mix(in srgb, var(--danger) 85%, black);
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    min-height: 36px;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-icon {
    padding: 0.5rem;
    min-height: auto;
}

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

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: var(--text);
}

.form-label .required {
    color: var(--danger);
}

.form-label .optional {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.8rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: var(--card-bg);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

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

.form-input.error {
    border-color: var(--danger);
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ============================================
   Badges & Status
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-pending {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-accepted,
.badge-delivered {
    background: var(--success-bg);
    color: var(--success);
}

.badge-delivering {
    background: var(--info-bg);
    color: var(--info);
}

.badge-canceled {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-denied {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ============================================
   Auth Page (Login / Register)
   ============================================ */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.auth-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
}

.auth-card h1 {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-card .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 1.75rem;
}

.auth-tabs {
    display: flex;
    border-radius: var(--radius-sm);
    background: var(--border-light);
    padding: 3px;
    margin-bottom: 1.5rem;
}

.auth-tab {
    flex: 1;
    padding: 0.55rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-secondary);
    border: none;
    background: none;
}

.auth-tab.active {
    background: var(--card-bg);
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-error {
    background: var(--danger-bg);
    color: var(--danger);
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: none;
}

.auth-error.show {
    display: block;
}

/* ============================================
   Wallet
   ============================================ */
.wallet-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.wallet-balance {
    font-size: 2.5rem;
    font-weight: 700;
}

.wallet-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

/* ============================================
   Orders
   ============================================ */
.order-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: box-shadow var(--transition);
    cursor: pointer;
}

.order-card:hover {
    box-shadow: var(--shadow);
}

.order-info {
    flex: 1;
}

.order-id {
    font-weight: 700;
    color: var(--primary);
}

.order-item-name {
    font-weight: 600;
}

.order-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.order-price {
    font-weight: 700;
    font-size: 1.1rem;
}

/* ============================================
   Delivery Content
   ============================================ */
.delivery-content {
    background: var(--primary-lighter);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 1rem;
}

.delivery-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.delivery-item:last-child {
    border-bottom: none;
}

.delivery-item img {
    max-width: 400px;
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
}

.delivery-item video,
.delivery-item audio {
    max-width: 100%;
    margin-top: 0.5rem;
}

.delivery-item .doc-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.85rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* ============================================
   Countdown Timer
   ============================================ */
.countdown {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    color: var(--warning);
    font-weight: 600;
}

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

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

.modal {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.3s;
}

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

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

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--border-light);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.modal-close:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}

/* ============================================
   Admin Sidebar
   ============================================ */
.admin-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
    min-height: calc(100vh - var(--navbar-height) - 3rem);
}

.admin-sidebar {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem 0.5rem;
    position: sticky;
    top: calc(var(--navbar-height) + 1.5rem);
    height: fit-content;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: right;
}

.admin-nav-item:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.admin-nav-item.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

.admin-content {
    min-width: 0;
    /* Prevent overflow */
}

.admin-page-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ============================================
   Tables (DataTables overrides)
   ============================================ */
.dataTables_wrapper {
    font-size: 0.9rem !important;
}

table.dataTable {
    width: 100% !important;
    border-collapse: collapse;
}

table.dataTable thead th {
    background: var(--border-light);
    padding: 0.75rem 0.85rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: right;
    border-bottom: 2px solid var(--border);
}

table.dataTable tbody td {
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

table.dataTable tbody tr:hover {
    background: var(--primary-lighter);
}

.dataTables_filter input {
    padding: 0.5rem 0.75rem !important;
    border: 1.5px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    margin-right: 0.5rem;
}

.dataTables_length select {
    padding: 0.4rem 0.5rem !important;
    border: 1.5px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
}

.dataTables_paginate .paginate_button {
    padding: 0.35rem 0.65rem !important;
    border-radius: 6px !important;
    border: 1px solid var(--border) !important;
    margin: 0 2px !important;
}

.dataTables_paginate .paginate_button.current {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

.dt-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dt-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dataTables_processing {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    padding: 0.75rem 1.5rem !important;
    background: var(--card-bg) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: var(--shadow-lg) !important;
    font-size: 0.9rem !important;
    z-index: 10 !important;
}

/* ============================================
   Alerts & Toast
   ============================================ */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.alert-info {
    background: var(--info-bg);
    color: var(--info);
}

.toast-container {
    position: fixed;
    top: calc(var(--navbar-height) + 12px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    max-width: 380px;
}

.toast-success {
    background: var(--success);
    color: white;
}

.toast-error {
    background: var(--danger);
    color: white;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* ============================================
   Loading
   ============================================ */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.page-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.empty-state-text {
    font-size: 1rem;
}

/* ============================================
   Contact Only Badge
   ============================================ */
.contact-only-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: var(--info-bg);
    color: var(--info);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    margin-top: 3rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.footer a {
    color: var(--primary);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .navbar-links {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .user-menu {
        display: none;
    }

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

    .hero-carousel {
        aspect-ratio: 16/9;
        border-radius: var(--radius);
    }

    .auth-card {
        padding: 1.5rem;
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
        display: flex;
        overflow-x: auto;
        gap: 0.25rem;
        padding: 0.5rem;
    }

    .admin-nav-item {
        white-space: nowrap;
    }

    .wallet-balance {
        font-size: 2rem;
    }

    .modal {
        max-width: 100%;
        border-radius: var(--radius);
    }

    .order-card {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }

    .card-body {
        padding: 0.7rem 0.8rem 0.8rem;
    }

    .card-title {
        font-size: 0.85rem;
    }

    .card-price {
        font-size: 0.85rem;
        padding: 0.15rem 0.5rem;
    }

    .card-delivery-pill {
        font-size: 0.6rem;
        padding: 0.2rem 0.45rem;
        top: 6px;
        right: 6px;
    }

    .card-text {
        font-size: 0.72rem;
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1.25rem;
    }
}