/**
 * RESERVA 58 - Stylesheet Principal
 * ==================================
 * Mobile-first, sofisticado, rápido
 */

/* ===== CSS Variables ===== */
:root {
    /* Cores da marca */
    --burgundy: #722F37;
    --burgundy-dark: #4A1C23;
    --burgundy-light: #8B3A44;
    --rose: #B4546A;
    --rose-light: #F5E6E8;
    --cream: #FAF7F5;
    --gold: #C9A962;
    --gold-light: #E8DCC8;
    
    /* Cores neutras */
    --text-dark: #2D2D2D;
    --text-medium: #5A5A5A;
    --text-light: #8A8A8A;
    --white: #FFFFFF;
    --border: rgba(114, 47, 55, 0.12);
    
    /* Status */
    --success: #2E7D32;
    --warning: #F9A825;
    --error: #C62828;
    
    /* Sombras */
    --shadow-xs: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-sm: 0 2px 8px rgba(114, 47, 55, 0.08);
    --shadow-md: 0 4px 16px rgba(114, 47, 55, 0.12);
    --shadow-lg: 0 8px 32px rgba(114, 47, 55, 0.16);
    --shadow-xl: 0 16px 48px rgba(114, 47, 55, 0.20);
    
    /* Bordas */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Transições */
    --transition-fast: 150ms ease;
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Espaçamento base */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    
    /* Header height */
    --header-height: 60px;
    --bottom-nav-height: 70px;
}

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

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

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--cream);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Typography ===== */
.font-display {
    font-family: 'Cormorant Garamond', Georgia, serif;
}

h1, h2, h3, .heading {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    line-height: 1.2;
    color: var(--burgundy-dark);
}

h1 { font-size: clamp(1.75rem, 6vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 5vw, 2rem); }
h3 { font-size: clamp(1.25rem, 4vw, 1.5rem); }

p { margin-bottom: var(--space-md); }

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

a:hover { color: var(--rose); }

/* ===== Layout ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.page-content {
    padding-top: 0;
    padding-bottom: calc(var(--bottom-nav-height) + var(--space-xl));
    min-height: 100vh;
}

/* ===== Header ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.header.hidden {
    transform: translateY(-100%);
}

.header.scrolled {
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 var(--space-md);
    max-width: 1200px;
    margin: 0 auto;
}

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

.logo-img {
    height: 36px;
    width: auto;
}

.logo-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--burgundy);
}

.logo-text span {
    font-weight: 300;
    color: var(--rose);
}

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

.header-btn {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    color: var(--burgundy);
    cursor: pointer;
    transition: background var(--transition-fast);
}

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

.header-btn svg {
    width: 24px;
    height: 24px;
}

.cart-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--burgundy);
    color: var(--white);
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Location Bar ===== */
.location-bar {
    background: #fff; /* linear-gradient(135deg, var(--burgundy) 0%, var(--burgundy-dark) 100%);
    padding: var(--space-sm) var(--space-md);
    margin-top: var(--header-height);
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.location-bar:active {
    opacity: 0.9;
}

.location-inner {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    max-width: 1200px;
    margin: 0 auto;
    color: var(--white);
}

.location-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

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

.location-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.8;
}

.location-address {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.delivery-eta {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

/* ===== Search ===== */
.search-wrapper {
    padding: var(--space-md);
}

.search-box {
    position: relative;
}

.search-input {
    width: 100%;
    height: 52px;
    padding: 0 var(--space-md) 0 48px;
    background: var(--white);
    border: 2px solid transparent;
    border-radius: var(--radius-xl);
    font-family: inherit;
    font-size: 16px;
    color: var(--text-dark);
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--rose);
    box-shadow: var(--shadow-md);
}

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

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    color: var(--rose);
    pointer-events: none;
}

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

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

.category-pill {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--white);
    border: 1.5px solid var(--rose);
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 500;
    color: var(--burgundy);
    cursor: pointer;
    scroll-snap-align: start;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

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

.category-pill .emoji {
    font-size: 16px;
}

/* ===== Featured Banner ===== */
.featured-banner {
    margin: 0 var(--space-md) var(--space-lg);
    padding: var(--space-lg);
    background: #fff; /* linear-gradient(135deg, var(--burgundy) 0%, var(--burgundy-dark) 100%);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.featured-banner::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(201, 169, 98, 0.3) 0%, transparent 70%);
    border-radius: 50%;
}

.featured-content {
    position: relative;
    z-index: 1;
    color: var(--white);
}

.featured-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--gold);
    color: var(--burgundy-dark);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
    margin-bottom: var(--space-sm);
}

.featured-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--white);
    margin-bottom: var(--space-xs);
    line-height: 1.2;
}

.featured-desc {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: var(--space-md);
}

.featured-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 12px 24px;
    background: var(--white);
    color: var(--burgundy);
    font-weight: 500;
    font-size: 14px;
    border-radius: var(--radius-full);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.featured-btn:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
    color: var(--burgundy);
}

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

.section-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--burgundy-dark);
}

.see-all {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    color: var(--rose);
}

