@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;600;700&display=swap');

* {
    cursor: default !important;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #FFFAF5; /* Fundo Creme Suave */
    color: #6B4423; /* Texto Marrom Chocolate */
    max-width: 768px;
    margin: auto;
    font-family: 'Quicksand', sans-serif;
    font-size: 17px; /* Increased from 16px default */
    position: relative;
    line-height: 1.6;
}

.hide {
    display: none !important;
}

.btn {
    border-radius: 12px; /* Bordas mais arredondadas para estilo moderno */
    min-height: 44px; /* Touch target mínimo recomendado */
    min-width: 44px;
    font-weight: 600;
    transition: all 0.25s ease;
}

a {
    text-decoration: none;
    color: inherit;
}

.loading-app {
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    z-index: 5;
    font-size: 50px;
    background-color: #FFFAF5;
    color: #6B4423;
}

header {
    background-size: cover;
    background-position: center;
    height: 250px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Estilo para o nome da loja (Cookie Mauf) */
.store-name {
    font-size: 2.8em;
    color: #6B4423;
    font-weight: 700;
    letter-spacing: 1px;
    /* Efeito de contorno branco + sombra escura para máxima legibilidade */
    text-shadow: 
        -1px -1px 1px #FFF, 
         1px -1px 1px #FFF, 
        -1px  1px 1px #FFF, 
         1px  1px 1px #FFF,
         3px 3px 5px rgba(0,0,0,0.25);
}

.store-slogan {
    font-size: 1.1em;
    font-weight: 500;
    color: #6B4423; /* Marrom Chocolate */
    margin-top: 8px;
    /* Sombra mais sutil, mas ainda eficaz */
    text-shadow: 
        -1px -1px 1px #FFF, 
         1px -1px 1px #FFF, 
        -1px  1px 1px #FFF, 
         1px  1px 1px #FFF,
         2px 2px 3px rgba(0,0,0,0.2);
}


header p {
    margin-bottom: 0;
    font-family: 'Quicksand', sans-serif;
    color: #5C3D2E !important; /* Forçando a cor para garantir a sobreposição */
    font-weight: 500;
    text-shadow: 1px 1px 3px rgba(255, 255, 255, 0.7); /* Adiciona uma sombra clara para legibilidade */
}
header .container {
    position: relative;
}
header:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.3); /* Overlay mais claro para tema light */
    opacity: 1;
}
/* Social Links in Copyright */
.copyright .store-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    font-size: 14px;
    margin-bottom: 16px;
}
.copyright .store-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #8B7355;
    border-bottom: none;
    transition: color 0.2s ease;
    font-weight: 500;
    min-width: 44px;
    min-height: 44px;
}
.copyright .store-links a:hover {
    color: #6B4423; /* Marrom Chocolate */
}
.copyright .store-links a i {
    font-size: 18px;
}

section.copyright {
    margin-top: 32px;
    text-align: center;
    margin-bottom: 120px;
    font-size: 13px;
    font-family: 'Quicksand', sans-serif;
    color: #8B7355;
    padding: 0 16px;
}
section.copyright a {
    color: #6B4423;
    border-bottom: 1px dotted;
    font-family: 'Quicksand', sans-serif;
    transition: color 0.2s ease;
}
section.copyright a:hover {
    color: #E67E50;
}

.categories-list {
    position: sticky;
    top: 0;
    display: flex;
    overflow: auto;
    flex-wrap: nowrap;
    text-wrap: nowrap;
    width: 100%;
    scrollbar-width: none;
    cursor: grab;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    background: rgba(245, 230, 211, 0.894); /* Bege Quente com 30% transparência */
    border-bottom: 1px solid #E8DCC8;
    z-index: 3;
    padding: 8px 0;
}
.categories-list::-webkit-scrollbar {
    display: none;
}
.categories-list:active {
    cursor: grabbing;
}
.categories-list .nav-link {
    color: #8B7355; /* Marrom Médio */
    font-weight: 700;
    font-size: 14px;
    border-bottom: 3px solid transparent;
    -webkit-user-drag: none;
    transition: all 0.25s ease;
    font-family: 'Quicksand', sans-serif;
    padding: 12px 16px;
    white-space: nowrap;
}
.categories-list .nav-link:hover {
    color: #6B4423;
}
.categories-list .nav-link.active {
    border-color: #E67E50; /* Coral */
    color: #6B4423; /* Marrom Chocolate */
}

