/**
 * SimpleMesaClick - Frontend Styles
 * Mobile-first responsive design
 */

:root {
    --smc-primary: #8B4513;
    --smc-primary-light: #A0522D;
    --smc-secondary: #D2691E;
    --smc-accent: #DAA520;
    --smc-success: #228B22;
    --smc-warning: #FF8C00;
    --smc-error: #DC143C;
    --smc-neutral-50: #FAF6F1;
    --smc-neutral-100: #F5F0E8;
    --smc-neutral-200: #E8E0D4;
    --smc-neutral-900: #2C1810;
    --smc-header-text: #ffffff;
    --smc-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --smc-shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
    --smc-radius: 12px;
    --smc-radius-sm: 8px;
}

.smc-menu-container {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--smc-neutral-50);
    min-height: 100vh;
    padding-bottom: 40px;
    color: var(--smc-neutral-900);
    line-height: 1.5;
}

.smc-menu-container * { box-sizing: border-box; }

/* Error */
.smc-error-container { text-align: center; padding: 60px 20px; }
.smc-error-icon .dashicons { font-size: 64px; width: 64px; height: 64px; color: var(--smc-warning); }
.smc-error-container h2 { margin: 20px 0 10px; color: var(--smc-neutral-900); }
.smc-error-container p { color: #666; }

/* Header */
.smc-menu-header {
    background: linear-gradient(135deg, var(--smc-primary) 0%, var(--smc-primary-light) 100%);
    color: var(--smc-header-text);
    padding: 20px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--smc-shadow);
}

.smc-header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.smc-menu-header h1.smc-restaurant-name,
.smc-menu-header .smc-restaurant-name {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: var(--smc-header-text) !important;
}

.smc-menu-header,
.smc-menu-header .smc-header-content,
.smc-menu-header .smc-header-right,
.smc-menu-header .smc-mesa-badge {
    color: var(--smc-header-text) !important;
}

