/**
 * Talabatk - Modern App Design
 * تصميم عصري مثل تطبيق طلبات
 */

/* ============================================
   CSS Variables & Root
   ============================================ */
:root {
    /* Brand Colors - Talabat Orange Theme */
    --primary: #FF5A00;
    --primary-dark: #E54D00;
    --primary-light: #FF7A33;
    --primary-gradient: linear-gradient(135deg, #FF5A00 0%, #FF7A33 100%);
    
    /* Secondary Colors */
    --secondary: #00C853;
    --secondary-dark: #00A844;
    --danger: #FF3B30;
    --warning: #FFCC00;
    --info: #007AFF;
    
    /* Neutral Colors */
    --white: #FFFFFF;
    --gray-50: #FAFAFA;
    --gray-100: #F5F5F5;
    --gray-200: #EEEEEE;
    --gray-300: #E0E0E0;
    --gray-400: #BDBDBD;
    --gray-500: #9E9E9E;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;
    --black: #000000;
    
    /* Text Colors */
    --text-primary: #1A1A1A;
    --text-secondary: #666666;
    --text-muted: #999999;
    --text-light: #CCCCCC;
    
    /* Status Colors */
    --status-open: #00C853;
    --status-closed: #FF3B30;
    --status-busy: #FFCC00;
    
    /* Rating Colors */
    --rating-star: #FFC107;
    --rating-bg: #FFF8E1;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.15);
    --shadow-card: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-button: 0 4px 14px rgba(255,90,0,0.35);
    
    /* Border Radius */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 50%;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    
    /* Typography */
    --font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
    --font-size-xs: 11px;
    --font-size-sm: 13px;
    --font-size-base: 15px;
    --font-size-lg: 17px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 30px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
    --transition-bounce: 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Layout */
    --header-height: 60px;
    --bottom-nav-height: 70px;
    --container-max: 480px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

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

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

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--gray-100);
    direction: rtl;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom) + 20px);
    overflow-x: hidden;
}

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

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

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    border: none;
    outline: none;
    background: none;
}

ul, ol {
    list-style: none;
}

/* ============================================
   Utility Classes
   ============================================ */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); }

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

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ============================================
   App Header - Modern Design
   ============================================ */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--white);
    padding: var(--space-md);
    padding-top: calc(env(safe-area-inset-top, 0px) + var(--space-md));
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 22px;
    box-shadow: var(--shadow-button);
}

.logo-text {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
}

.logo-text span {
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.header-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 18px;
    position: relative;
    transition: var(--transition-fast);
}

.header-btn:active {
    transform: scale(0.95);
    background: var(--gray-200);
}

.header-btn .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    background: var(--primary);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid var(--white);
}

/* Search Bar - Modern */
.search-container {
    position: relative;
}

.search-bar {
    width: 100%;
    height: 50px;
    background: var(--gray-100);
    border-radius: var(--radius-xl);
    padding: 0 var(--space-md);
    padding-right: 50px;
    font-size: var(--font-size-base);
    color: var(--text-primary);
    border: 2px solid transparent;
    transition: var(--transition-fast);
}

.search-bar::placeholder {
    color: var(--text-muted);
}

.search-bar:focus {
    background: var(--white);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 90, 0, 0.1);
}

.search-icon {
    position: absolute;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
    pointer-events: none;
}

/* Header spacer */
.header-spacer {
    height: calc(var(--header-height) + 80px);
}

/* ============================================
   Bottom Navigation - App Style
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--white);
    padding: var(--space-sm) 0;
    padding-bottom: calc(var(--safe-area-bottom) + var(--space-sm));
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
}

.bottom-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: var(--container-max);
    margin: 0 auto;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--space-sm) var(--space-md);
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    font-weight: 600;
    transition: var(--transition-fast);
    position: relative;
    border-radius: var(--radius-md);
}

.nav-item i {
    font-size: 22px;
    transition: var(--transition-bounce);
}

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

.nav-item.active i {
    transform: scale(1.1);
}

.nav-item:active {
    background: var(--gray-100);
}

/* Cart nav item special */
.nav-item.cart-nav {
    position: relative;
}