section.category {
    padding: 32px 16px;
    scroll-margin-top: 40px;
    /* O fundo foi removido para que os cards flutuem sobre o bege do body */
}
section.category h4 {
    margin-bottom: 24px;
    font-weight: 700;
    font-size: 1.3em;
    font-family: 'Quicksand', sans-serif;
    color: #6B4423; /* Marrom Chocolate */
}
section.category .scroll-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    scrollbar-width: none;
    font-family: 'Quicksand', sans-serif;
    padding: 0;
}
@media (min-width: 480px) {
    section.category .scroll-container {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 768px) {
    section.category .scroll-container {
        grid-template-columns: repeat(3, 1fr);
    }
}
section.category .scroll-container img,
section.category .scroll-container a {
    -webkit-user-drag: none;
}
section.category .scroll-container::-webkit-scrollbar {
    display: none;
}
section.category .scroll-container .item {
    background: #FFFFFF; /* Fundo branco para os cards */
    border-radius: 12px; /* Bordas mais arredondadas */
    box-shadow: 0 2px 8px rgba(107, 68, 35, 0.08); /* Sombra suave melhorada */
    padding: 12px;
    border: 1px solid #F0EBE3;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
}
section.category .scroll-container .item:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 24px rgba(107, 68, 35, 0.12);
}
section.category .scroll-container .item.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}
section.category .item img {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    -o-object-fit: cover;
    object-fit: cover;
    -o-object-position: center;
    object-position: center;
    margin-bottom: 12px;
    border-radius: 8px;
}
section.category .item p {
    margin-bottom: 0;
    font-family: 'Quicksand', sans-serif;
    color: #6B4423; /* Marrom Chocolate */
    font-weight: 600;
    font-size: 0.95em;
}
section.category .item .item-price {
    font-weight: 700;
    color: #E67E50; /* Coral */
    font-size: 1.1em;
    margin-top: auto;
    padding-top: 8px;
}
section.category .item small {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 8px 0;
    font-family: 'Quicksand', sans-serif;
    color: #8B7355; /* Marrom Médio */
    font-weight: 400;
    font-size: 0.85em;
    flex-grow: 1;
}

.footer-overlay {
    z-index: 4;
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100dvw;
    height: 100dvh;
    background-color: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: 0.3s opacity;
}
.footer-overlay.show {
    opacity: 0.5;
    pointer-events: all;
}

footer {
    position: fixed;
    z-index: 5;
    bottom: 0;
    left: 50%;
    width: 100%;
    padding: 8px 16px;
    color: inherit;
    transition: all 0.3s ease;
    max-width: 768px;
    margin: auto;
    transform: translateX(-50%);
    font-family: 'Quicksand', sans-serif;
    background-color: transparent; /* remove colored stripe */
    border-top: none;
    height: auto; /* allow content-driven height */
}
/* Hide the internal footer container (cart UI) so only the finalize button is visible.
   The full cart markup remains in HTML for functionality but is visually hidden. */
footer .container {
    display: none;
}
footer .container .cart-container {
    flex: 1;
    overflow: auto;
}
/* Style for the visible finalize button wrapper */
footer > .d-flex {
    display: flex;
    justify-content: flex-end;
}

#btnOpenFinish {
    border-radius: 12px;
    min-height: 44px;
    padding: 10px 16px;
    font-weight: 700;
}
#btnCopyPix {
    white-space: normal; /* allow the label to wrap instead of truncating */
    word-break: break-word;
}
footer.expand {
    height: calc(100% - 40px);
    padding: 24px 16px 20px 16px;
    border-radius: 16px 16px 0 0;
    background-color: #FFFFFF;
    color: #6B4423; /* Marrom Chocolate */
    border: 1px solid #E8DCC8;
    box-shadow: 0 -8px 24px rgba(107, 68, 35, 0.1);
}
footer.expand .btn-footer-toggle .fa-chevron-down {
    display: inline-block;
}
footer.expand .btn-footer-toggle .fa-chevron-up {
    display: none;
}
footer .empty-message {
    text-align: center;
    margin: 12px 0;
    font-family: 'Quicksand', sans-serif;
    color: #FFFFFF;
    font-weight: 500;
}
footer .items-message {
    display: none;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    font-family: 'Quicksand', sans-serif;
    color: #FFFFFF;
}
footer.expand .items-message {
    display: flex;
}
footer .cart-container {
    display: flex;
    flex-flow: column;
    gap: 20px;
}
footer .cart-container p {
    font-size: 14px;
    font-family: 'Quicksand', sans-serif;
    color: #6B4423; /* Marrom Chocolate */
}
footer .cart-container img {
    width: 100%;
    aspect-ratio: 1/1;
    -o-object-fit: cover;
    object-fit: cover;
    -o-object-position: center;
    object-position: center;
    border-radius: 4px;
}
footer .cart-container .product-observations {
    font-size: 13px;
    margin-top: 5px;
    font-family: 'Quicksand', sans-serif;
    color: #8B7355;
}

