:root {
    --primary: #e63946;
    --primary-hover: #d62828;
    --secondary: #f77f00;
    --whatsapp: #25d366;
    --whatsapp-hover: #128c7e;
    --background: #f8f9fa;
    --surface: #ffffff;
    --text-main: #2b2d42;
    --text-muted: #6c757d;
    --border: #e9ecef;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--background);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Header */
header {
    background: var(--surface);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-top {
    height: 40px;
    flex-shrink: 0;
}

.search-container {
    flex-grow: 1;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-bar {
    width: 100%;
    padding: 12px 20px 12px 40px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--background);
    outline: none;
    font-size: 15px;
    transition: all 0.2s;
}

.search-bar:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Banner */
.invitation-banner {
    background: linear-gradient(135deg, #ffede1 0%, #fff7f0 100%);
    padding: 16px 20px;
    text-align: center;
    border-bottom: 2px solid var(--secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.invitation-banner span {
    font-size: 14px;
    color: #b75e00;
}

.btn-unite {
    background: var(--primary);
    color: white;
    padding: 8px 20px;
    border-radius: var(--radius-full);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
    box-shadow: var(--shadow-sm);
}

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

/* Main Content */
.main-content {
    padding: 30px 20px;
    max-width: 800px;
    margin: auto;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-main);
}

.stores-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.local-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.local-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.local-img-container {
    height: 140px;
    position: relative;
    background: #eee;
}

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

.local-category {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.9);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}

.local-info {
    padding: 15px;
}

.local-info strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.local-info small {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.no-results {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 0;
    grid-column: 1 / -1;
}

/* Modal de Menú */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--surface);
    z-index: 1000;
    overflow-y: auto;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
}

.modal.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.modal-header-bg {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.modal-header-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.btn-close-menu {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-close-menu:hover {
    background: rgba(255,255,255,0.4);
}

.menu-items-container {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 100px; /* Space for cart bar */
}

.menu-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

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

.menu-item-info {
    flex-grow: 1;
}

.menu-item-info strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.menu-item-info small {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.menu-item-info .price {
    font-weight: 600;
    color: var(--text-main);
}

.btn-add {
    background: var(--background);
    border: 1px solid var(--border);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

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

/* Cart Floating Bar */
.cart-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 400px;
    background: var(--primary);
    color: white;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: 1010;
    transition: transform 0.2s;
}

.cart-bar:hover {
    transform: translate(-50%, -2px);
}

.cart-summary {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-count {
    background: rgba(255,255,255,0.2);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
}

.cart-total {
    font-weight: 700;
    font-size: 1.1rem;
}

.cart-action {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Cart Preview Modal */
.cart-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    backdrop-filter: blur(2px);
}

.cart-preview-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 85vh;
    background: var(--surface);
    z-index: 2010;
    border-radius: 24px 24px 0 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 25px rgba(0,0,0,0.1);
    animation: slideUp 0.3s ease-out;
}

@media (min-width: 600px) {
    .cart-preview-modal {
        bottom: 50%;
        left: 50%;
        transform: translate(-50%, 50%);
        width: 100%;
        max-width: 450px;
        border-radius: var(--radius-lg);
        animation: popIn 0.3s ease-out;
    }
}

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

.btn-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
}

.cart-preview-body {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.cart-preview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed var(--border);
}

.cart-preview-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-preview-info .qty {
    color: var(--primary);
    font-weight: 700;
    background: rgba(230, 57, 70, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.cart-preview-price {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-remove {
    background: var(--border);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove:hover {
    background: #ffcdd2;
    color: var(--primary);
}

.cart-preview-footer {
    padding: 20px;
    background: var(--background);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

@media (max-width: 599px) {
    .cart-preview-footer {
        border-radius: 0;
    }
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.btn-checkout {
    width: 100%;
    background: var(--whatsapp);
    color: white;
    border: none;
    padding: 14px;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-checkout:hover {
    background: var(--whatsapp-hover);
}

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translate(-50%, -20px);
    background: var(--text-main);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 3000;
    box-shadow: var(--shadow-md);
    white-space: nowrap;
}

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

/* WhatsApp Flotante */
.wa-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 900;
    transition: transform 0.3s;
    background: var(--whatsapp);
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.wa-float img {
    width: 32px;
    height: 32px;
    filter: brightness(0) invert(1);
}

.wa-float:hover {
    transform: scale(1.1);
    background: var(--whatsapp-hover);
}

/* Footer */
.trust-footer {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    padding: 40px 20px;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.trust-footer p {
    margin-bottom: 8px;
}

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

@keyframes popIn {
    from { opacity: 0; transform: translate(-50%, 40%) scale(0.95); }
    to { opacity: 1; transform: translate(-50%, 50%) scale(1); }
}

@media (min-width: 768px) {
    .invitation-banner {
        flex-direction: row;
        justify-content: center;
    }
    .invitation-banner .btn-unite {
        margin-top: 0;
    }
}
