/**
 * ShopEase - Main Stylesheet
 * Mobile-first responsive design
 */

/* ===== CSS Variables ===== */
:root {
    --primary: #2196F3;
    --primary-dark: #1976D2;
    --primary-light: #E3F2FD;
    --secondary: #FF9800;
    --success: #4CAF50;
    --danger: #F44336;
    --warning: #FFC107;
    --info: #00BCD4;
    --dark: #1a1a2e;
    --gray: #6c757d;
    --gray-light: #f5f5f5;
    --gray-medium: #e0e0e0;
    --white: #ffffff;
    --black: #000000;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-sm: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --transition: all 0.3s ease;
    --max-width: 480px;
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
    background: #f0f2f5;
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

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

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

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
    transition: var(--transition);
}

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

ul, ol {
    list-style: none;
}

/* ===== App Container ===== */
.app-container {
    max-width: var(--max-width);
    margin: 0 auto;
    background: var(--white);
    min-height: 100vh;
    position: relative;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 12px));
}

/* ===== Header ===== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--white);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border-radius: var(--border-radius-sm);
}

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

.site-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border-radius: var(--border-radius-sm);
    position: relative;
    color: var(--text-primary);
}

.header-icon-btn:hover {
    background: var(--gray-light);
}

.badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger);
    color: var(--white);
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Bottom Navigation ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-width);
    background: var(--white);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 8px));
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
    z-index: 9999;
    border-top: 1px solid var(--gray-medium);
    pointer-events: auto;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 500;
    padding: 6px 16px;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(33,150,243,0.1);
    min-height: 44px;
    min-width: 56px;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

.nav-item i, .nav-item svg {
    width: 22px;
    height: 22px;
}

.nav-item.active {
    color: var(--primary);
}

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

/* ===== Banner Carousel ===== */
.banner-carousel {
    position: relative;
    overflow: hidden;
}

.banner-slides {
    display: flex;
    transition: transform 0.5s ease;
}

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

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

.banner-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 12px 0;
}

.banner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-medium);
    border: none;
    transition: var(--transition);
}

.banner-dot.active {
    width: 24px;
    border-radius: 4px;
    background: var(--primary);
}

/* ===== Category Section ===== */
.categories-section {
    padding: 16px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
    background: var(--primary-light);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.category-card:nth-child(even) {
    background: #FFF3E0;
}

.category-card:nth-child(3) {
    background: #E8F5E9;
}

.category-card:nth-child(4) {
    background: #F3E5F5;
}

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

.category-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.category-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    text-transform: uppercase;
}

/* ===== Section Header ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    padding-bottom: 8px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.see-more {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
}

/* ===== Products Grid ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 16px;
}

.product-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
}

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

.product-image {
    position: relative;
    padding: 12px;
    background: var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 140px;
}

.product-image img {
    max-height: 100%;
    object-fit: contain;
}

.fav-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    color: var(--gray);
}

.fav-btn.active {
    color: var(--danger);
}

.out-of-stock-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: var(--white);
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.product-info {
    padding: 10px 12px;
}

.product-category {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.product-rating {
    display: flex;
    gap: 2px;
    margin: 4px 0;
}

.product-rating .star {
    color: var(--gray-medium);
    font-size: 0.8rem;
}

.product-rating .star.filled {
    color: var(--secondary);
}

.product-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
}

.product-price .original {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-decoration: line-through;
    margin-left: 4px;
    font-weight: 400;
}

/* ===== Product Detail ===== */
.product-detail-page {
    background: var(--white);
    min-height: 100vh;
}

.pd-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 100;
}

.pd-image-container {
    background: var(--gray-light);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
}

.pd-image-container img {
    max-height: 240px;
    object-fit: contain;
}

.pd-info {
    padding: 20px 16px;
}

.pd-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.pd-title {
    font-size: 1.2rem;
    font-weight: 700;
    flex: 1;
    line-height: 1.4;
}

.pd-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.pd-section {
    border-top: 1px solid var(--gray-medium);
    padding: 16px 0;
}

.pd-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.pd-description {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-primary);
}

/* Quantity Selector */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--gray-light);
    padding: 12px;
    border-radius: var(--border-radius);
    width: fit-content;
}

.qty-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

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