.modal .modal-title {
    font-size: 1.3em;
    font-family: 'Quicksand', sans-serif;
    color: #6B4423; /* Marrom Chocolate */
    font-weight: 700;
}
.modal .modal-content {
    border-radius: 16px;
    font-size: 15px;
    font-family: 'Quicksand', sans-serif;
    background-color: #FFFFFF;
    color: #6B4423; /* Marrom Chocolate */
    border: none;
}
/* Mobile: Sheet modal (slide-up) */
@media (max-height: 700px) {
    .modal .modal-dialog {
        margin: 0;
    }
    .modal .modal-dialog-centered {
        align-items: flex-end;
    }
    .modal .modal-content {
        border-radius: 16px 16px 0 0;
    }
}
.modal .modal-content input,
.modal .modal-content select,
.modal .modal-content textarea {
    font-size: 15px;
    font-family: 'Quicksand', sans-serif;
    background-color: #FFFAF5;
    color: #6B4423; /* Marrom Chocolate */
    border: 1px solid #E8DCC8;
    border-radius: 8px;
    padding: 10px 12px;
    transition: border-color 0.25s ease;
}
.modal .modal-content input:focus,
.modal .modal-content select:focus,
.modal .modal-content textarea:focus {
    border-color: #E67E50; /* Coral */
    background-color: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(230, 126, 80, 0.1);
}
.modal .modal-content .quantity {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    font-family: 'Quicksand', sans-serif;
}
.modal .modal-footer {
    background-color: #FFFAF5;
    border-top: 1px solid #E8DCC8;
    padding: 16px;
}
.modal .modal-content .btn-dark {
    background-color: #6B4423;
    border-color: #6B4423;
    color: white;
    min-height: 44px;
}
.modal .modal-content .btn-dark:hover {
    background-color: #523220;
    border-color: #523220;
    transform: translateY(-2px);
}
.modal .modal-content .btn-danger {
    background-color: #E67E50; /* Coral */
    border-color: #E67E50;
    color: #FFFFFF;
    font-weight: 700;
    min-height: 44px;
}
.modal .modal-content .btn-danger:hover {
    background-color: #D96E38; /* Coral escuro */
    border-color: #D96E38;
    transform: translateY(-2px);
}

