/* Google Fonts agora carregada via <link> no HTML com preconnect */

:root, html {
    font-size: 16px !important;
    -webkit-text-size-adjust: none !important;
    -moz-text-size-adjust: none !important;
    -ms-text-size-adjust: none !important;
    text-size-adjust: none !important;
}

/* ======================================================
   HEADER - Layout responsivo universal
   ====================================================== */

/* Garante que o header não quebre em nenhum tamanho de tela */
header {
    z-index: 40;
}

/* Nome da empresa: comportamento fluido de fonte */
header h1 {
    font-size: clamp(1rem, 3.5vw, 1.5rem);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}
/* Slogan: garantir que também possa aparecer todo caso tenha sido afetado por heranças soltas */
header p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
}

/* Ajustes específicos para Tablets (640px até 850px) para evitar quebra de linhas */
@media (min-width: 640px) and (max-width: 850px) {
    .hide-on-tablet {
        display: none !important;
    }
    header h1 {
        font-size: 1.15rem !important; /* Reduz título para ~18.5px no tablet */
    }
    header p {
        font-size: 0.8rem !important; /* Reduz slogan pra caber na linha no tablet */
    }
}

/* Slogan: ocultar em telas muito pequenas para não quebrar layout */
@media (max-width: 360px) {
    header h1 {
        font-size: 0.9rem;
    }
    .open-auth-btn__label {
        display: none;
    }
}

/* Tablet portrait intermediário (sm breakpoint do Tailwind = 640px) */
/* Garante que o status não quebre o layout entre 480px e 639px */
@media (min-width: 480px) and (max-width: 639px) {
    header h1 {
        font-size: clamp(1rem, 2.8vw, 1.25rem);
    }
}

body { 
    font-family: 'Inter', sans-serif;
    -webkit-text-size-adjust: none !important;
    -moz-text-size-adjust: none !important;
    -ms-text-size-adjust: none !important;
    text-size-adjust: none !important;
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    color: #991b1b;
    box-shadow: 0 8px 20px rgba(248, 113, 113, 0.15);
    margin-bottom: 1rem;
    animation: authAlertEnter 180ms ease-out;
}

.auth-alert.hidden {
    display: none !important;
}

.auth-alert__icon {
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
}

.auth-alert__body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.auth-alert__title {
    font-weight: 600;
    font-size: 0.95rem;
}

.auth-alert__message {
    font-size: 0.85rem;
    color: #7f1d1d;
}

.auth-alert--success {
    background: #dcfce7;
    border-color: #bbf7d0;
    color: #166534;
    box-shadow: 0 8px 20px rgba(74, 222, 128, 0.2);
}

.auth-alert--success .auth-alert__message {
    color: #15803d;
}

@keyframes authAlertEnter {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.category-btn {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: 1px solid #e5e7eb;
    background-color: #f9fafb;
    color: #374151;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s;
    cursor: pointer;
    scroll-snap-align: start;
    flex-shrink: 0;
}

.category-btn:hover {
    background-color: #f3f4f6;
}

.category-btn.active {
    background-color: #dc2626; /* red-600 */
    color: white;
    border-color: #dc2626;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.28);
}

/* Ocultar scrollbar mas manter funcionalidade */
.scrollbar-hide {
    -ms-overflow-style: none;
}

/* Apply Firefox-only property only when supported */
@supports (scrollbar-width: none) {
    .scrollbar-hide {
        scrollbar-width: none;
    }
}

/* Hide WebKit scrollbars */
.scrollbar-hide::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    background: transparent;
}

/* Floating cart button styles */
.cart-fab {
    background-color: #22c55e; /* equivalent to Tailwind green-500 */
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.4);
}

.cart-fab:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(34, 197, 94, 0.5);
}

.finalize-login-feedback {
    animation: finalizePulse 0.55s ease;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2), 0 10px 25px rgba(239, 68, 68, 0.35);
}

@keyframes finalizePulse {
    0% { transform: translateY(0) scale(1); }
    30% { transform: translateY(-4px) scale(1.02); }
    60% { transform: translateY(2px) scale(0.98); }
    100% { transform: translateY(0) scale(1); }
}

