/* ==========================================
   TEMA MODERNO - CardapiX
   Um tema clean, premium e minimalista
   Inspirado em layouts de alta conversão
   ========================================== */

/* Os valores de --primary-color e --primary-dark devem ser definidos no HTML/PHP 
   através da tag <style> antes de carregar este arquivo. */

body.tema-moderno { 
    background: var(--bg-color, #f7f8fa); 
    color: var(--text-primary, #111827); 
    padding-bottom: 80px; 
    -webkit-tap-highlight-color: transparent; 
    font-family: 'Inter', sans-serif;
}

body.tema-moderno * { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

/* Hero Section */
body.tema-moderno .hero-section {
    position: relative;
    background: white;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

body.tema-moderno .hero-bg {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

body.tema-moderno .status-badge {
    position: absolute;
    top: 60px;
    right: 15px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(4px);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 20px;
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));
}

body.tema-moderno .status-badge .dot { width: 10px; height: 10px; border-radius: 50%; }
body.tema-moderno .status-badge.aberto .dot { background: #10b981; box-shadow: 0 0 8px #10b981; }
body.tema-moderno .status-badge.fechado .dot { background: #ef4444; box-shadow: 0 0 8px #ef4444; }

body.tema-moderno .rating-stars {
    position: absolute;
    top: 100px;
    right: 15px;
    background: rgba(255,255,255,0.9);
    padding: 4px 10px;
    border-radius: 12px;
    color: #fbbf24;
    font-size: 0.8rem;
    box-shadow: var(--shadow-md);
}

body.tema-moderno .brand-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: -60px;
    position: relative;
    z-index: 10;
}

body.tema-moderno .brand-logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid white;
    object-fit: contain;
    background: white;
    box-shadow: var(--shadow-md);
}

body.tema-moderno .social-links {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

body.tema-moderno .social-links a {
    color: var(--primary-color);
    font-size: 1.5rem;
    text-decoration: none;
}

body.tema-moderno .social-links a.whatsapp { color: #25d366; }
body.tema-moderno .social-links a.facebook { color: #1877f2; }
body.tema-moderno .social-links a.instagram { color: #e1306c; }

body.tema-moderno .brand-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-top: 10px;
    text-transform: uppercase;
    text-align: center;
}

body.tema-moderno .brand-subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
    margin-top: 5px;
    max-width: 80%;
}

/* Info Grid */
body.tema-moderno .info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    background: white;
    padding: 20px 15px;
    margin-top: 8px;
    border-bottom: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
}

body.tema-moderno .info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

body.tema-moderno .info-item i {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

body.tema-moderno .info-item .title {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

body.tema-moderno .info-item .value {
    font-size: 0.8rem;
    color: #10b981;
    font-weight: 700;
    margin-top: 4px;
}

/* Search Area */
body.tema-moderno .search-container {
    background: white;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

body.tema-moderno .search-input-wrapper {
    position: relative;
    width: 100%;
}

body.tema-moderno .search-input-wrapper input {
    width: 100%;
    padding: 14px 14px 14px 40px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #f3f4f6;
    font-size: 0.95rem;
    color: var(--text-primary);
    outline: none;
}

body.tema-moderno .search-input-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Promo Banner */
body.tema-moderno .promo-banner {
    padding: 0 15px 15px 15px;
    background: white;
}

body.tema-moderno .promo-banner img {
    width: 100%;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

/* Categories Slider */
body.tema-moderno .categories-wrapper {
    background: white;
    padding: 20px 0 10px 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 6px -4px rgba(0,0,0,0.05);
}

body.tema-moderno .categories-wrapper::-webkit-scrollbar { display: none; }

body.tema-moderno .categories {
    display: flex;
    gap: 15px;
    padding: 0 15px;
    width: max-content;
}

body.tema-moderno .category {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    width: 80px;
}

body.tema-moderno .category img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid transparent;
    transition: all 0.2s;
}

body.tema-moderno .category.active img {
    border-color: var(--primary-color);
    padding: 2px;
}

body.tema-moderno .category-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.2;
}

body.tema-moderno .category.active .category-name { color: var(--primary-color); }

/* Products List */
body.tema-moderno .accordion { padding: 10px 15px; } 

body.tema-moderno .accordion-item { margin-bottom: 25px; }

body.tema-moderno .accordion-header {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--border-color);
}

body.tema-moderno .accordion-content { display: block !important; }

body.tema-moderno .product-card {
    display: flex;
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    gap: 15px;
    cursor: pointer;
    transition: transform 0.2s;
    color: var(--text-primary);
}

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

body.tema-moderno .product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

body.tema-moderno .product-info h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    text-transform: uppercase;
}

body.tema-moderno .product-info .description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
    line-height: 1.3;
}

body.tema-moderno .product-info .price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
}

body.tema-moderno .product-info .original-price {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-right: 5px;
}

body.tema-moderno .product-card img {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

/* Bottom Nav Bar */
body.tema-moderno .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 5px 25px 5px;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
    z-index: 1000;
}

body.tema-moderno .bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

body.tema-moderno .bottom-nav .nav-item.active { color: var(--primary-color); }
body.tema-moderno .bottom-nav .nav-item i { font-size: 1.4rem; }

body.tema-moderno .bottom-nav .nav-cart-btn {
    background: var(--primary-color);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-top: -30px;
    box-shadow: 0 4px 10px var(--primary-color);
    border: 4px solid white;
    position: relative;
    cursor: pointer;
}

body.tema-moderno .badge-cart {
    position: absolute;
    top: 0;
    right: 0;
    background: #ef4444;
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Overrides para Carrinho e Modais no tema Moderno */
body.tema-moderno .modal, 
body.tema-moderno .produto-modal, 
body.tema-moderno #modal-carrinho-mobile,
body.tema-moderno #modal-checkout {
    display: none;
    position: fixed;
    z-index: 10050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay, rgba(0,0,0,0.6));
    backdrop-filter: blur(5px);
}

body.tema-moderno .modal.active, 
body.tema-moderno #modal-carrinho-mobile.active,
body.tema-moderno #modal-checkout.active { 
    display: flex !important; 
    align-items: center; 
    justify-content: center; 
}