.qty-value {
    font-size: 1.1rem;
    font-weight: 700;
    min-width: 30px;
    text-align: center;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33,150,243,0.3);
}

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

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

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

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

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
}

/* ===== Auth Pages ===== */
.auth-page {
    min-height: 100vh;
    background: var(--white);
    display: flex;
    flex-direction: column;
}

.auth-container {
    flex: 1;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
}

.auth-title {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 32px;
}

.input-group {
    margin-bottom: 16px;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--gray-light);
    border-radius: var(--border-radius);
    padding: 4px 16px;
    border: 2px solid transparent;
    transition: var(--transition);
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    background: var(--white);
}

.input-wrapper .input-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 8px;
    outline: none;
    font-size: 1rem;
}

.input-wrapper .toggle-password {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    background: none;
    flex-shrink: 0;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

.checkbox-wrapper label {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.auth-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
}

.auth-link {
    font-size: 0.9rem;
}

/* ===== Cart Page ===== */
.cart-page {
    padding: 16px;
}

.shipping-address-card {
    background: var(--gray-light);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 20px;
}

.sa-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sa-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.sa-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.btn-change-address {
    padding: 6px 14px;
    border: 1px solid var(--gray-medium);
    background: var(--white);
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

/* Cart Items */
.cart-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-light);
}

.cart-item-img {
    width: 70px;
    height: 70px;
    background: var(--gray-light);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cart-item-img img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.cart-item-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.remove-item {
    color: var(--danger);
    font-size: 0.8rem;
    background: none;
}

/* Cart Summary */
.cart-summary {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 2px solid var(--gray-medium);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.summary-row.total {
    font-size: 1.1rem;
    font-weight: 700;
    padding-top: 12px;
    border-top: 1px solid var(--gray-medium);
}

.coupon-section {
    margin: 16px 0;
}

.coupon-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.coupon-input-wrapper {
    display: flex;
    gap: 8px;
}

.coupon-input-wrapper input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--gray-medium);
    border-radius: var(--border-radius);
    background: var(--gray-light);
    outline: none;
}

.coupon-input-wrapper input:focus {
    border-color: var(--primary);
}

/* ===== Checkout Page ===== */
.checkout-page {
    padding: 16px;
}

.schedule-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 16px;
    width: fit-content;
    margin-left: auto;
}

.total-card {
    background: var(--gray-light);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.total-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.total-amount {
    font-size: 1.6rem;
    font-weight: 700;
}

.delivery-info {
    margin-bottom: 20px;
}

.di-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 0.85rem;
    text-transform: uppercase;
}

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

/* Payment Methods */
.payment-methods {
    margin-bottom: 24px;
}

.pm-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.pm-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pm-option {
    padding: 10px 18px;
    border: 2px solid var(--gray-medium);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    background: var(--white);
    display: flex;
    align-items: center;
    gap: 6px;
}

.pm-option.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.pm-note {
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: 10px;
    font-style: italic;
}

/* ===== Orders Page ===== */
.orders-tabs {
    display: flex;
    background: var(--white);
    border-radius: 50px;
    overflow: hidden;
    margin: 0 16px 16px;
    border: 1px solid var(--gray-medium);
}

.orders-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--white);
    border: none;
    color: var(--text-secondary);
    transition: var(--transition);
}

.orders-tab.active {
    background: var(--primary);
    color: var(--white);
}

.order-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--white);
    margin: 0 16px 12px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.order-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.order-info {
    flex: 1;
    min-width: 0;
}