.see-all svg {
    width: 16px;
    height: 16px;
    transition: transform var(--transition-fast);
}

.see-all:hover svg {
    transform: translateX(3px);
}

/* ===== Products Grid ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    padding: 0 var(--space-md);
    margin-bottom: var(--space-xl);
}

.product-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

.product-image {
    position: relative;
    aspect-ratio: 1;
    background: #fff; /* linear-gradient(180deg, var(--rose-light) 0%, var(--cream) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.product-image img {
    max-height: 100%;
    max-width: 55%;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.12));
    transition: transform var(--transition-base);
}

.product-card:hover .product-image img {
    transform: scale(1.05) rotate(-2deg);
}

.product-badge {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    padding: 4px 10px;
    background: var(--burgundy);
    color: var(--white);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: var(--radius-full);
}

.product-badge.promo {
    background: var(--gold);
    color: var(--burgundy-dark);
}

.btn-favorite {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: none;
    border-radius: var(--radius-full);
    color: var(--rose);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-favorite:hover {
    transform: scale(1.1);
}

.btn-favorite.active {
    background: var(--burgundy);
    color: var(--white);
}

.btn-favorite svg {
    width: 18px;
    height: 18px;
}

.product-info {
    padding: var(--space-md);
}

.product-type {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--rose);
    margin-bottom: 2px;
}

.product-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-weight: 500;
    color: var(--burgundy-dark);
    line-height: 1.3;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-region {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: var(--space-sm);
}

.product-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.product-price {
    font-weight: 600;
    color: var(--burgundy);
    font-size: 1.1rem;
    line-height: 1.2;
}

.product-price .original {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-light);
    text-decoration: line-through;
}

.btn-add {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--burgundy);
    border: none;
    border-radius: var(--radius-full);
    color: var(--white);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-add:hover {
    background: var(--burgundy-dark);
    transform: scale(1.1);
}

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

.btn-add.added {
    background: var(--gold);
    animation: pulse-add 0.4s ease;
}

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

.btn-add svg {
    width: 20px;
    height: 20px;
}

/* ===== Bottom Navigation ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--white);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 1000;
}

.bottom-nav-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-light);
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-item:hover,
.nav-item.active {
    color: var(--burgundy);
}

.nav-item.active {
    background: var(--rose-light);
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 14px 28px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.btn-primary:hover {
    background: var(--burgundy-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--white);
    color: var(--burgundy);
    border: 2px solid var(--burgundy);
}

.btn-secondary:hover {
    background: var(--rose-light);
}

.btn-block {
    width: 100%;
}

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

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

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-medium);
    margin-bottom: var(--space-xs);
}

.form-input {
    width: 100%;
    height: 52px;
    padding: 0 var(--space-md);
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 16px;
    color: var(--text-dark);
    transition: border-color var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--burgundy);
}

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

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + var(--space-md));
    left: var(--space-md);
    right: var(--space-md);
    z-index: 2000;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--text-dark);
    color: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--transition-base);
    pointer-events: auto;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--error);
}

/* ===== Age Verification Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(45, 45, 45, 0.8);
    backdrop-filter: blur(8px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

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

.modal {
    width: 100%;
    max-width: 400px;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    transform: scale(0.9);
    transition: transform var(--transition-base);
}

.modal-overlay.open .modal {
    transform: scale(1);
}

.modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-lg);
}

.modal-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    color: var(--burgundy-dark);
    margin-bottom: var(--space-sm);
}

.modal-text {
    color: var(--text-medium);
    margin-bottom: var(--space-lg);
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* ===== Loading Spinner ===== */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--rose-light);
    border-top-color: var(--burgundy);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(250, 247, 245, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4000;
}

/* ===== Desktop Styles (768px+) ===== */
@media (min-width: 768px) {
    :root {
        --header-height: 72px;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-lg);
    }
    
    .product-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-md);
    }
    
    .bottom-nav {
        display: none;
    }
    
    .page-content {
        padding-bottom: var(--space-2xl);
    }
    
    .header-nav {
        display: flex;
        align-items: center;
        gap: var(--space-xl);
    }
    
    .header-nav-link {
        font-size: 14px;
        font-weight: 500;
        color: var(--text-medium);
        transition: color var(--transition-fast);
    }
    
    .header-nav-link:hover {
        color: var(--burgundy);
    }
}

/* ===== Large Desktop (1024px+) ===== */
@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .featured-banner {
        display: flex;
        align-items: center;
        padding: var(--space-xl) var(--space-2xl);
    }
    
    .featured-content {
        max-width: 50%;
    }
}

/* ===== Utilities ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

.hidden { display: none !important; }
.visible { visibility: visible !important; }
.invisible { visibility: hidden !important; }

/* Fix imagem do produto no card */
.product-card .product-image {
    background: #fff; /* linear-gradient(180deg, #F5E6E8 0%, #FAF7F5 100%);
    border-radius: 16px 16px 0 0;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    position: relative;
}

.product-card .product-image img {
    max-height: 140px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.product-card .product-image a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