.nav-item .cart-badge {
    position: absolute;
    top: 0;
    right: 50%;
    transform: translateX(12px);
    min-width: 18px;
    height: 18px;
    background: var(--primary);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ============================================
   Hero Section - Promotional Banner
   ============================================ */
.hero-section {
    padding: var(--space-md);
    padding-top: 0;
}

.promo-slider {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
}

.promo-slide {
    background: var(--primary-gradient);
    padding: var(--space-xl);
    border-radius: var(--radius-xl);
    color: var(--white);
    position: relative;
    overflow: hidden;
    min-height: 160px;
}

.promo-slide::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-full);
}

.promo-slide::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -20%;
    width: 150px;
    height: 150px;
    background: rgba(255,255,255,0.08);
    border-radius: var(--radius-full);
}

.promo-content {
    position: relative;
    z-index: 1;
}

.promo-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    margin-bottom: var(--space-sm);
    backdrop-filter: blur(10px);
}

.promo-title {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    margin-bottom: var(--space-xs);
    line-height: 1.3;
}

.promo-subtitle {
    font-size: var(--font-size-sm);
    opacity: 0.9;
    margin-bottom: var(--space-md);
}

.promo-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--white);
    color: var(--primary);
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 700;
    transition: var(--transition-fast);
}

.promo-btn:active {
    transform: scale(0.98);
}

/* Slider dots */
.slider-dots {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--gray-300);
    transition: var(--transition-fast);
}

.slider-dot.active {
    width: 24px;
    background: var(--primary);
}

/* ============================================
   Section Headers
   ============================================ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    padding: 0 var(--space-md);
}

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

.section-link {
    font-size: var(--font-size-sm);
    color: var(--primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.section-link i {
    font-size: 12px;
    transition: var(--transition-fast);
}

.section-link:hover i {
    transform: translateX(-4px);
}

/* ============================================
   Otlobly Service Section
   ============================================ */
.otlobly-section {
    padding: 0 var(--space-md) var(--space-md);
}

.otlobly-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #FF5A00 0%, #FF8A00 100%);
    border-radius: var(--radius-xl);
    padding: 20px;
    text-decoration: none;
    color: white;
    box-shadow: 0 8px 25px rgba(255, 90, 0, 0.35);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.otlobly-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    pointer-events: none;
}

.otlobly-card:active {
    transform: scale(0.98);
}

.otlobly-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.otlobly-icon i {
    font-size: 26px;
    color: white;
}

.otlobly-content {
    flex: 1;
}

.otlobly-content h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.otlobly-content p {
    font-size: 13px;
    opacity: 0.9;
}

.otlobly-arrow {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.otlobly-arrow i {
    font-size: 14px;
}

/* ============================================
   Categories - Circular Style (Like Talabat)
   ============================================ */
.categories-section {
    padding: var(--space-md) 0;
}

.categories-scroll {
    display: flex;
    gap: var(--space-md);
    overflow-x: auto;
    padding: var(--space-sm) var(--space-md);
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.categories-scroll::-webkit-scrollbar {
    display: none;
}

.category-item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    scroll-snap-align: start;
    text-align: center;
    min-width: 75px;
}

.category-icon {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-full);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: var(--transition-bounce);
    border: 3px solid transparent;
}

.category-item:active .category-icon {
    transform: scale(0.95);
    border-color: var(--primary);
}

.category-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-icon i {
    font-size: 28px;
    color: var(--primary);
}

.category-name {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-primary);
    max-width: 75px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   Store Cards - Modern Design
   ============================================ */
.stores-section {
    padding: var(--space-md);
}

.stores-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

.store-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: var(--transition-normal);
    display: block;
}

.store-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-lg);
}

.store-card.closed {
    opacity: 0.7;
}

.store-image {
    position: relative;
    height: 140px;
    background: var(--gray-100);
    overflow: hidden;
}

.store-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

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

/* Store badges */
.store-badges {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.store-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 700;
    backdrop-filter: blur(10px);
}