.cart-fab:active {
    transform: translateY(0px);
}

/* Product list container */
#lista-produtos {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* Category headers alignment */
#lista-produtos > div {
    width: 100%;
}

/* Product card enhancements */
.product-item {
    cursor: pointer;
    width: 100%;
    min-height: 150px;
    overflow: visible;
    position: relative;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.25s ease;
    border: 1px solid #f3f4f6 !important;
}

.product-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.04);
    border-color: #e5e7eb !important;
}

.product-item-image {
    overflow: hidden;
    border-radius: 0.75rem;
}

.product-item-image img {
    display: block;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-item:hover .product-item-image img {
    transform: scale(1.08);
}

/* Better image rendering */
.product-item-image img, .product-item-image picture img {
    image-rendering: auto;
    -webkit-font-smoothing: antialiased;
}

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

.product-item-price {
    display: block;
}

.product-item-price strong {
    font-size: 1.125rem;
    font-weight: 700;
    color: #16a34a;
}

.product-item-price .modal-price-summary {
    margin: 0;
    font-size: 1rem;
    line-height: 1.35;
}

.product-item-price--promo {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    line-height: 1.2;
}

.product-item-price--promo-label {
    font-size: 0.75rem;
    color: #6b7280;
}

.product-item-price--promo-old {
    font-size: 0.85rem;
    color: #9ca3af;
    text-decoration: line-through;
}

.product-item-price--promo-new {
    font-size: 1.125rem;
    font-weight: 700;
    color: #16a34a;
}

/* Line clamp utility for description */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Smooth transitions for Add button */
.add-to-cart-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
}

.add-to-cart-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(220, 38, 38, 0.2);
}

/* Inactive product cards */
.product-inactive {
    opacity: 0.6;
    filter: grayscale(30%);
}

.product-inactive:hover {
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}


/* Product modal image quality */
.product-modal-image {
    image-rendering: high-quality;
    image-rendering: -webkit-optimize-contrast;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    object-fit: cover;
    width: 100%;
    height: 300px;
    max-height: 300px;
    flex-shrink: 0;
    transform-origin: center;
    will-change: transform;
    margin: 0;
    padding: 0;
    display: block;
}

/* O overlay do modal de produto não deve rolar; apenas o conteúdo interno rola */
#product-modal {
    overflow-y: auto;
}

.product-modal-close {
    border: 2px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    position: absolute;
    z-index: 30;
    pointer-events: auto;
}

#modal-content {
    max-height: 90vh;
    overflow: visible; /* permitir o botão X fora da borda */
    width: 100%;
    box-sizing: border-box;
    position: relative; /* referência para o botão X absoluto */
}

/* Apply iOS momentum scrolling only when the property is supported.
   This avoids using -webkit-overflow-scrolling in browsers that don't support it. */
@supports (-webkit-overflow-scrolling: touch) {
    #modal-content {
        -webkit-overflow-scrolling: touch;
    }
}

.product-modal-scroll {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.product-modal-body {
    padding: 1.5rem;
    background-color: #fff;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.modal-price-summary {
    color: #16a34a;
    font-weight: 700;
    font-size: 1rem;
    margin: 0.5rem 0 1rem 0;
}

.product-modal-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-shrink: 0; /* Prevent shrinking when content is short */
}

.modal-header {
    margin-bottom: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}

.modal-description {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.5;
    width: 100%;
}

.product-modal-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.25rem;
    width: 100%;
    box-sizing: border-box;
}

.modal-option-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    box-sizing: border-box;
}

/* Improve option item layout inside scroll area */
.modal-option-item {
    align-items: center;
}

.modal-option-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.obrigatorio-badge {
    background-color: #e5e7eb;
    color: #1f2937;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    flex-shrink: 0;
}

.adicional-preco-gratis {
    color: #16a34a;
    font-weight: 600;
    font-size: 0.875rem;
}

.modal-option-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.5rem 0.75rem; /* Altura reduzida globalmente de 0.65 0.9 */
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    min-height: 2.75rem; /* Evitar que fique menor que a área de toque caso vazio */
}