/* Ajustes para a caixa de quantidade no modal de detalhes do produto
   - reduz a largura/altura do input numérico
   - reduz os botões +/- para não ocultarem o botão Adicionar
*/
.modal .modal-content .quantity {
    gap: 6px; /* um pouco menos de espaço */
}
.modal .modal-content .quantity input[type="number"] {
    width: 60px;
    max-width: 80px;
    padding: 6px 8px;
    height: 36px;
    text-align: center;
    border-radius: 8px;
    font-size: 0.95rem;
}
.modal .modal-content .quantity .btn {
    min-width: 36px;
    min-height: 36px;
    padding: 6px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.modal .modal-content .quantity .btn i {
    font-size: 0.9rem;
}

/* Finish modal cart styles (new cart UI) */
.finish-cart-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.finish-cart-item {
    background: #FFFAF5;
    border-radius: 6px;
    padding: 8px 10px;
    border: 1px solid #E8DCC8;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}
.finish-cart-item > div:first-child {
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}
.finish-cart-item > div:last-child {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.finish-cart-item .btn {
    padding: 0.15rem 0.3rem;
    margin: 0;
    font-size: 0.7rem;
    flex-shrink: 0;
    min-height: auto;
    min-width: auto;
    height: 24px;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.finish-cart-totals { font-size: 0.95rem; }
.finish-cart .fw-bold { font-size: 1.03rem; }

/* Make modal body more compact and readable */
.finish-modal .modal-body { padding-bottom: 0.5rem; }

/* About Us Section */
section.about-us {
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(107, 68, 35, 0.08);
    border: 1px solid #E8DCC8;
    margin-bottom: 32px;
}

section.about-us h2 {
    font-weight: 700;
    color: #6B4423; /* Marrom Chocolate */
    font-size: 1.8em;
}

section.about-us .lead {
    font-weight: 500;
    color: #8B7355; /* Marrom Médio */
    font-size: 1.05em;
}

section.about-us p {
    font-weight: 400;
    line-height: 1.8;
    color: #6B4423; /* Marrom Chocolate */
}

/* Restrição do tamanho da imagem dentro do modal de detalhes
   Evita que imagens muito grandes explodam a visualização ao clicar no item */
.details-modal .modal-body img {
    /* Regras fortes para garantir que imagens não fiquem gigantes no modal */
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 40vh !important; /* mais restrito: 40% da altura da viewport */
    object-fit: contain !important;
    display: block;
    margin: 0 auto 1rem;
    border-radius: 6px;
}

/* Forçar override também para imagens que possuem a classe utilitária .w-100 */
.details-modal .modal-body img.w-100 {
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 40vh !important;
}

/* Em telas pequenas, limitar ainda mais para não ocupar a maior parte da tela */
@media (max-width: 480px) {
    .details-modal .modal-body img,
    .details-modal .modal-body img.w-100 {
        max-height: 30vh !important; /* 30% da altura da viewport em mobile */
    }
}

/* Order Info Banner */
.order-info-banner {
    background-color: #FFFBF0; /* Light cream color */
    color: #5C3D2E; /* Dark brown text */
    border: 1px solid #E0D8D4; /* Soft border */
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(92, 61, 46, 0.08);
}

/* Recadinho do Mauf Card */
.recadinho-card {
    background: #FFFAF5;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(107, 68, 35, 0.08);
    border: 1px solid #E8DCC8;
    padding: 20px;
}

.recadinho-card ul li {
    color: #6B4423; /* Marrom Chocolate */
    font-weight: 500;
    line-height: 1.8;
    margin-bottom: 12px;
    font-size: 15px;
}

.recadinho-card ul li i {
    color: #E67E50; /* Coral */
    width: 20px;
    text-align: center;
}

.general-notes .card-body {
    background-color: #f8f4e3; /* Light beige */
    border-radius: 10px;
    padding: 20px;
    margin: 0 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    color: #5a4a42; /* Dark brown text */
}

.general-notes .card-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.general-notes .card-body ul li {
    margin-bottom: 10px;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
}

.general-notes .card-body ul li i {
    margin-right: 10px;
    color: #a0522d; /* Sienna brown for icons */
    font-size: 1.2em;
    flex-shrink: 0;
}

.general-notes .card-body ul li strong {
    color: #8b4513; /* Saddle brown for strong text */
}

.general-notes .card-body ul li:last-child {
    margin-bottom: 0;
}

.general-notes h2 {
    color: #8b4513; /* Saddle brown for the title */
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.8em;
}

/* Disabled/footer link when no WhatsApp/Instagram configured */
.disabled-link {
    pointer-events: none;
    opacity: 0.6;
    color: inherit !important;
    text-decoration: none !important;
}

/* Success & Info Button Colors */
.btn-success {
    background-color: #2D6A4F; /* Verde Natural */
    border-color: #2D6A4F;
    color: #FFFFFF;
    min-height: 44px;
}
.btn-success:hover {
    background-color: #224B3A;
    border-color: #224B3A;
    transform: translateY(-2px);
}

.btn-outline-primary {
    color: #E67E50; /* Coral */
    border-color: #E67E50;
    min-height: 44px;
}
.btn-outline-primary:hover {
    background-color: #E67E50;
    border-color: #E67E50;
    color: #FFFFFF;
}

/* SweetAlert2 styling to match site theme */
.swal2-popup {
    font-family: 'Quicksand', sans-serif !important;
    background: #FFFFFF !important;
    color: #6B4423 !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(107,68,35,0.08) !important;
    padding: 22px !important;
}
.swal2-title {
    font-weight: 700 !important;
    color: #6B4423 !important;
    font-size: 1.25rem !important;
}
.swal2-html-container {
    color: #8B7355 !important;
    font-size: 0.97rem !important;
}
.swal2-textarea {
    background-color: #FFFAF5 !important;
    border: 1px solid #E8DCC8 !important;
    color: #6B4423 !important;
    padding: 10px 12px !important;
    border-radius: 8px !important;
    font-family: 'Quicksand', sans-serif !important;
    resize: vertical !important;
}
.swal2-confirm {
    background-color: #E67E50 !important; /* Coral */
    border: none !important;
    color: #FFFFFF !important;
    border-radius: 10px !important;
    padding: 8px 14px !important;
    font-weight: 700 !important;
}
.swal2-cancel {
    background-color: transparent !important;
    border: 1px solid #E67E50 !important;
    color: #E67E50 !important;
    border-radius: 10px !important;
    padding: 8px 14px !important;
}
.swal2-actions {
    display: flex !important;
    justify-content: center !important;
    gap: 12px !important;
}

/* Make SweetAlert icons use site colors */
.swal2-icon .swal2-success-line, .swal2-icon.swal2-info, .swal2-icon.swal2-warning {
    color: #E67E50 !important;
}

/* Back to Top Button */
.back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    padding: 0;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #E67E50, #D4663B);
    border: none;
    color: white;
}

.back-to-top-btn:hover {
    background: linear-gradient(135deg, #D4663B, #C0562D);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    transform: translateY(-3px);
}

.back-to-top-btn.show {
    display: flex;
}

@media (max-width: 768px) {
    .back-to-top-btn {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}