.store-badge.open {
    background: rgba(0, 200, 83, 0.9);
    color: var(--white);
}

.store-badge.closed {
    background: rgba(255, 59, 48, 0.9);
    color: var(--white);
}

.store-badge.promo {
    background: var(--primary);
    color: var(--white);
}

/* Rating badge */
.store-rating {
    position: absolute;
    bottom: var(--space-sm);
    left: var(--space-sm);
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--white);
    padding: 5px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 700;
    box-shadow: var(--shadow-md);
}

.store-rating i {
    color: var(--rating-star);
}

/* Store info */
.store-info {
    padding: var(--space-md);
}

.store-name {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.store-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.store-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.store-meta-item i {
    font-size: 14px;
    color: var(--text-muted);
}

.store-category {
    color: var(--primary);
    font-weight: 500;
}

/* Closed overlay */
.store-card.closed .store-image::after {
    content: 'مغلق الآن';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: var(--font-size-lg);
}

/* ============================================
   Store Page - Header & Details
   ============================================ */
.store-header {
    position: relative;
    background: var(--white);
    margin-bottom: var(--space-md);
}

.store-cover {
    height: 200px;
    background: var(--gray-200);
    position: relative;
    overflow: hidden;
}

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

.store-cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.5) 100%);
}

.back-btn {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    top: calc(env(safe-area-inset-top, 0px) + var(--space-md));
    width: 40px;
    height: 40px;
    background: var(--white);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
    font-size: 18px;
    z-index: 10;
}

.store-actions-header {
    position: absolute;
    top: calc(env(safe-area-inset-top, 0px) + var(--space-md));
    left: var(--space-md);
    display: flex;
    gap: var(--space-sm);
}

.store-action-btn {
    width: 40px;
    height: 40px;
    background: var(--white);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
    font-size: 18px;
}

.store-details {
    padding: var(--space-md);
    margin-top: -40px;
    position: relative;
}

.store-logo-large {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 4px solid var(--white);
    margin-bottom: var(--space-md);
}

.store-logo-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.store-title-section {
    margin-bottom: var(--space-md);
}

.store-title {
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.store-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* Store stats */
.store-stats {
    display: flex;
    gap: var(--space-lg);
    padding: var(--space-md);
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
}

.store-stat {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.store-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.store-stat-icon.rating {
    background: var(--rating-bg);
    color: var(--rating-star);
}

.store-stat-icon.delivery {
    background: rgba(0, 200, 83, 0.1);
    color: var(--secondary);
}

.store-stat-icon.time {
    background: rgba(0, 122, 255, 0.1);
    color: var(--info);
}

.store-stat-info {
    display: flex;
    flex-direction: column;
}

.store-stat-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
}

.store-stat-label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* ============================================
   Product Categories Tabs
   ============================================ */
.product-tabs {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
}

.tabs-scroll {
    display: flex;
    overflow-x: auto;
    padding: var(--space-sm) var(--space-md);
    gap: var(--space-sm);
    scrollbar-width: none;
}

.tabs-scroll::-webkit-scrollbar {
    display: none;
}

.tab-item {
    flex: 0 0 auto;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--gray-100);
    transition: var(--transition-fast);
    white-space: nowrap;
}

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

/* ============================================
   Product Cards - Modern Style
   ============================================ */