.order-ref {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.order-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.order-status.pending { background: #FFF3E0; color: #E65100; }
.order-status.accepted { background: #E3F2FD; color: #1565C0; }
.order-status.processing { background: #F3E5F5; color: #7B1FA2; }
.order-status.out_for_delivery { background: #E8F5E9; color: #2E7D32; }
.order-status.delivered { background: #E8F5E9; color: #2E7D32; }
.order-status.cancelled { background: #FFEBEE; color: #C62828; }

.order-amount {
    font-size: 0.9rem;
    font-weight: 700;
}

.order-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

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

.btn-view-order {
    padding: 6px 14px;
    border: 1px solid var(--primary);
    color: var(--primary);
    background: var(--white);
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

/* ===== Track Order ===== */
.tracker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 16px;
    margin: 0 16px 20px;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.tracker-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.tracker-step .step-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    font-size: 1.2rem;
    border: 3px solid var(--gray-medium);
}

.tracker-step.active .step-icon {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.tracker-step.completed .step-icon {
    background: var(--success);
    color: var(--white);
    border-color: var(--success);
}

.tracker-step .step-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-secondary);
}

.tracker-step.active .step-label {
    color: var(--primary);
}

.tracker-line {
    flex: 1;
    height: 3px;
    background: var(--gray-medium);
    margin: 0 4px;
    margin-bottom: 32px;
    max-width: 40px;
}

.tracker-line.completed {
    background: var(--success);
}

/* Order Details Card */
.od-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 0 16px 16px;
    box-shadow: var(--shadow);
}

.od-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.od-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.od-value {
    font-size: 0.9rem;
    font-weight: 700;
}

.od-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-light);
}

.od-item img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    background: var(--gray-light);
    border-radius: var(--border-radius-sm);
}

.od-item-details {
    flex: 1;
}

.od-item-name {
    font-size: 0.85rem;
}

.od-item-qty {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.od-item-price {
    font-weight: 700;
}

/* ===== Wallet Page ===== */
.wallet-card {
    background: var(--gray-light);
    border-radius: var(--border-radius);
    padding: 24px;
    margin: 16px;
}

.wallet-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.wallet-balance {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 16px;
}

/* ===== Favourites ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

.empty-state-icon {
    width: 120px;
    height: 120px;
    margin-bottom: 24px;
    opacity: 0.7;
}

.empty-state-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 280px;
    line-height: 1.6;
}

/* ===== Notifications ===== */
.notification-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--white);
    margin: 0 16px 8px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    position: relative;
}

.notification-item.unread {
    background: var(--primary-light);
}

.notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #E8F5E9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--success);
    flex-shrink: 0;
}

.notif-content {
    flex: 1;
}

.notif-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.notif-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.notif-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.notif-delete {
    color: var(--danger);
    background: none;
    padding: 4px;
}

/* ===== Profile Page ===== */
.profile-header {
    background: var(--primary);
    color: var(--white);
    padding: 32px 16px;
    text-align: center;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--white);
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary);
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.profile-phone {
    font-size: 0.85rem;
    opacity: 0.9;
}

.profile-menu {
    padding: 16px;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--white);
    border-radius: var(--border-radius);
    margin-bottom: 8px;
    box-shadow: var(--shadow);
    color: var(--text-primary);
}

.profile-menu-item i,
.profile-menu-item svg {
    color: var(--primary);
    width: 22px;
    height: 22px;
}

.profile-menu-item span {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
}

.profile-menu-item .arrow {
    color: var(--gray);
}

/* ===== Floating Chat Button ===== */
.chat-fab {
    position: fixed;
    bottom: calc(78px + env(safe-area-inset-bottom, 8px));
    right: 16px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(33,150,243,0.4);
    z-index: 9998;
    font-size: 1.3rem;
    pointer-events: auto;
}

.chat-fab:hover {
    transform: scale(1.05);
}

/* ===== Toast Notifications ===== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 14px 24px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 10000;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all 0.4s ease;
    min-width: 280px;
    max-width: 90%;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-success {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #A5D6A7;
}

.toast-error {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #EF9A9A;
}

.toast-info {
    background: #E3F2FD;
    color: #1565C0;
    border: 1px solid #90CAF9;
}

/* ===== PWA Install Popup ===== */
.pwa-popup {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(200px);
    width: 90%;
    max-width: 400px;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 20px;
    z-index: 10001;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pwa-popup.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.pwa-popup-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.pwa-popup-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-sm);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.pwa-popup-title {
    font-size: 1rem;
    font-weight: 700;
}

.pwa-popup-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.pwa-popup-body {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.pwa-popup-actions {
    display: flex;
    gap: 10px;
}

.pwa-popup-actions button {
    flex: 1;
    padding: 10px;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.9rem;
}

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

.pwa-btn-dismiss {
    background: var(--gray-light);
    color: var(--text-secondary);
}

.pwa-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 10000;
    display: none;
}

.pwa-overlay.show {
    display: block;
}

/* ===== iOS Install Instructions ===== */
.ios-instructions {
    background: var(--gray-light);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-top: 12px;
}

