/* ============================
   D'Volada Mobile App Styles
   Inspired by Starbucks Design
   ============================ */

/* Variables */
:root {
    --primary-color: #00704A;
    --primary-dark: #005235;
    --primary-light: #1E7E5F;
    --accent-color: #D4E9E2;
    --text-primary: #1F3933;
    --text-secondary: #666666;
    --background: #F7F7F7;
    --card-background: #FFFFFF;
    --border-color: #E0E0E0;
    --success-color: #00A862;
    --warning-color: #FBB040;
    --danger-color: #E75B52;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.16);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* Typography */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior: contain;
}

/* Prevent horizontal scroll */
html, body {
    overflow-x: hidden;
    width: 100%;
}

/* Home Screen - Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    padding: 32px 20px 24px;
    text-align: center;
    margin-bottom: 24px;
}

.hero-welcome {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.hero-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 24px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    display: block;
}

.stat-label {
    font-size: 12px;
    opacity: 0.9;
}

/* Quick Actions Grid */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 0 20px;
    margin-bottom: 32px;
}

.action-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-primary);
}

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

.action-card i {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.action-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.action-card p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

/* Section Headers */
.section-header {
    padding: 0 20px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.section-link {
    font-size: 14px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

/* Product Cards - Horizontal Scroll */
.products-scroll {
    padding: 0 20px;
    margin-bottom: 32px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

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

.products-container {
    display: flex;
    gap: 16px;
    padding-bottom: 8px;
}

.product-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    overflow: hidden;
    min-width: 160px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-primary);
}

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

.product-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background-color: var(--accent-color);
}

.product-info {
    padding: 12px;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
}

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

/* Menu Page - Category Pills */
.category-pills {
    display: flex;
    gap: 12px;
    padding: 0 20px 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-pills::-webkit-scrollbar {
    display: none;
}

.category-pill {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    transition: var(--transition);
}

.category-pill.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

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

.product-card-full {
    background: var(--card-background);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

/* Search Bar */
.search-container {
    padding: 20px;
    background: var(--card-background);
    margin-bottom: 20px;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--background);
    border-radius: 24px;
    padding: 12px 20px;
}

.search-bar i {
    color: var(--text-secondary);
    margin-right: 12px;
}

.search-bar input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 16px;
    color: var(--text-primary);
}

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

/* Add to Cart Button */
.btn-add-cart {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 24px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    width: 100%;
    transition: var(--transition);
}

.btn-add-cart:active {
    background: var(--primary-dark);
    transform: scale(0.98);
}

/* Product Detail Modal */
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 2000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

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

.modal-header {
    position: sticky;
    top: 0;
    background: white;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.modal-close {
    font-size: 24px;
    color: var(--text-primary);
    background: none;
    border: none;
    padding: 0;
}

/* Size Selection */
.size-options {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.size-option {
    flex: 1;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.size-option.selected {
    border-color: var(--primary-color);
    background: var(--accent-color);
}

.size-name {
    font-size: 14px;
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.size-price {
    font-size: 16px;
    color: var(--primary-color);
    font-weight: 700;
}

/* Addons Section */
.addons-section {
    margin-bottom: 24px;
}

.addon-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--background);
    border-radius: var(--border-radius);
    margin-bottom: 12px;
}

.addon-info {
    flex: 1;
}

.addon-name {
    font-size: 14px;
    font-weight: 500;
    display: block;
}

.addon-price {
    font-size: 12px;
    color: var(--text-secondary);
}

.addon-checkbox {
    width: 24px;
    height: 24px;
    accent-color: var(--primary-color);
}

/* Floating Cart Button */
.floating-cart {
    position: fixed;
    bottom: 180px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: 9996;
    transition: var(--transition);
}

.floating-cart:active {
    transform: scale(0.95);
}

.floating-cart .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s ease infinite;
}

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

/* Responsive Adjustments */
@media (max-width: 375px) {
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #1A1A1A;
        --card-background: #2D2D2D;
        --text-primary: #FFFFFF;
        --text-secondary: #AAAAAA;
        --border-color: #404040;
    }
}