.products-section {
    padding: var(--space-md);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.product-card:active {
    transform: scale(0.98);
}

.product-image {
    position: relative;
    height: 120px;
    background: var(--gray-100);
    overflow: hidden;
}

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

.product-discount {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    background: var(--danger);
    color: var(--white);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 700;
}

.product-info {
    padding: var(--space-sm);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.product-desc {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.product-price {
    font-size: var(--font-size-lg);
    font-weight: 800;
    color: var(--primary);
}

.product-price .currency {
    font-size: var(--font-size-xs);
    font-weight: 600;
}

.product-price-old {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-decoration: line-through;
}

.add-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition-bounce);
    box-shadow: var(--shadow-button);
    cursor: pointer;
}

.add-btn:active {
    transform: scale(0.9);
}

/* Product List View */
.product-list-item {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    display: flex;
    gap: var(--space-md);
    box-shadow: var(--shadow-card);
    margin-bottom: var(--space-md);
}

.product-list-item .product-image {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.product-list-item .product-info {
    flex: 1;
    padding: 0;
}

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

.cart-header {
    background: var(--white);
    padding: var(--space-md);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.cart-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    text-align: center;
}

.cart-items {
    padding: var(--space-md);
}

.cart-item {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    box-shadow: var(--shadow-card);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    background: var(--gray-100);
    overflow: hidden;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.cart-item-name {
    font-size: var(--font-size-base);
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.cart-item-store {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

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

.cart-item-price {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--primary);
}

/* Quantity controls */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--gray-100);
    border-radius: var(--radius-full);
    padding: 4px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
    cursor: pointer;
}

.qty-btn:active {
    transform: scale(0.95);
}

.qty-btn.minus {
    color: var(--danger);
}

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

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

/* Cart Summary */
.cart-summary {
    position: relative;
    background: var(--white);
    padding: var(--space-md);
    margin: var(--space-md);
    margin-bottom: calc(var(--bottom-nav-height) + var(--space-lg) + var(--safe-area-bottom));
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    border-radius: var(--radius-2xl);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.summary-row.total {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
    padding-top: var(--space-sm);
    border-top: 1px dashed var(--gray-300);
    margin-top: var(--space-sm);
}

.checkout-btn {
    width: 100%;
    height: 54px;
    background: var(--primary-gradient);
    color: var(--white);
    border-radius: var(--radius-xl);
    font-size: var(--font-size-lg);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    box-shadow: var(--shadow-button);
    transition: var(--transition-fast);
    cursor: pointer;
}

.checkout-btn:active {
    transform: scale(0.98);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    font-weight: 600;
    transition: var(--transition-fast);
    cursor: pointer;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--white);
    box-shadow: var(--shadow-button);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--text-primary);
}

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

.btn-block {
    width: 100%;
}

.btn-lg {
    height: 54px;
    font-size: var(--font-size-lg);
    border-radius: var(--radius-xl);
}

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.form-input {
    width: 100%;
    height: 52px;
    background: var(--gray-100);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    padding: 0 var(--space-md);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.form-input:focus {
    background: var(--white);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 90, 0, 0.1);
}

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

.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper .form-input {
    padding-right: 50px;
}

.input-icon-wrapper .input-icon {
    position: absolute;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 20px;
}

/* ============================================
   Rating Component
   ============================================ */
.rating-display {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rating-display .star {
    color: var(--gray-300);
    font-size: 16px;
}

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

.rating-display .star.half {
    position: relative;
}

.rating-display .star.half::before {
    content: '\f005';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    color: var(--rating-star);
    width: 50%;
    overflow: hidden;
}

/* Rating Input */
.rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: var(--space-sm);
}

.rating-input input {
    display: none;
}

.rating-input label {
    font-size: 32px;
    color: var(--gray-300);
    cursor: pointer;
    transition: var(--transition-fast);
}

.rating-input label:hover,
.rating-input label:hover ~ label,
.rating-input input:checked ~ label {
    color: var(--rating-star);
}

/* Rating Card */
.rating-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--shadow-card);
}

.rating-summary {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: var(--space-md);
}

.rating-big {
    text-align: center;
}

.rating-number {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    color: var(--text-primary);
}

.rating-bars {
    flex: 1;
}

.rating-bar-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: 4px;
}

.rating-bar-row .star-num {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    width: 15px;
}

.rating-bar-row .bar {
    flex: 1;
    height: 6px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.rating-bar-row .bar-fill {
    height: 100%;
    background: var(--rating-star);
    border-radius: var(--radius-full);
}

/* Review item */
.review-item {
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.review-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.review-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
}

.review-info {
    flex: 1;
}

.review-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.review-date {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.review-rating {
    display: flex;
    gap: 2px;
}

.review-rating i {
    font-size: 12px;
    color: var(--rating-star);
}

.review-text {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================
   Empty States
   ============================================ */
.empty-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-md);
}

.empty-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--space-lg);
    background: var(--gray-100);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-icon i {
    font-size: 48px;
    color: var(--gray-400);
}