.modal-option-item:hover {
    border-color: #f87171;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.1);
}

.modal-option-item input[type="checkbox"],
.modal-option-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.modal-option-item input:checked + .modal-option-indicator {
    border-color: #ef4444;
    background-color: #ef4444;
    color: #fff;
}

.modal-option-item input:checked ~ span {
    font-weight: 600;
    color: #1f2937;
}

.modal-option-indicator {
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d1d5db;
    color: transparent;
    transition: all 0.2s ease;
}

/* Radio (Bolinha) */
.adicional-input[type="radio"] + .modal-option-indicator {
    border-radius: 9999px !important;
}

/* Checkbox (Quadrado) */
.adicional-input[type="checkbox"] + .modal-option-indicator {
    border-radius: 0.25rem !important;
}

/* Mostrar controles de quantidade quando o item está marcado */
.adicional-input:checked ~ .adicional-quantity-controls {
    display: flex !important;
}

.modal-notes textarea {
    min-height: 72px;
}

.product-modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    border-bottom-left-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex-shrink: 0; /* footer should not shrink; stays visible at bottom */
    width: 100%;
    box-sizing: border-box;
}

.product-modal-quantity,
.product-modal-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quantity-controls {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    background: #f3f4f6;
    border-radius: 9999px;
    padding: 0.4rem 0.85rem;
}

.quantity-btn {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #513737;
    transition: background 0.2s;
}

.quantity-btn:hover {
    background: #f9fafb;
}

.quantity-value {
    font-weight: 600;
    color: #1f2937;
    min-width: 1rem;
    text-align: center;
}

.subtotal-value {
    font-weight: 700;
    font-size: 1.125rem;
    color: #16a34a;
}

.product-modal-cta {
    width: 100%;
    border-radius: 0.5rem;
    background: #dc2626;
    color: #fff;
    font-weight: 600;
    padding: 0.75rem 1rem;
    text-align: center;
    transition: background 0.2s;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-sizing: border-box;
}

.product-modal-cta:hover {
    background: #b91c1c;
}

.product-modal-cta::before {
    content: '🛒';
    font-size: 1rem;
}

@media (max-width: 650px) {
    #lista-produtos {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .product-item {
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .product-item-image {
        align-self: center;
    }

    /* Centralizar imagem verticalmente no card mobile,
       sobrescrevendo o items-start do Tailwind na div interna */
    .product-item > .flex {
        align-items: center !important;
    }

    .product-item-image img {
        width: 64px;
        height: 64px;
    }

    .product-item-info h3 {
        font-size: 0.875rem;
    }

    .product-item-info p {
        font-size: 0.75rem;
    }

    .product-item-action {
        align-self: center;
    }

    .product-item-action .add-to-cart-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    .product-item-action .add-to-cart-btn svg {
        width: 0.875rem;
        height: 0.875rem;
    }

    .product-item-action button span {
        display: none;
    }

    .product-modal-image {
        height: 240px;
    }

    .product-modal-body {
        padding: 1rem; /* Reduzido de 1.25rem para dar mais espaço ao texto */
    }

    .product-modal-footer {
        padding: 1rem 1.25rem 1.25rem;
    }
}

/* Estilos para o selo de promoção (responsivo) */
.product-item-image {
    position: relative;
    display: inline-block;
    overflow: hidden; /* Garante que o selo não ultrapasse as bordas arredondadas */
    border-radius: 0.5rem;
}

.promo-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.9rem 0.22rem 1.6rem;
    margin-bottom: 0.4rem;
    margin-top: 0;
    border-radius: 9999px;
    background-color: #ef4444;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.45);
}