body.tema-moderno .produto-modal.active { 
    display: block !important; 
}

body.tema-moderno .modal-content {
    background: white;
    color: var(--text-primary);
    position: relative;
    max-width: 500px;
    width: 90%;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    margin: auto;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
}

body.tema-moderno .produto-modal-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    max-width: 600px;
    width: 100%;
    background: var(--surface-color, #ffffff);
    color: var(--text-primary, #111827);
    border-radius: 30px 30px 0 0;
    max-height: 92vh;
    padding: 25px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color, #e5e7eb);
    border-bottom: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: moderno-slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body.tema-moderno .produto-modal-content {
    animation: moderno-slideUp 0.3s ease-out;
}

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

body.tema-moderno .produto-modal-content .modal-footer-fixed { 
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface-color, #ffffff);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color, #e5e7eb) !important; 
    padding: 18px 25px;
    z-index: 10;
}

body.tema-moderno #produto-detalhes {
    overflow-y: auto;
    flex: 1; 
    padding-bottom: 100px; /* Space for footer */
    -webkit-overflow-scrolling: touch;
}

body.tema-moderno #modal-pagamento-pix .modal-content { 
    background: white !important; 
    color: var(--text-primary) !important;
}

/* Forms no Checkout */
body.tema-moderno .form-group label {
    color: var(--text-primary);
    font-weight: 600;
}

body.tema-moderno .form-group input, 
body.tema-moderno .form-group select, 
body.tema-moderno .form-group textarea {
    background: #f9fafb !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: 8px !important;
}

body.tema-moderno .tipo-entrega-item, 
body.tema-moderno .forma-pagamento-item {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
}