.smc-mesa-badge {
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.smc-mesa-badge .dashicons { font-size: 16px; width: 16px; height: 16px; }

/* Categories */
.smc-categories-nav {
    background: white;
    padding: 12px 0;
    position: sticky;
    top: 68px;
    z-index: 90;
    box-shadow: var(--smc-shadow);
    position: relative;
}

.smc-categories-scroll {
    display: flex;
    gap: 10px;
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

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

.smc-scroll-indicator {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 60px;
    background: linear-gradient(to right, transparent, white 70%);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.3s;
}

.smc-scroll-indicator.hidden { opacity: 0; }

.smc-scroll-arrow {
    width: 28px;
    height: 28px;
    background: var(--smc-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    animation: smcSwipe 1.5s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.4);
}

@keyframes smcSwipe {
    0%, 100% { transform: translateX(0); opacity: 1; }
    50% { transform: translateX(5px); opacity: 0.7; }
}

.smc-category-tab {
    flex-shrink: 0;
    padding: 10px 20px;
    border: 2px solid var(--smc-neutral-200);
    border-radius: 25px;
    background: white;
    color: var(--smc-neutral-900);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

/* Search */
.smc-search-bar {
    max-width: 1200px;
    margin: 16px auto;
    padding: 0 16px;
    position: relative;
}

.smc-search-bar input {
    width: 100%;
    padding: 14px 16px 14px 45px;
    border: 2px solid var(--smc-neutral-200);
    border-radius: var(--smc-radius);
    font-size: 16px;
    background: white;
    transition: border-color 0.2s;
}

.smc-search-bar input:focus { outline: none; border-color: var(--smc-primary); }

.smc-search-bar .dashicons {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

/* Menu Grid */
.smc-menu-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* Loading */
.smc-loading { grid-column: 1 / -1; text-align: center; padding: 60px 20px; }

.smc-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--smc-neutral-200);
    border-top-color: var(--smc-primary);
    border-radius: 50%;
    animation: smcSpin 0.8s linear infinite;
    margin: 0 auto 15px;
}

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

/* Dish Card */
.smc-dish-card {
    position: relative;
    background: white;
    border-radius: var(--smc-radius);
    overflow: hidden;
    box-shadow: var(--smc-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

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

.smc-dish-image { position: relative; height: 180px; overflow: hidden; }
.smc-dish-image img { width: 100%; height: 100%; object-fit: cover; }

.smc-dish-content { padding: 16px; }

.smc-dish-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--smc-neutral-900);
}

.smc-dish-description {
    font-size: 14px;
    color: #666;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.smc-dish-allergens { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

.smc-allergen {
    background: var(--smc-neutral-100);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    color: #666;
    text-transform: capitalize;
}

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

.smc-dish-price { font-size: 1.25rem; font-weight: 700; color: var(--smc-primary); }

.smc-no-results { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: #666; }

/* Offer Badge & Special Price */
.smc-dish-card.has-offer { border: 2px solid var(--smc-error); }

.smc-offer-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--smc-error);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    z-index: 10;
    animation: smcPulse 1.5s infinite;
}

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

.smc-price-container { display: flex; flex-direction: column; gap: 4px; }
.smc-price-old { font-size: 14px; color: #999; text-decoration: line-through; }
.smc-price-offer { font-size: 1.25rem; font-weight: 700; color: var(--smc-error); }

.smc-has-extras {
    font-size: 11px;
    color: var(--smc-primary);
    background: var(--smc-neutral-100);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Labels & Tags */
.smc-dish-labels {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 10;
}

.smc-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.smc-spicy { font-size: 14px; margin-left: 4px; }

/* View Details Button */
.smc-view-details {
    width: 100%;
    padding: 10px;
    background: var(--smc-neutral-100);
    border: none;
    color: var(--smc-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.smc-view-details:hover { background: var(--smc-primary); color: white; }

/* Modal */
.smc-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s 0.3s, opacity 0.3s;
}

.smc-modal.active { visibility: visible; opacity: 1; transition: visibility 0s, opacity 0.3s; }

.smc-modal-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); }

.smc-modal-content {
    position: relative;
    background: white;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    border-radius: var(--smc-radius) var(--smc-radius) 0 0;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

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

/* Product Detail Modal */
.smc-product-detail {
    max-width: 450px;
    max-height: 95vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.smc-product-detail .smc-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 100;
    background: rgba(255,255,255,0.9);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.smc-modal-image { width: 100%; height: 200px; overflow: hidden; }
.smc-modal-image img { width: 100%; height: 100%; object-fit: cover; }

.smc-product-detail .smc-modal-body { flex: 1; overflow-y: auto; padding: 20px; }

.smc-product-detail h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.5rem;
    margin: 0 0 10px;
    color: var(--smc-neutral-900);
}

.smc-portion { font-size: 13px; color: #666; margin: 0 0 10px; }
.smc-modal-desc { color: #666; margin: 0 0 15px; line-height: 1.6; }

/* Modal Labels */
.smc-modal-labels { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; }

.smc-label-full {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: white;
    font-weight: 500;
}

/* Modal Allergens */
.smc-modal-allergens {
    margin-bottom: 15px;
    padding: 12px;
    background: #fff3cd;
    border-radius: var(--smc-radius-sm);
}

.smc-modal-allergens h4 { margin: 0 0 10px; font-size: 14px; }

.smc-allergen-list { display: flex; flex-wrap: wrap; gap: 8px; }

.smc-allergen-item {
    font-size: 12px;
    background: white;
    padding: 4px 10px;
    border-radius: 15px;
    text-transform: capitalize;
}

/* Nutrition */
.smc-nutrition-info {
    margin-bottom: 15px;
    padding: 15px;
    background: var(--smc-neutral-100);
    border-radius: var(--smc-radius-sm);
}

.smc-nutrition-info h4 { margin: 0 0 12px; font-size: 14px; }

.smc-nutrition-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    text-align: center;
}

.smc-nutrition-grid div { padding: 8px; background: white; border-radius: 8px; }
.smc-nutrition-grid strong { display: block; font-size: 16px; color: var(--smc-primary); }
.smc-nutrition-grid span { font-size: 10px; color: #666; text-transform: uppercase; }

/* Modal Extras */
.smc-modal-extras {
    margin-bottom: 15px;
    padding: 15px;
    background: #e8f5e9;
    border-radius: var(--smc-radius-sm);
}

.smc-modal-extras h4 { margin: 0 0 12px; font-size: 14px; }

.smc-extras-list { display: flex; flex-direction: column; gap: 8px; }

.smc-extra-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: white;
    border-radius: 8px;
}

.smc-extra-name { flex: 1; font-size: 14px; }
.smc-extra-price { font-weight: 600; color: var(--smc-success); }

/* Modal Price */
.smc-modal-price-container {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 15px 0 0;
    border-top: 1px solid var(--smc-neutral-200);
}

.smc-modal-price-old { font-size: 16px; color: #999; text-decoration: line-through; }
.smc-modal-price { font-size: 24px; font-weight: 700; color: var(--smc-primary); }

/* Desktop */
@media (min-width: 768px) {
    .smc-menu-header { padding: 24px 20px; }
    .smc-restaurant-name { font-size: 2rem; }
    .smc-categories-nav { top: 84px; }

    .smc-modal-content {
        border-radius: var(--smc-radius);
        margin: auto;
        max-height: 80vh;
    }

    .smc-product-detail { max-height: 85vh; }
    .smc-modal-image { height: 250px; }
}

@media (max-width: 480px) {
    .smc-header-content { flex-direction: column; gap: 8px; text-align: center; }
}

/* Language Selector */
@font-face {
    font-family: "Twemoji Country Flags";
    unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E007F;
    src: url('https://cdn.jsdelivr.net/npm/country-flag-emoji-polyfill@0.1/dist/TwemojiCountryFlags.woff2') format('woff2');
    font-display: swap;
}

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

.smc-lang-selector {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 20px;
    padding: 3px;
}

.smc-lang-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background 0.2s, transform 0.2s;
    line-height: 0;
    opacity: 0.7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.smc-lang-btn img {
    display: block;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.smc-lang-btn:hover {
    background: rgba(255,255,255,0.25);
    opacity: 1;
}

.smc-lang-btn.active {
    background: rgba(255,255,255,0.35);
    opacity: 1;
    transform: scale(1.1);
}