.promo-badge__icon {
    position: absolute;
    top: 50%;
    left: 0.8rem;
    transform: translate(-60%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 9999px;
    background: radial-gradient(circle at 30% 20%, #fef9c3 0%, #f97316 60%, #ea580c 100%);
    font-size: 0.8rem;
    line-height: 1;
    box-shadow: 0 0 0 2px #ef4444;
}

.promo-badge__label {
    font-weight: 700;
}

.promo-badge::before {
    content: none;
}

.promo-badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: none;
    border-radius: inherit;
    pointer-events: none;
}

@keyframes promo-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 2px 8px rgba(255, 8, 68, 0.4),
            0 4px 16px rgba(255, 8, 68, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 
            0 3px 12px rgba(255, 8, 68, 0.5),
            0 6px 20px rgba(255, 8, 68, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
}

/* Ajuste específico para mobile */
@media (max-width: 650px) {
    .promo-badge {
        font-size: 0.7rem;
        padding: 0.14rem 0.7rem 0.14rem 0.9rem;
        margin-bottom: 0.3rem;
        margin-top: 0;
    }
    
    .promo-badge__icon {
        font-size: 0.8rem;
    }
    
    .product-item { min-height: 100px; }
}

/* Melhorias gerais de responsividade */
@media (max-width: 768px) {
    /* Ajustar padding do container principal */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Melhorar legibilidade em mobile */
    body {
        font-size: 14px;
    }
    
    /* Cards de produtos mais compactos */
    .product-item {
        padding: 0.75rem !important;
        gap: 0.75rem !important;
    }
    
    .product-item-image img {
        width: 80px !important;
        height: 80px !important;
    }
    
    /* Botões de adicionar menores */
    .product-item-action button {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.75rem !important;
    }
    
    .add-to-cart-btn svg {
        width: 0.875rem !important;
        height: 0.875rem !important;
    }
    
    /* Títulos de produtos menores */
    .product-item h3 {
        font-size: 0.875rem !important;
    }
    
    .product-item p {
        font-size: 0.75rem !important;
    }
    
    /* Preços mais visíveis */
    .product-item-price strong {
        font-size: 1rem !important;
    }
}

/* Mobile extra pequeno */
@media (max-width: 480px) {
    .product-item {
        padding: 0.5rem !important;
        gap: 0.5rem !important;
    }
    
    .product-item-image img {
        width: 70px !important;
        height: 70px !important;
    }
    
    .product-item-action button span {
        display: none;
    }
    
    .add-to-cart-btn {
        padding: 0.5rem !important;
        min-width: 40px;
        justify-content: center;
    }
}

/* Melhorias para botões flutuantes em mobile */
@media (max-width: 768px) {
    #cart-button {
        bottom: 1rem;
        right: 1rem;
        padding: 0.625rem 1rem;
        width: auto;
        height: auto;
        border-radius: 9999px;
    }
    
    /* Evitar sobreposição com elementos fixos */
    body {
        padding-bottom: 80px;
    }
}

/* Otimizações de toque */
@media (hover: none) and (pointer: coarse) {
    /* Aumentar área de toque em dispositivos móveis */
    .category-btn,
    .add-to-cart-btn,
    button {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Estilos para a sobreposição de loja fechada */
.product-closed-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 20; /* Deve ser maior que o do selo */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 0.5rem; /* Mesmo do card */
    -webkit-backdrop-filter: blur(1px);
    backdrop-filter: blur(1px);
}

.product-closed-overlay-content {
    text-align: center;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 0.375rem;
}

.product-closed-overlay-content .title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #dc2626; /* red-600 */
}

.product-closed-overlay-content .subtitle {
    font-size: 0.75rem;
    color: #4b5563; /* gray-600 */
}

/* Animações para feedback de cupom */
.animate-fade-in {
    animation: fadeInScale 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Animação de pulse para sucesso */
#coupon-feedback.bg-green-50 {
    animation: fadeInScale 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
               successPulse 0.6s ease-out 0.3s;
}

@keyframes successPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.2);
    }
}

/* Estilos do feedback de cupom (Mobile-First) */
#coupon-feedback {
    padding: 0.875rem;
    margin-top: 0.75rem;
    border-left-width: 5px;
    border-radius: 0.5rem;
    transition: opacity 280ms cubic-bezier(.2,.9,.2,1), transform 260ms ease, visibility 260ms;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    line-height: 1.4;
    font-size: clamp(0.875rem, 2.5vw, 0.9375rem); /* Fonte fluida */
    max-width: 100%;
    box-sizing: border-box;
    word-break: break-word;
    opacity: 0; /* hide visually */
    visibility: hidden; /* prevent interaction */
    transform: translateY(-6px) scale(0.995);
}