.empty-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.empty-text {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

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

.auth-header {
    text-align: center;
    margin-bottom: var(--space-xl);
    padding-top: var(--space-xl);
}

.auth-logo {
    width: 100px;
    height: 100px;
    background: var(--primary-gradient);
    border-radius: var(--radius-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
    box-shadow: var(--shadow-button);
}

.auth-logo i {
    font-size: 48px;
    color: var(--white);
}

.auth-title {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.auth-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.auth-form {
    flex: 1;
}

.auth-footer {
    text-align: center;
    padding-top: var(--space-lg);
}

.auth-footer-text {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.auth-footer-text a {
    color: var(--primary);
    font-weight: 600;
}

/* Social Login */
.social-divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-lg) 0;
}

.social-divider::before,
.social-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-300);
}

.social-divider span {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.social-buttons {
    display: flex;
    gap: var(--space-md);
}

.social-btn {
    flex: 1;
    height: 52px;
    border-radius: var(--radius-lg);
    border: 2px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.social-btn:active {
    background: var(--gray-100);
}

.social-btn.google i { color: #DB4437; }
.social-btn.facebook i { color: #4267B2; }
.social-btn.apple i { color: var(--black); }

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + var(--space-md));
    left: var(--space-md);
    right: var(--space-md);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
}

.toast {
    background: var(--text-primary);
    color: var(--white);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    box-shadow: var(--shadow-xl);
    animation: slideIn 0.3s ease;
    pointer-events: all;
}

.toast.success { background: var(--secondary); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); color: var(--text-primary); }

.toast-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    margin-bottom: 2px;
}

.toast-message {
    font-size: var(--font-size-sm);
    opacity: 0.9;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Loading States
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

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

/* Page loader */
.page-loader {
    position: fixed;
    inset: 0;
    background: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.page-loader .logo {
    width: 80px;
    height: 80px;
    background: var(--primary-gradient);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-lg);
    animation: pulse 1s ease infinite;
}

.page-loader .logo i {
    font-size: 40px;
    color: var(--white);
}

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

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

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

.modal-content {
    background: var(--white);
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: var(--transition-normal);
    padding: var(--space-md);
    padding-bottom: calc(80px + var(--safe-area-bottom) + var(--space-lg));
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    background: var(--white);
}

.modal-handle {
    width: 40px;
    height: 4px;
    background: var(--gray-300);
    border-radius: var(--radius-full);
    margin: 0 auto var(--space-md);
}

.modal-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
}

.modal-body {
    padding: var(--space-md);
}

/* ============================================
   Animations
   ============================================ */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.3s ease;
}

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

.bounce {
    animation: bounce 0.5s ease;
}

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

/* Stagger children animation */
.stagger-children > * {
    opacity: 0;
    animation: slideUp 0.4s ease forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.4s; }

/* ============================================
   Order Status
   ============================================ */
.order-status-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: var(--space-lg) 0;
}

.order-status-steps::before {
    content: '';
    position: absolute;
    top: calc(var(--space-lg) + 20px);
    left: 10%;
    right: 10%;
    height: 3px;
    background: var(--gray-200);
}

.status-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    position: relative;
    z-index: 1;
}

.status-step-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 18px;
}

.status-step.completed .status-step-icon {
    background: var(--secondary);
    color: var(--white);
}

.status-step.active .status-step-icon {
    background: var(--primary);
    color: var(--white);
    animation: pulse 1.5s ease infinite;
}

.status-step-label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-align: center;
}

.status-step.completed .status-step-label,
.status-step.active .status-step-label {
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (min-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stores-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .stores-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-item {
        min-width: 90px;
    }
    
    .category-icon {
        width: 80px;
        height: 80px;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .app-header,
    .bottom-nav,
    .cart-summary {
        display: none;
    }
    
    body {
        padding: 0;
        background: white;
    }
}