body.tema-moderno .tipo-entrega-item.selected, 
body.tema-moderno .forma-pagamento-item.selected {
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb, 74, 102, 249), 0.1);
    color: var(--primary-color);
}

body.tema-moderno .btn-finalizar {
    background: var(--primary-color) !important;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Silenciar elementos do tema padrão que não usamos */
body.tema-moderno #carrinho-flutuante, 
body.tema-moderno #carrinho-flutuante-mobile { 
    display: none !important; 
}

/* Localização e Social no Checkout */
body.tema-moderno .location, 
body.tema-moderno .social {
    color: var(--text-secondary);
}

body.tema-moderno header h1 {
    color: var(--text-primary);
    text-shadow: none;
}

/* ==========================================
   DARK MODE - Tema Moderno
   ========================================== */

body.tema-moderno[data-theme="dark"] {
    --bg-color: #0f0f1a;
    --surface-color: #1a1a2e;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --surface-card: rgba(22, 33, 62, 0.8);
    --card-shadow: var(--shadow-sm);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --modal-overlay: rgba(0, 0, 0, 0.85);
    
    background: var(--bg-color) !important;
    color: var(--text-primary) !important;
}

body.tema-moderno[data-theme="dark"] .hero-section {
    background: var(--surface-color);
    border-bottom-color: var(--border-color);
}

body.tema-moderno[data-theme="dark"] .status-badge {
    background: rgba(26, 26, 46, 0.9);
    color: var(--text-primary);
}

body.tema-moderno[data-theme="dark"] .rating-stars {
    background: rgba(26, 26, 46, 0.9);
}

body.tema-moderno[data-theme="dark"] .brand-logo {
    border-color: var(--surface-color);
    background: var(--surface-color);
}

body.tema-moderno[data-theme="dark"] .info-grid {
    background: var(--surface-color);
    border-color: var(--border-color);
}

body.tema-moderno[data-theme="dark"] .search-container {
    background: var(--surface-color);
}

body.tema-moderno[data-theme="dark"] .search-input-wrapper input {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.tema-moderno[data-theme="dark"] .categories-wrapper {
    background: var(--surface-color);
    box-shadow: 0 4px 6px -4px rgba(0, 0, 0, 0.3);
}

body.tema-moderno[data-theme="dark"] .product-card {
    background: var(--surface-color);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.tema-moderno[data-theme="dark"] .product-info h4 {
    color: var(--text-primary);
}

body.tema-moderno[data-theme="dark"] .product-info .description {
    color: var(--text-secondary);
}

body.tema-moderno[data-theme="dark"] .product-info .price {
    color: var(--text-primary);
}

body.tema-moderno[data-theme="dark"] .bottom-nav {
    background: var(--surface-color);
    border-top-color: var(--border-color);
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.3);
}

body.tema-moderno[data-theme="dark"] .bottom-nav .nav-cart-btn {
    border-color: var(--surface-color);
}

body.tema-moderno[data-theme="dark"] .modal-content {
    background: var(--surface-color) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

body.tema-moderno[data-theme="dark"] .produto-modal-content {
    background: var(--surface-color) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

body.tema-moderno[data-theme="dark"] .produto-modal-content .modal-footer-fixed {
    background: var(--surface-color) !important;
    border-top-color: var(--border-color) !important;
}

body.tema-moderno[data-theme="dark"] #modal-pagamento-pix .modal-content {
    background: var(--surface-color) !important;
    color: var(--text-primary) !important;
}

body.tema-moderno[data-theme="dark"] .form-group input,
body.tema-moderno[data-theme="dark"] .form-group select,
body.tema-moderno[data-theme="dark"] .form-group textarea {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

body.tema-moderno[data-theme="dark"] .tipo-entrega-item,
body.tema-moderno[data-theme="dark"] .forma-pagamento-item {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.tema-moderno[data-theme="dark"] .promo-banner {
    background: var(--surface-color);
}

body.tema-moderno[data-theme="dark"] .accordion-header {
    color: var(--text-primary);
    border-bottom-color: var(--border-color);
}