#coupon-feedback strong {
    display: block;
    font-weight: 600;
    margin-bottom: 0.125em; /* Relativo ao font-size do pai */
}

#coupon-feedback .icon {
    font-size: 1.3em; /* Relativo ao font-size do pai */
    flex-shrink: 0;
    margin-top: 0.1em;
}

/* Cores e sombras para mobile */
#coupon-feedback.bg-green-50 {
    background-color: #dcfce7;
    border-left-color: #22c55e;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

#coupon-feedback.bg-red-50 {
    background-color: #fee2e2;
    border-left-color: #ef4444;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

#coupon-feedback.bg-yellow-50 {
    background-color: #fef9c3;
    border-left-color: #eab308;
    box-shadow: 0 2px 8px rgba(234, 179, 8, 0.15);
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Estilos para telas maiores (desktop) */
@media (min-width: 640px) {
    #coupon-feedback {
        padding: 1rem;
        border-left-width: 4px;
        gap: 1rem;
        align-items: center;
    }

    /* Cores mais suaves para desktop */
    #coupon-feedback.bg-green-50 {
        background-color: #f0fdf4;
        box-shadow: none;
    }

    #coupon-feedback.bg-red-50 {
        background-color: #fef2f2;
        box-shadow: none;
    }

    #coupon-feedback.bg-yellow-50 {
        background-color: #fefce8;
        box-shadow: none;
    }
}

/* Extra small screens: compact spacing */
@media (max-width: 420px) {
    #coupon-feedback {
        font-size: 0.78rem;
        gap: 0.5rem;
        padding: 0.65rem;
    }

    #coupon-feedback .icon {
        font-size: 1.05em;
    }

    #coupon-feedback strong { font-size: 0.95em; }
    #coupon-feedback .text-sm { font-size: 0.8em; }
}

@keyframes product-modal-kenburns {
    0% { transform: scale(1) translate(0, 0); }
    50% { transform: scale(1.06) translate(-2%, -2%); }
    100% { transform: scale(1.1) translate(2%, 2%); }
}

@media (prefers-reduced-motion: reduce) {
    .product-modal-image {
        animation: none !important;
    }
}

@media (hover: hover) {
    .product-modal-image:hover { animation-play-state: paused; }
}

/* Ajustes de modais em mobile para lidar com barra de navega5o e altura dine2mica */
@media (max-width: 768px) {
    /* Garante que o container dos modais use toda a altura dispone76l e alinhe do topo */
    #perfilcliente-modal,
    #checkout-modal,
    #profile-address-modal,
    #rastreio-modal {
        align-items: flex-start;
    }

    /* Limita a altura me18ima do contef6do interno ao viewport dine2mico */
    #perfilcliente-modal > div,
    #checkout-modal > div,
    #profile-address-modal > div,
    #rastreio-modal > div {
        max-height: 100dvh;
    }

    /* Zona role16vel principal dos modais mais altos (perfil, checkout e rastreio) */
    #perfilcliente-modal .modal-body-scroll,
    #checkout-modal .modal-body-scroll,
    #rastreio-modal .modal-body-scroll {
        max-height: calc(100dvh - 140px);
    }

    #perfilcliente-modal .modal-body-scroll {
        padding-bottom: 96px;
    }

    #perfilcliente-view-data {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    #perfilcliente-view-data > div {
        padding: 1rem 1rem 1.1rem;
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
    }
}

/* Custom scrollbar para categorias */
.custom-scrollbar::-webkit-scrollbar {
    height: 6px; /* Aumentado levemente para melhor visibilidade */
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: transparent; /* Escondido por padrão se não tiver a classe */
    border-radius: 10px;
}

/* Tornar visível quando exceder o limite */
.custom-scrollbar.has-scrollbar-visible::-webkit-scrollbar-thumb {
    background: #d1d5db; /* Cor cinza suave da imagem */
}