.ios-step {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

.ios-step:last-child {
    margin-bottom: 0;
}

.ios-step i,
.ios-step svg {
    color: var(--primary);
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ===== Search Bar ===== */
.search-bar {
    padding: 12px 16px;
}

.search-wrapper {
    display: flex;
    align-items: center;
    background: var(--gray-light);
    border-radius: var(--border-radius);
    padding: 4px 16px;
}

.search-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px;
    outline: none;
    font-size: 0.95rem;
}

.search-wrapper button {
    background: none;
    color: var(--gray);
    padding: 8px;
}

/* ===== Category Banner ===== */
.category-banner {
    margin: 0 16px 16px;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.category-banner img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

/* ===== Side Drawer ===== */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.drawer-overlay.show {
    display: block;
    opacity: 1;
}

.drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: var(--white);
    z-index: 2001;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.drawer.show {
    transform: translateX(0);
}

.drawer-header {
    padding: 24px 20px;
    background: var(--primary);
    color: var(--white);
}

.drawer-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.drawer-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
    overflow: hidden;
}

.drawer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.drawer-user-name {
    font-weight: 700;
    font-size: 1rem;
}

.drawer-user-email {
    font-size: 0.8rem;
    opacity: 0.9;
}

.drawer-menu {
    padding: 16px 0;
}

.drawer-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}

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

.drawer-item i,
.drawer-item svg {
    color: var(--primary);
    width: 20px;
    height: 20px;
}

.drawer-divider {
    height: 1px;
    background: var(--gray-light);
    margin: 8px 16px;
}

/* ===== Page Header ===== */
.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-header h1 {
    font-size: 1.1rem;
    font-weight: 700;
    flex: 1;
    text-align: center;
    margin-right: 40px;
}

.back-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border-radius: 50%;
    color: var(--text-primary);
}

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

/* ===== Forms ===== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-medium);
    border-radius: var(--border-radius);
    background: var(--white);
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(33,150,243,0.1);
}

.form-input::placeholder {
    color: var(--gray);
}

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

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

/* ===== Admin Styles ===== */
.admin-body {
    background: #f5f6fa;
}

.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: var(--dark);
    color: var(--white);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.admin-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-sidebar-logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--white);
}

.admin-sidebar-menu {
    padding: 16px 0;
}

.admin-sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.admin-sidebar-item:hover,
.admin-sidebar-item.active {
    color: var(--white);
    background: rgba(255,255,255,0.05);
    border-left-color: var(--primary);
}

.admin-sidebar-item i,
.admin-sidebar-item svg {
    width: 18px;
    height: 18px;
}

.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 24px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.admin-title {
    font-size: 1.4rem;
    font-weight: 700;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    float: right;
    margin-top: -40px;
}

/* Admin Tables */
.admin-table-wrapper {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background: var(--gray-light);
    padding: 12px 16px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-light);
    font-size: 0.9rem;
}

.admin-table tr:hover td {
    background: rgba(33,150,243,0.02);
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.active,
.status-badge.delivered,
.status-badge.paid {
    background: #E8F5E9;
    color: #2E7D32;
}

.status-badge.pending {
    background: #FFF3E0;
    color: #E65100;
}

.status-badge.banned,
.status-badge.cancelled {
    background: #FFEBEE;
    color: #C62828;
}

.btn-action {
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 4px;
}

/* Admin Forms */
.admin-form {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    max-width: 800px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.color-preview {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    border: 2px solid var(--gray-medium);
    display: inline-block;
    vertical-align: middle;
    margin-left: 8px;
}

/* Template Cards */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.template-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    border: 3px solid transparent;
}

.template-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.template-card.active {
    border-color: var(--primary);
}

.template-preview {
    height: 150px;
    background: var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--gray);
}

.template-info {
    padding: 16px;
}

.template-name {
    font-weight: 700;
    margin-bottom: 4px;
}

.template-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 20px;
}

.page-link {
    padding: 8px 14px;
    border-radius: var(--border-radius-sm);
    background: var(--white);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: var(--shadow);
}

.page-link.active {
    background: var(--primary);
    color: var(--white);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.show {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 769px) {
    .admin-sidebar {
        transform: translateX(0) !important;
    }
    .admin-main {
        margin-left: 260px !important;
    }
}

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

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-medium);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray);
}

/* ===== Utility Classes ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