.custom-scrollbar.has-scrollbar-visible {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent; /* Firefox */
    padding-bottom: 10px;
}

.custom-scrollbar:hover::-webkit-scrollbar-thumb,
.custom-scrollbar.has-scrollbar-visible:hover::-webkit-scrollbar-thumb {
    background: #9ca3af; /* Escurece no hover */
}

.custom-scrollbar {
    scrollbar-width: none;
    scrollbar-color: transparent transparent; 
    padding-bottom: 8px;
    transition: all 0.3s ease;
}

/* ======================================================
   PRODUTOS INATIVOS - Efeito cinza
   ====================================================== */
.product-inactive {
    opacity: 1;
    background-color: #fcfcfc;
}

.product-inactive .product-item-image img {
    filter: grayscale(100%);
    opacity: 0.82;
}

.product-inactive .product-item-info h3 {
    color: #4b5563 !important;
}

.product-inactive .product-item-info p {
    color: #6b7280 !important;
}

.product-inactive .product-item-price strong,
.product-inactive .product-item-price .text-green-600,
.product-inactive .product-item-price .text-green-700,
.product-inactive .product-item-price .text-gray-700,
.product-inactive .product-item-price .text-gray-500 {
    color: #6b7280 !important;
}

/* ======================================================
   ADICIONAIS COM QUANTIDADE - Controles +/-
   ====================================================== */
.adicional-item-wrapper {
    transition: background-color 0.2s ease;
    width: 100%;
}

.modal-option-item.active-selection {
    background-color: #fef2f2 !important;
    border-color: #fca5a5 !important;
}

.adicional-item-wrapper .modal-option-item {
    margin: 0;
    flex-wrap: nowrap;
}

.adicional-quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 0.15rem; /* Reduzido padding interno da caixinha */
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.adicional-quantity-controls.hidden {
    display: none !important;
}

.adicional-qty-btn {
    width: 1.25rem; /* Reduzido globalmente de 1.5rem para 1.25 (20px) */
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0.25rem;
    background: #fee2e2;
    color: #dc2626;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1;
    padding: 0;
}

.adicional-qty-btn:hover {
    background: #fecaca;
}

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

.adicional-qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.adicional-qty-value {
    min-width: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    user-select: none;
}

/* Ajuste do preço do adicional */
.adicional-preco {
    font-weight: 600;
    color: #16a34a;
    font-size: 0.875rem;
}

/* Nome do adicional */
.adicional-nome {
    font-size: 0.875rem;
    color: #374151;
}

/* Responsivo para mobile */
@media (max-width: 768px) {
    .adicional-item-wrapper {
        padding: 0;
    }
    
    .adicional-item-wrapper .modal-option-item {
        flex: 1;
        min-width: 0;
        overflow: visible; /* Remover hidden para nao cortar bordas do box shadow */
        padding: 0.35rem 0.4rem; /* Ainda mais justo no mobile */
        gap: 0.35rem; /* Menor gap para economizar espaco no mobile */
    }
    
    .adicional-nome {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.75rem; /* Letra um pouco menor para garantir que caiba */
    }
    
    .adicional-quantity-controls {
        margin-left: auto;
        padding: 0.1rem; /* Mínimo de padding */
        gap: 0.15rem; /* Mínimo de espaçamento entre botão e número */
        border-radius: 0.2rem;
        flex-shrink: 0;
    }
    
    .adicional-qty-btn {
        width: 1.15rem !important; /* Aproximadamente 18px */
        height: 1.15rem !important;
        font-size: 0.75rem !important;
        border-radius: 0.15rem;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .adicional-qty-value {
        font-size: 0.75rem;
        min-width: 0.5rem;
        padding: 0 0.2rem;
        font-weight: 600;
    }
    
    /* Preço do adicional */
    .adicional-preco {
        font-size: 0.65rem; /* Preço menor */
        margin-left: 0.25rem;
    }
}

/* Extra small screens - só quebra se necessário */
@media (max-width: 380px) {
    .adicional-item-wrapper {
        flex-wrap: wrap;
    }
    
    .adicional-quantity-controls {
        margin-left: auto;
    }
}
