:root {
    --primary: #FFD700;
    --primary-dark: #e6c200;
    --primary-soft: rgba(255, 215, 0, 0.15);
    --bg: #f8f9fc;
    --bg-warm: #FFFEF5;
    --secondary: #1a1a2e;
    --secondary-soft: #2d2d44;
    --white: #ffffff;
    --gray: #6b7280;
    --gray-light: #e5e7eb;
    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.12);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.12);
    --warning: #f59e0b;
    --info: #3b82f6;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.1);
}

* { box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    margin: 0;
    color: var(--secondary);
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app-header {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-soft) 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 56px;
}
.app-header-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 600px;
    width: 100%;
    justify-content: center;
    padding-right: 130px;
    padding-left: 10px;
}
@media (max-width: 400px) {
    .app-header-inner {
        padding-right: 110px;
        gap: 8px;
    }
    .store-avatar-header {
        width: 38px;
        height: 38px;
    }
    .store-avatar-placeholder {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    .app-header h1 {
        font-size: 1.1rem;
    }
}
.store-avatar-header {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    flex-shrink: 0;
}
.store-avatar-placeholder {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.2rem;
    border: 2px solid var(--primary);
    flex-shrink: 0;
}
.app-header h1 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.02em;
}
.app-header h1 .brand-accent {
    color: var(--primary);
}
.header-actions {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}
.header-actions .btn-icon-header {
    background: rgba(255,255,255,0.15);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: var(--white);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background 0.2s;
}
.header-actions .btn-icon-header:active { background: rgba(255,255,255,0.25); }

.container { padding: 16px; max-width: 600px; margin: 0 auto; }

.page-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}
.page-title-row h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary);
    letter-spacing: -0.02em;
}

.sticky-toolbar {
    position: sticky;
    top: 56px;
    z-index: 50;
    background: var(--bg);
    padding-top: 10px;
    padding-bottom: 2px;
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
}
.search-box {
    position: relative;
    margin-bottom: 14px;
}
.search-box input {
    width: 100%;
    padding: 14px 48px 14px 44px;
    border: 1px solid var(--gray-light);
    border-radius: 14px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.search-box input::placeholder { color: var(--gray); }
.search-box .icon-search {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 1rem;
    pointer-events: none;
}
.search-box .icon-clear {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
    display: none;
}
.search-box .icon-clear.visible { display: block; }

.categories-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.category-section-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--secondary);
    margin: 18px 0 10px;
    padding-top: 4px;
    letter-spacing: -0.01em;
}
.category-section-title:first-child {
    margin-top: 6px;
}
.categories {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    scroll-behavior: smooth;
}
.categories::-webkit-scrollbar { display: none; }
.cat-hamburger {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--gray-light);
    background: var(--white);
    color: var(--secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: all 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.cat-hamburger:active {
    background: var(--primary-soft);
    border-color: var(--primary);
}
.cat-btn {
    background: var(--white);
    border: 1px solid var(--gray-light);
    padding: 10px 18px;
    border-radius: 12px;
    white-space: nowrap;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--secondary);
    transition: all 0.2s;
    flex-shrink: 0;
}
.cat-btn:hover { border-color: var(--primary); color: var(--primary-dark); }
.cat-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--secondary);
    font-weight: 700;
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    margin-bottom: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.04);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-hover); }
.card:active { transform: scale(0.99); }
.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--gray-light);
}
.card-body { padding: 16px; }
.price-container { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.price {
    color: var(--secondary);
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}
.price-old {
    text-decoration: line-through;
    color: var(--gray);
    font-size: 0.95rem;
}
.price-promo { color: var(--success); }
.promo-badge {
    background: var(--danger);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.promo-badge.top {
    background: var(--warning);
    color: var(--secondary);
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    justify-content: center;
    align-items: flex-end;
}
.modal-overlay.active { display: flex; }
.bottom-sheet {
    background: var(--white);
    width: 100%;
    max-width: 600px;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.15);
    animation: slideUpModal 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}
@keyframes slideUpModal {
    from { transform: translateY(100%); opacity: 0.9; }
    to { transform: translateY(0); opacity: 1; }
}
.close-modal-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0,0,0,0.08);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--secondary);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.close-modal-btn:hover { background: rgba(0,0,0,0.12); }
.modal-img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    border-radius: 24px 24px 0 0;
    background: var(--gray-light);
}
.modal-content { padding: 10px; }
.modal-content h2 {
    font-size: 1.25rem;
    margin: 0 0 8px;
}
.modal-content h3 {
    font-size: 1rem;
    margin: 0 0 4px;
    line-height: 1.3;
}
.modal-content p {
    font-size: 0.75rem;
    line-height: 1.3;
    margin: 0 0 6px;
    color: var(--gray);
}
.modal-content .price-container {
    margin-bottom: 6px;
}
.modal-content .price {
    font-size: 1.1rem;
}
.modal-content .qty-control {
    margin-top: 6px;
}
.modal-content .obs-area {
    margin-top: 6px;
    min-height: 50px;
    padding: 8px;
    font-size: 0.85rem;
}
.modal-content .addons-section {
    margin-top: 8px;
    padding-top: 8px;
}
.modal-content .addon-row {
    margin-bottom: 6px;
    font-size: 0.85rem;
}
.modal-content .btn {
    margin-top: 8px;
    padding: 10px;
    font-size: 0.95rem;
}
.modal-scroll-content { flex: 1; overflow-y: auto; overflow-x: hidden; }
.modal-footer-fixed { padding: 10px; border-top: 1px solid var(--gray-light); background: var(--white); position: sticky; bottom: 0; z-index: 5; }
.bottom-sheet { display: flex; flex-direction: column; }
#modal-dynamic-content { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.qty-control {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg);
    border-radius: 14px;
    padding: 6px;
    width: fit-content;
}
.qty-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--white);
    color: var(--secondary);
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: background 0.2s;
}
.qty-btn:hover { background: var(--primary-soft); }
.qty-btn:active { background: var(--primary); }
.qty-val { font-weight: 700; min-width: 28px; text-align: center; font-size: 1.1rem; }
.addons-section {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--gray-light);
    display: none;
}
.addons-section.has-items { display: block; }
.addon-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9rem;
}
.addon-info { flex: 1; }
.obs-area {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    box-sizing: border-box;
    resize: vertical;
    min-height: 60px;
}
.obs-area:focus { outline: none; border-color: var(--primary); }

.btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    padding: 16px;
    width: 100%;
    font-weight: 700;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 12px;
    font-size: 1.05rem;
    font-family: inherit;
    color: var(--secondary);
}
.btn:hover { box-shadow: 0 4px 14px rgba(255, 215, 0, 0.4); }
.btn:active { transform: scale(0.98); }
.btn-sm { padding: 8px 14px; width: auto; font-size: 0.9rem; }
.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--secondary);
}

.view { display: none; animation: slideUp 0.3s ease-out; }
.view.active { display: block; }
@keyframes slideUp {
    from { transform: translateY(16px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--gray-light);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
    z-index: 90;
}
.nav-link {
    border: none;
    background: none;
    color: var(--gray);
    text-align: center;
    font-size: 0.8rem;
    font-weight: 500;
    flex: 1;
    padding: 8px 4px;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}
.nav-link i { font-size: 1.4rem; display: block; margin-bottom: 4px; }
.nav-link.active { color: var(--secondary); font-weight: 700; }
.nav-link.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
}

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--secondary);
}
.form-group input,
.form-group select {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    box-sizing: border-box;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}
.form-group input.invalid { border-color: var(--danger); }

#loader {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999;
    gap: 16px;
}
#loader .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loader .loader-text { font-size: 1rem; color: var(--gray); font-weight: 500; }

.badge {
    background: var(--danger);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 700;
    position: absolute;
    top: -4px;
    left: 50%;
    margin-left: 12px;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    margin-top: 14px;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gray);
}
.status-step.active { color: var(--success); font-weight: 700; }
.status-step.done { color: var(--success); }
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.status-badge.recebido { background: #fef3c7; color: #b45309; }
.status-badge.preparo { background: #dbeafe; color: #1d4ed8; }
.status-badge.entrega { background: #ffedd5; color: #c2410c; }
.status-badge.concluido { background: var(--success-soft); color: var(--success); }
.status-badge.cancelado { background: var(--gray-light); color: var(--gray); }

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
}
.empty-state i { font-size: 3.5rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state p { margin: 0 0 8px; font-size: 1.05rem; }
.empty-state small { font-size: 0.9rem; }

.skeleton-line {
    height: 16px;
    background: linear-gradient(90deg, var(--gray-light) 25%, #f3f4f6 50%, var(--gray-light) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.2s ease-in-out infinite;
    border-radius: 8px;
    margin-bottom: 12px;
}
.skeleton-card { height: 180px; border-radius: var(--radius); margin-bottom: 14px; }
.skeleton-card .skeleton-line { margin: 12px; }
@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Skeleton menu product cards */
.skeleton-product-card {
    display: flex;
    align-items: stretch;
    margin-bottom: 10px;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: var(--shadow);
}
.skeleton-product-card .skeleton-img {
    width: 115px;
    min-height: 115px;
    flex-shrink: 0;
    background: linear-gradient(90deg, var(--gray-light) 25%, #f3f4f6 50%, var(--gray-light) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.2s ease-in-out infinite;
}
.skeleton-product-card .skeleton-body {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}
.skeleton-product-card .skeleton-body .skeleton-line {
    margin-bottom: 0;
}

/* Cart badge bounce animation */
@keyframes badgeBounce {
    0% { transform: scale(1); }
    25% { transform: scale(1.5); }
    50% { transform: scale(0.85); }
    75% { transform: scale(1.25); }
    100% { transform: scale(1); }
}
.badge-bounce {
    animation: badgeBounce 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* Pull-to-refresh indicator */
.ptr-indicator {
    position: fixed;
    top: 56px;
    left: 50%;
    transform: translateX(-50%) translateY(-60px);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99;
    transition: opacity 0.2s;
    color: var(--primary-dark);
    font-size: 1.1rem;
    opacity: 0;
    pointer-events: none;
}
.ptr-indicator.refreshing i {
    animation: spin 0.8s linear infinite;
}

.toast-container {
    position: fixed;
    bottom: calc(80px + env(safe-area-inset-bottom));
    left: 16px;
    right: 16px;
    max-width: 568px;
    margin: 0 auto;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: var(--shadow-hover);
    pointer-events: auto;
    animation: toastIn 0.3s ease-out;
}
@keyframes toastIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.toast.success { background: var(--success); color: white; }
.toast.error { background: var(--danger); color: white; }
.toast.info { background: var(--info); color: white; }

.order-card-detail {
    margin-top: 10px;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--secondary);
}
.order-card-detail summary { cursor: pointer; font-weight: 600; list-style: none; }
.order-card-detail summary::-webkit-details-marker { display: none; }
.order-card-detail[open] summary { margin-bottom: 8px; }

.order-store-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    flex-shrink: 0;
    background: var(--primary-soft);
}
.order-toggle-btn {
    background: none;
    border: 1px solid var(--gray-light);
    color: var(--gray);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    font-family: inherit;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.order-toggle-btn:hover { border-color: var(--primary); color: var(--secondary); }
.order-detail-expand {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--gray-light);
    animation: slideUp 0.3s ease-out;
}
.order-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}
.order-detail-row > i {
    margin-top: 3px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}
.cep-input-group { position: relative; }
.cep-input-group .cep-loading {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    display: none;
}
.cep-input-group .cep-loading.active { display: block; }

.cart-empty-illustration { font-size: 4rem; margin-bottom: 16px; opacity: 0.4; }
.d-none { display: none !important; }

/* Pickup toggle */
.pickup-toggle-wrap {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; background: var(--white); border-radius: var(--radius);
    border: 1px solid var(--gray-light); box-shadow: var(--shadow); margin-bottom: 14px;
}
.pickup-toggle-label { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 0.95rem; }
.pickup-toggle-label i { color: var(--primary-dark); font-size: 1.1rem; }
.toggle-switch { position: relative; width: 50px; height: 28px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; cursor: pointer; inset: 0; background: var(--gray-light);
    border-radius: 28px; transition: 0.3s;
}
.toggle-slider::before {
    content: ''; position: absolute; width: 22px; height: 22px; left: 3px; bottom: 3px;
    background: var(--white); border-radius: 50%; transition: 0.3s; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); }

/* Pickup address info */
.pickup-address-info {
    display: none; padding: 12px 16px; background: var(--primary-soft); border-radius: var(--radius-sm);
    margin-top: 10px; font-size: 0.9rem; color: var(--secondary); line-height: 1.4;
    border: 1px dashed var(--primary-dark); animation: slideUp 0.3s ease-out;
}
.pickup-address-info.visible { display: flex; align-items: flex-start; gap: 10px; }
.pickup-address-info i { color: var(--primary-dark); font-size: 1rem; margin-top: 2px; flex-shrink: 0; }

/* Payment method selector */
.payment-methods { display: flex; gap: 8px; flex-wrap: wrap; }
.payment-method-btn {
    flex: 1; min-width: 90px; padding: 12px 8px; border: 2px solid var(--gray-light);
    border-radius: 12px; background: var(--white); cursor: pointer; text-align: center;
    font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--secondary);
    transition: all 0.2s; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.payment-method-btn i { font-size: 1.3rem; }
.payment-method-btn:hover { border-color: var(--primary); }
.payment-method-btn.selected { border-color: var(--primary); background: var(--primary-soft); }
.troco-field { margin-top: 10px; display: none; animation: slideUp 0.3s ease-out; }
.troco-field.visible { display: block; }

/* Delivery fee line */
.fee-line { display: flex; justify-content: space-between; align-items: center; font-size: 0.95rem; color: var(--gray); margin-bottom: 6px; }
.fee-line .fee-value { font-weight: 600; }
.fee-line .fee-free { color: var(--success); font-weight: 700; }

/* Delivery fee details and info */
#delivery-fee-details {
    border-left: 3px solid var(--primary);
    padding-left: 8px;
    margin-left: 2px;
}

#delivery-fee-details:empty,
#delivery-fee-info:empty {
    display: none !important;
}

#delivery-fee-info {
    border: 1px solid var(--primary);
    font-weight: 600;
}

/* Dark mode support for delivery fee elements */
.dark-mode #delivery-fee-details {
    border-left-color: var(--primary);
    color: var(--gray);
}

.dark-mode #delivery-fee-info {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

/* Cart item quantity controls */
.cart-item-qty {
    display: flex; align-items: center; gap: 6px; margin-top: 6px;
}
.cart-qty-btn {
    width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--gray-light);
    background: var(--white); color: var(--secondary); font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 0.9rem;
    transition: all 0.2s;
}
.cart-qty-btn:hover { border-color: var(--primary); background: var(--primary-soft); }
.cart-qty-val { font-weight: 700; min-width: 20px; text-align: center; font-size: 0.9rem; }

/* Product image placeholder */
.card-img-placeholder {
    width: 100%; height: 200px; background: linear-gradient(135deg, var(--gray-light) 0%, #f3f4f6 100%);
    display: flex; align-items: center; justify-content: center; color: var(--gray); font-size: 2.5rem;
}
.product-card .card-img-placeholder {
    width: 115px; height: auto; min-height: 115px; flex-shrink: 0;
    border-radius: var(--radius) 0 0 var(--radius); font-size: 1.8rem;
}

/* Success screen overlay */
.success-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px); z-index: 3000; justify-content: center; align-items: center;
}
.success-overlay.active { display: flex; }
.success-card {
    background: var(--white); border-radius: 24px; padding: 36px 28px 28px;
    max-width: 400px; width: 92%; text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25); animation: scaleIn 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}
.success-check {
    width: 72px; height: 72px; border-radius: 50%; background: var(--success-soft);
    color: var(--success); display: flex; align-items: center; justify-content: center;
    font-size: 2rem; margin: 0 auto 18px; animation: checkBounce 0.6s ease-out 0.3s both;
}
@keyframes checkBounce {
    0% { transform: scale(0); } 50% { transform: scale(1.2); } 100% { transform: scale(1); }
}
.success-card h3 { margin: 0 0 6px; font-size: 1.3rem; font-weight: 800; color: var(--secondary); }
.success-card .order-id-display { color: var(--primary-dark); font-weight: 700; font-size: 1rem; margin-bottom: 12px; }
.success-card .success-summary { text-align: left; background: var(--bg); border-radius: 12px; padding: 14px; margin: 14px 0; font-size: 0.9rem; }
.success-card .success-summary .sum-row { display: flex; justify-content: space-between; margin-bottom: 4px; }
.success-card .success-summary .sum-total { font-weight: 700; font-size: 1.05rem; border-top: 1px solid var(--gray-light); padding-top: 8px; margin-top: 6px; }

/* Coupon field */
.coupon-wrapper {
    display: flex; gap: 8px; margin-bottom: 14px;
}
.coupon-wrapper input {
    flex: 1; padding: 12px 14px; border: 1px solid var(--gray-light); border-radius: var(--radius-sm);
    font-size: 0.95rem; font-family: inherit; text-transform: uppercase;
}
.coupon-wrapper input:focus { outline: none; border-color: var(--primary); }
.coupon-wrapper .btn-coupon {
    padding: 12px 16px; border: none; background: var(--secondary); color: var(--white);
    border-radius: var(--radius-sm); font-weight: 700; font-size: 0.9rem; cursor: pointer;
    font-family: inherit; white-space: nowrap; transition: opacity 0.2s;
}
.coupon-wrapper .btn-coupon:active { opacity: 0.8; }
.coupon-applied {
    display: none; padding: 10px 14px; background: linear-gradient(135deg, var(--success-soft) 0%, rgba(76, 175, 80, 0.08) 100%); 
    border-radius: var(--radius-sm); border: 1px solid var(--success);
    color: var(--text); font-size: 0.88rem; font-weight: 500; margin-bottom: 14px;
    align-items: center; gap: 6px; box-shadow: 0 2px 8px rgba(76, 175, 80, 0.15);
}
.coupon-applied.visible { display: flex; }
.coupon-applied i.fa-tag { color: var(--success); font-size: 0.9rem; }
.coupon-applied strong { color: var(--text); font-weight: 700; }

/* Rating stars */
.rating-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px); z-index: 3500; justify-content: center; align-items: center;
}
.rating-overlay.active { display: flex; }
.rating-card {
    background: var(--white); border-radius: 20px; padding: 28px 24px;
    max-width: 360px; width: 90%; text-align: center;
    box-shadow: 0 16px 48px rgba(0,0,0,0.2); animation: scaleIn 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.rating-card h3 { margin: 0 0 4px; font-size: 1.1rem; font-weight: 700; }
.rating-card p { margin: 0 0 16px; color: var(--gray); font-size: 0.9rem; }
.stars-row { display: flex; justify-content: center; gap: 8px; margin-bottom: 14px; }
.star-btn {
    background: none; border: none; font-size: 2rem; cursor: pointer; color: var(--gray-light);
    transition: color 0.15s, transform 0.15s;
}
.star-btn.active { color: var(--warning); transform: scale(1.1); }
.star-btn:hover { color: var(--warning); }
.rating-comment {
    width: 100%; padding: 10px 12px; border: 1px solid var(--gray-light); border-radius: var(--radius-sm);
    font-family: inherit; font-size: 0.95rem; resize: vertical; min-height: 60px; box-sizing: border-box;
}
.rating-comment:focus { outline: none; border-color: var(--primary); }

/* Share button */
.share-btn {
    background: rgba(255,255,255,0.15); border: none; width: 38px; height: 38px;
    border-radius: 50%; color: var(--white); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem; transition: background 0.2s;
}
.share-btn:active { background: rgba(255,255,255,0.25); }

/* Dark mode */
.dark-mode {
    --bg: #121212; --bg-warm: #1a1a1a; --white: #1e1e1e; --secondary: #f0f0f0;
    --secondary-soft: #e0e0e0; --gray: #9ca3af; --gray-light: #333;
    --shadow: 0 4px 20px rgba(0,0,0,0.3); --shadow-hover: 0 8px 30px rgba(0,0,0,0.4);
}
.dark-mode body, .dark-mode { color: #f0f0f0; }
.dark-mode .app-header { background: linear-gradient(135deg, #0d0d1a 0%, #1a1a2e 100%); }
.dark-mode .bottom-nav { background: #1e1e1e; border-top-color: #333; }
.dark-mode .card, .dark-mode .order-card { background: #1e1e1e; border-color: #333; }
.dark-mode .store-banner { background: linear-gradient(135deg, #0d0d1a 0%, #1a1a2e 100%); border: 1px solid #333; }
.dark-mode .sb-name { color: var(--primary); }
.dark-mode .sb-status { color: #e0e0e0; }
.dark-mode .sb-min-order { color: var(--gray); }
.dark-mode .search-box input { background: #2a2a2a; color: #f0f0f0; border-color: #444; }
.dark-mode .cat-btn { background: #2a2a2a; border-color: #444; color: #e0e0e0; }
.dark-mode .cat-btn.active { background: var(--primary); color: #1a1a2e; }
.dark-mode .form-group input, .dark-mode .form-group select { background: #2a2a2a; color: #f0f0f0; border-color: #444; }
.dark-mode .obs-area { background: #2a2a2a; color: #f0f0f0; border-color: #444; }
.dark-mode .bottom-sheet, .dark-mode .continue-modal, .dark-mode .success-card,
.dark-mode .rating-card, .dark-mode .cat-drawer { background: #1e1e1e; }
.dark-mode .payment-method-btn { background: #2a2a2a; border-color: #444; color: #e0e0e0; }
.dark-mode .payment-method-btn.selected { background: rgba(255,215,0,0.15); }
.dark-mode .qty-control { background: #2a2a2a; }
.dark-mode .qty-btn { background: #333; color: #f0f0f0; }

/* Dark mode toggle */
.theme-toggle {
    background: rgba(255,255,255,0.15); border: none; width: 38px; height: 38px;
    border-radius: 50%; color: var(--white); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem; transition: background 0.2s;
}
.theme-toggle:active { background: rgba(255,255,255,0.25); }

/* LGPD footer */
.lgpd-footer {
    text-align: center; padding: 16px; font-size: 0.78rem; color: var(--gray);
    border-top: 1px solid var(--gray-light); margin-top: 20px;
}
.lgpd-footer a { color: var(--primary-dark); text-decoration: underline; }

/* Estimated time badge */
.est-time-badge {
    display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px;
    background: var(--primary-soft); border-radius: 20px; font-size: 0.82rem;
    font-weight: 600; color: var(--primary-dark); margin-top: 6px;
}

/* Compact horizontal product cards */
.product-card {
    display: flex;
    align-items: stretch;
    margin-bottom: 10px;
}
.product-card .card-img {
    width: 100px;
    height: 100px;
    min-height: 100px;
    flex-shrink: 0;
    border-radius: var(--radius) 0 0 var(--radius);
    object-fit: cover;
}
.product-card .card-body {
    padding: 8px 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.product-card .card-body h4 {
    font-size: 0.88rem !important;
    margin: 0 !important;
    line-height: 1.25;
}
.product-card .card-body p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 2px 0 4px !important;
    font-size: 0.75rem !important;
    line-height: 1.25 !important;
}
.product-card .card-body small {
    font-size: 0.68rem !important;
}
.product-card .price {
    font-size: 0.95rem;
}
.product-card .price-container {
    margin-bottom: 2px;
}
.product-card .promo-badge {
    font-size: 0.6rem;
    padding: 2px 5px;
}

/* Category drawer */
.cat-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
}
.cat-drawer-overlay.active {
    display: flex;
    justify-content: center;
    align-items: flex-end;
}
.cat-drawer {
    background: var(--white);
    width: 100%;
    max-width: 600px;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.15);
    animation: slideUpModal 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    max-height: 70vh;
    overflow-y: auto;
    padding: 24px 20px;
}
.cat-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.cat-drawer-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
}
.cat-drawer-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    cursor: pointer;
    font-size: 1rem;
    color: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.cat-drawer-close:active { background: var(--gray-light); }
.cat-drawer-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cat-drawer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-radius: 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    color: var(--secondary);
    transition: all 0.15s;
    text-align: left;
    width: 100%;
}
.cat-drawer-item:hover { background: var(--bg); }
.cat-drawer-item.active {
    background: var(--primary);
    font-weight: 700;
}
.cat-drawer-item i {
    width: 20px;
    text-align: center;
    color: var(--gray);
    font-size: 0.9rem;
}
.cat-drawer-item.active i { color: var(--secondary); }

/* Continue / finalize modal */
.continue-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 2500;
    justify-content: center;
    align-items: center;
}
.continue-overlay.active { display: flex; }
.continue-modal {
    background: var(--white);
    border-radius: 20px;
    padding: 32px 24px 24px;
    max-width: 340px;
    width: 90%;
    text-align: center;
    box-shadow: 0 16px 48px rgba(0,0,0,0.2);
    animation: scaleIn 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.continue-modal .check-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--success-soft);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 14px;
}
.continue-modal h3 {
    margin: 0 0 4px;
    font-size: 1.1rem;
    font-weight: 700;
}
.continue-modal p {
    margin: 0 0 20px;
    color: var(--gray);
    font-size: 0.9rem;
}
.continue-modal .modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.btn-keep-shopping {
    padding: 13px;
    border-radius: 12px;
    border: 2px solid var(--gray-light);
    background: transparent;
    color: var(--secondary);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}
.btn-keep-shopping:active { background: var(--bg); }
.btn-go-cart {
    padding: 13px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--secondary);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}
.btn-go-cart:active { transform: scale(0.98); }

/* Improved order cards */
.order-card {
    background: var(--white);
    border-radius: var(--radius);
    margin-bottom: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.04);
    transition: box-shadow 0.2s;
}
.order-card:hover { box-shadow: var(--shadow-hover); }
.order-card-top {
    padding: 16px 16px 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}
.order-card-content {
    padding: 0 16px 16px;
}
.order-timeline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 14px 4px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    position: relative;
    margin-top: 10px;
}
.order-timeline::before {
    content: '';
    position: absolute;
    top: 28px;
    left: 46px;
    right: 46px;
    height: 3px;
    background: var(--gray-light);
    z-index: 0;
}
.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    z-index: 1;
    flex: 1;
}
.timeline-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--white);
    border: 3px solid var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: transparent;
    transition: all 0.3s;
}
.timeline-step.done .timeline-dot {
    border-color: var(--success);
    background: var(--success);
    color: white;
}
.timeline-step.current .timeline-dot {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--secondary);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(255, 215, 0, 0); }
}
.timeline-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--gray);
    text-align: center;
}
.timeline-step.done .timeline-label { color: var(--success); }
.timeline-step.current .timeline-label { color: var(--secondary); font-weight: 700; }

.orders-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.orders-view-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
}
.auto-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    display: inline-block;
    animation: blink 2s infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.orders-subtitle {
    color: var(--gray);
    font-size: 0.88rem;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Store banner */
.store-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-soft) 100%);
    border-radius: var(--radius);
    margin-bottom: 14px;
    color: var(--white);
}
.store-banner img {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    object-fit: cover;
    border: 2px solid var(--primary);
    flex-shrink: 0;
}
.store-banner-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: var(--primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.5rem;
    border: 2px solid var(--primary);
    flex-shrink: 0;
}
.store-banner .sb-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 2px;
}
.store-banner .sb-status {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    transition: color 0.3s ease;
}
.store-banner .sb-status.online {
    color: var(--success);
}
.store-banner .sb-status.offline {
    color: var(--danger);
}
.store-banner .sb-status i {
    color: var(--success);
    margin-right: 3px;
}
.store-banner .sb-status.online i {
    color: var(--success);
}
.store-banner .sb-status.offline i {
    color: var(--danger);
}
.store-banner .sb-min-order {
    font-size: 0.78rem;
    color: var(--primary);
    font-weight: 600;
    margin-top: 2px;
}
.required-asterisk {
    color: var(--danger);
    font-weight: 700;
    margin-left: 1px;
}
.required-note {
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 2px;
}
.required-note .required-asterisk {
    margin-left: 0;
    margin-right: 2px;
}
.min-order-warning {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--warning);
    color: var(--secondary);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 10px;
}
.min-order-warning i {
    font-size: 1rem;
    flex-shrink: 0;
}

/* Free delivery banner - promotional banner showing how much is needed for free delivery */
.free-delivery-banner {
    display: none;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: var(--radius);
    margin-bottom: 16px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    animation: slideUp 0.4s ease-out;
}
.free-delivery-banner.visible {
    display: flex;
}
.free-delivery-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    font-size: 1.4rem;
}
.free-delivery-content {
    flex: 1;
}
.free-delivery-title {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    margin-bottom: 6px;
}
.free-delivery-title span {
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.free-delivery-progress {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}
.free-delivery-bar {
    height: 100%;
    background: white;
    border-radius: 4px;
    transition: width 0.5s ease-out;
    width: 0%;
}
.free-delivery-text {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* Free delivery achieved banner */
.free-delivery-achieved {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border-radius: var(--radius);
    margin-bottom: 16px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    animation: slideUp 0.4s ease-out;
}
.free-delivery-achieved.visible {
    display: flex;
}
.free-delivery-achieved-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #059669;
    font-size: 1.3rem;
}
.free-delivery-achieved-text {
    flex: 1;
    font-size: 0.95rem;
    color: var(--secondary);
    font-weight: 600;
}
.free-delivery-achieved-text strong {
    color: #059669;
    font-weight: 800;
}

/* Dark mode support for free delivery banners */
.dark-mode .free-delivery-achieved {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
}
.dark-mode .free-delivery-achieved-icon {
    background: #1a1a1a;
    color: #10b981;
}
.dark-mode .free-delivery-achieved-text {
    color: #1a1a1a;
}
.dark-mode .free-delivery-achieved-text strong {
    color: #059669;
}

/* Compact version for menu/cardapio */
.free-delivery-banner--compact {
    padding: 12px 14px;
    margin-bottom: 14px;
}
.free-delivery-banner--compact .free-delivery-icon {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
}
.free-delivery-banner--compact .free-delivery-title {
    font-size: 0.9rem;
    margin-bottom: 4px;
}
.free-delivery-banner--compact .free-delivery-progress {
    height: 6px;
    margin-bottom: 0;
}

.free-delivery-achieved--compact {
    padding: 10px 14px;
    margin-bottom: 14px;
}
.free-delivery-achieved--compact .free-delivery-achieved-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
}
.free-delivery-achieved--compact .free-delivery-achieved-text {
    font-size: 0.85rem;
}

#store-not-found {
    display: none;
    position: fixed;
    inset: 0;
    background: linear-gradient(160deg, var(--secondary) 0%, #2d2d44 50%, #1a1a2e 100%);
    z-index: 998;
    overflow-y: auto;
    color: var(--white);
}
#store-not-found.active { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; min-height: 100dvh; padding: 0 6px; }
.snf-card {
    background: rgba(255,255,255,0.07);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    padding: 12px 10px;
    max-width: 440px;
    width: 99%;
    margin-top: 50px;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
}
.snf-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,215,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-size: 1.25rem;
    color: var(--primary);
}
.snf-card h2 { margin: 0 0 3px; font-size: 1rem; font-weight: 800; color: var(--primary); letter-spacing: -0.02em; }
.snf-card p { margin: 0 0 5px; font-size: 0.8rem; color: rgba(255,255,255,0.75); line-height: 1.3; }
.snf-card .snf-id { color: var(--primary); font-weight: 700; }
.snf-divider { width: 28px; height: 2px; background: var(--primary); border-radius: 2px; margin: 10px auto; opacity: 0.5; }
.snf-how { text-align: left; margin-top: 5px; }
.snf-how h3 { font-size: 0.85rem; font-weight: 700; margin: 0 0 6px; color: var(--primary); }
.snf-step { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 6px; }
.snf-step-num {
    width: 20px; height: 20px; border-radius: 50%; background: var(--primary); color: var(--secondary);
    font-weight: 800; font-size: 0.65rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.snf-step-text { font-size: 0.75rem; color: rgba(255,255,255,0.8); line-height: 1.25; }
.snf-step-text strong { color: var(--white); }
.snf-footer { margin-top: 10px; font-size: 0.65rem; color: rgba(255,255,255,0.4); }
.snf-footer a { color: var(--primary); text-decoration: none; }

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: calc(90px + env(safe-area-inset-bottom));
    right: 18px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--secondary);
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 89;
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px);
    transition: opacity 0.3s, transform 0.3s;
}
.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.back-to-top:active { transform: scale(0.92); }

/* Category item count badge */
.cat-count {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--gray);
    margin-left: 2px;
    vertical-align: sub;
    line-height: 1;
}
.cat-btn.active .cat-count { color: var(--secondary); }
.cat-drawer-count {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gray);
    margin-left: auto;
}
.cat-drawer-item.active .cat-drawer-count { color: var(--secondary); }

/* Push notification banner */
.push-banner {
    display: none; padding: 12px 16px; background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-soft) 100%);
    border-radius: var(--radius); margin-bottom: 14px; align-items: center; gap: 12px;
    cursor: pointer; animation: slideUp 0.3s ease-out; border: 1px solid rgba(255,215,0,0.15);
}
.push-banner.visible { display: flex; }
.push-banner .push-bell {
    width: 42px; height: 42px; border-radius: 50%; background: var(--primary-soft);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    color: var(--primary); font-size: 1.1rem;
}
.push-banner .push-text { flex: 1; color: var(--white); }
.push-banner .push-text strong { display: block; font-size: 0.95rem; margin-bottom: 2px; }
.push-banner .push-text small { color: rgba(255,255,255,0.65); font-size: 0.82rem; }
.push-banner .push-action {
    padding: 8px 16px; border-radius: 20px; border: none;
    background: var(--primary); color: var(--secondary); font-weight: 700;
    font-size: 0.82rem; cursor: pointer; font-family: inherit; white-space: nowrap;
    transition: transform 0.2s;
}
.push-banner .push-action:active { transform: scale(0.95); }
.push-enabled-badge {
    display: none; align-items: center; gap: 6px; padding: 8px 14px;
    background: var(--success-soft); border-radius: var(--radius-sm);
    font-size: 0.82rem; font-weight: 600; color: var(--success); margin-bottom: 14px;
}
.push-enabled-badge.visible { display: flex; }

/* PWA Install banner */
.install-banner {
    display: none; padding: 12px 16px; background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: var(--radius); margin-bottom: 14px; align-items: center; gap: 12px;
    animation: slideUp 0.3s ease-out; border: 1px solid rgba(255,255,255,0.1);
}
.install-banner.visible { display: flex; }
.install-banner .install-icon {
    width: 42px; height: 42px; border-radius: 50%; background: var(--primary-soft);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    color: var(--primary); font-size: 1.1rem;
}
.install-banner .install-text { flex: 1; color: #fff; }
.install-banner .install-text strong { display: block; font-size: 0.95rem; margin-bottom: 2px; }
.install-banner .install-text small { color: rgba(255,255,255,0.6); font-size: 0.82rem; }
.install-banner .install-action {
    padding: 8px 16px; border-radius: 20px; border: none;
    background: var(--primary); color: var(--secondary); font-weight: 700;
    font-size: 0.82rem; cursor: pointer; font-family: inherit; white-space: nowrap;
    transition: transform 0.2s; flex-shrink: 0;
}
.install-banner .install-action:active { transform: scale(0.95); }
.install-banner .install-dismiss {
    background: transparent; border: none; color: rgba(255,255,255,0.5);
    font-size: 1rem; cursor: pointer; padding: 4px; flex-shrink: 0; line-height: 1;
}
.install-banner .install-dismiss:hover { color: #fff; }

/* Order ETA and delay comfort */
.order-eta-badge {
    display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px;
    background: var(--primary-soft); border-radius: 20px; font-size: 0.78rem;
    font-weight: 600; color: var(--primary-dark); margin-top: 8px;
}
.order-eta-badge i { font-size: 0.72rem; }
.order-delay-comfort {
    display: flex; align-items: flex-start; gap: 8px; padding: 10px 14px;
    background: linear-gradient(135deg, #fff7ed 0%, #fffbeb 100%);
    border-radius: var(--radius-sm); margin-top: 8px;
    border: 1px solid rgba(245, 158, 11, 0.2); animation: slideUp 0.3s ease-out;
}
.order-delay-comfort i { color: var(--warning); font-size: 1rem; margin-top: 2px; flex-shrink: 0; }
.order-delay-comfort .delay-text { font-size: 0.82rem; line-height: 1.4; color: var(--secondary); }
.order-delay-comfort .delay-text strong { color: var(--warning); }
.dark-mode .order-delay-comfort {
    background: linear-gradient(135deg, #332b1a 0%, #2d2a1a 100%);
    border-color: rgba(245,158,11,0.15);
}

/* Related products in modal */
.related-products-section {
    margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--gray-light);
}
.related-products-section h4 {
    margin: 0 0 8px; font-size: 0.9rem; font-weight: 700; color: var(--secondary);
    display: flex; align-items: center; gap: 6px;
}
.related-products-section h4 i { color: var(--primary-dark); font-size: 0.8rem; }
.related-scroll {
    display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.related-scroll::-webkit-scrollbar { display: none; }
.related-card {
    flex-shrink: 0; width: 110px; background: var(--bg); border-radius: 10px;
    overflow: hidden; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0,0,0,0.04);
}
.related-card:hover { box-shadow: var(--shadow-hover); }
.related-card:active { transform: scale(0.97); }
.related-card-img {
    width: 100%; height: 70px; object-fit: cover; background: var(--gray-light);
}
.related-card-img-placeholder {
    width: 100%; height: 70px; background: linear-gradient(135deg, var(--gray-light) 0%, #f3f4f6 100%);
    display: flex; align-items: center; justify-content: center; color: var(--gray); font-size: 1.2rem;
}
.related-card-body { padding: 6px; display: flex; flex-direction: column; justify-content: space-between; height: calc(100% - 70px); }
.related-card-body .rc-name {
    font-size: 0.7rem; font-weight: 600; color: var(--secondary);
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden; line-height: 1.2; margin-bottom: 2px;
}
.related-card-body .rc-price {
    font-size: 0.75rem; font-weight: 800; color: var(--secondary);
}
.related-card-body .rc-price-promo { color: var(--success); }
.related-card-body .rc-old-price {
    font-size: 0.65rem; text-decoration: line-through; color: var(--gray); margin-left: 2px;
}
.related-card-body .rc-add-hint {
    font-size: 0.65rem; color: var(--primary-dark); font-weight: 600; margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   MEDIA QUERIES PARA MOBILE - FONTES E ELEMENTOS REDUZIDOS
   ═══════════════════════════════════════════════════════════════ */

@media screen and (max-width: 480px) {
    :root {
        --radius: 12px;
        --radius-sm: 8px;
    }
    
    body {
        font-size: 14px;
        line-height: 1.45;
    }
    
    .container {
        padding: 12px;
    }
    
    .app-header {
        padding: 12px 14px;
        min-height: 50px;
    }
    
    .app-header h1 {
        font-size: 1.15rem;
    }
    
    .store-avatar-header,
    .store-avatar-placeholder {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }
    
    .header-actions .btn-icon-header,
    .header-actions .share-btn,
    .theme-toggle {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }
    
    /* Cards de produto */
    .card {
        margin-bottom: 10px;
        border-radius: 12px;
    }
    
    .card-img {
        height: 160px;
    }
    
    .card-body {
        padding: 12px;
    }
    
    .price {
        font-size: 1.15rem;
    }
    
    .price-old {
        font-size: 0.85rem;
    }
    
    /* Modal/Bottom sheet */
    .modal-img {
        height: 200px;
    }
    
    .modal-content {
        padding: 16px;
    }
    
    .qty-btn {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }
    
    /* Botões */
    .btn {
        padding: 12px 14px;
        font-size: 0.95rem;
    }
    
    /* Formulários */
    .form-group input,
    .form-group select,
    .search-box input {
        padding: 12px 14px;
        font-size: 0.95rem;
    }
    
    /* Ajuste específico para search-box no mobile - evitar sobreposição da lupa */
    .search-box input {
        padding: 12px 40px 12px 40px;
    }
    
    .search-box .icon-search {
        left: 14px;
        font-size: 0.9rem;
    }
    
    .search-box .icon-clear {
        right: 12px;
        font-size: 0.9rem;
    }
    
    /* Categorias */
    .cat-btn {
        padding: 8px 14px;
        font-size: 0.88rem;
        border-radius: 10px;
    }
    
    .cat-hamburger {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }
    
    /* Cards de pedido */
    .order-card {
        margin-bottom: 10px;
        border-radius: 12px;
    }
    
    .order-card-top {
        padding: 12px;
    }
    
    .order-card-content {
        padding: 0 12px 12px;
    }
    
    .order-store-avatar {
        width: 36px;
        height: 36px;
    }
    
    .status-badge {
        font-size: 0.75rem;
        padding: 3px 8px;
    }
    
    /* Timeline */
    .order-timeline {
        padding: 10px 2px;
    }
    
    .timeline-dot {
        width: 22px;
        height: 22px;
        font-size: 0.55rem;
    }
    
    .timeline-label {
        font-size: 0.62rem;
    }
    
    /* Carrinho */
    .cart-item-qty {
        gap: 4px;
    }
    
    .cart-qty-btn {
        width: 26px;
        height: 26px;
        font-size: 0.85rem;
    }
    
    /* Bottom nav */
    .bottom-nav {
        padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    }
    
    .nav-link {
        font-size: 0.75rem;
        padding: 6px 2px;
    }
    
    .nav-link i {
        font-size: 1.25rem;
        margin-bottom: 3px;
    }
    
    .badge {
        font-size: 10px;
        padding: 1px 5px;
        top: -2px;
        margin-left: 10px;
    }
    
    /* Toast */
    .toast {
        padding: 12px 14px;
        font-size: 0.88rem;
    }
    
    /* Títulos */
    .page-title-row h2,
    .orders-view-header h2 {
        font-size: 1.25rem;
    }
    
    .category-section-title {
        font-size: 1rem;
        margin: 14px 0 8px;
    }
    
    /* Banner da loja */
    .store-banner {
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .store-banner img,
    .store-banner-placeholder {
        width: 50px;
        height: 50px;
        border-radius: 12px;
    }
    
    .store-banner .sb-name {
        font-size: 1rem;
    }
    
    .store-banner .sb-status {
        font-size: 0.75rem;
    }
    
    /* Payment methods */
    .payment-method-btn {
        min-width: 75px;
        padding: 10px 6px;
        font-size: 0.78rem;
    }
    
    .payment-method-btn i {
        font-size: 1.15rem;
    }
    
    /* Tracking */
    .tracking-section {
        margin-top: 8px;
    }
    
    .tracking-header {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    /* Cupom */
    .coupon-wrapper input,
    .coupon-wrapper .btn-coupon {
        padding: 10px 12px;
        font-size: 0.88rem;
    }
    
    /* Loader */
    #loader .spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
    
    #loader .loader-text {
        font-size: 0.9rem;
    }
    
    /* Carrinho vazio */
    .cart-empty-illustration {
        font-size: 3rem;
    }
    
    /* Estimativa de tempo */
    .est-time-badge {
        font-size: 0.75rem;
        padding: 5px 10px;
    }
    
    /* Related products */
    .related-card {
        width: 100px;
    }
    
    .related-card-img,
    .related-card-img-placeholder {
        height: 60px;
    }
    
    .related-card-body {
        padding: 5px;
    }
    
    .related-card-body .rc-name {
        font-size: 0.65rem;
    }
    
    .related-card-body .rc-price {
        font-size: 0.7rem;
    }
    
    .related-products-section h4 {
        font-size: 0.8rem;
    }
    
    /* Drawer de categorias */
    .cat-drawer {
        padding: 20px 16px;
    }
    
    .cat-drawer-header h3 {
        font-size: 1.05rem;
    }
    
    .cat-drawer-item {
        padding: 11px 14px;
        font-size: 0.92rem;
    }
    
    /* Modais de sucesso/avaliação */
    .success-card {
        padding: 28px 22px 22px;
    }
    
    .success-card h3 {
        font-size: 1.15rem;
    }
    
    .success-check {
        width: 60px;
        height: 60px;
        font-size: 1.7rem;
    }
    
    .rating-card {
        padding: 24px 20px;
    }
    
    .rating-card h3 {
        font-size: 1.05rem;
    }
    
    .star-btn {
        font-size: 1.7rem;
    }
    
    /* Continue modal */
    .continue-modal {
        padding: 24px 20px 20px;
    }
    
    .continue-modal h3 {
        font-size: 1.05rem;
    }
    
    .continue-modal .check-icon {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
    }
    
    /* Product cards compact */
    .product-card .card-img {
        width: 85px;
        min-height: 85px;
    }
    
    .product-card .card-body {
        padding: 6px 8px;
    }
    
    .product-card .card-body h4 {
        font-size: 0.82rem !important;
    }
    
    .product-card .card-body p {
        font-size: 0.7rem !important;
        margin: 1px 0 3px !important;
    }
    
    .product-card .price {
        font-size: 0.88rem;
    }
    
    .product-card .promo-badge {
        font-size: 0.55rem;
        padding: 1px 4px;
    }
    
    /* Push banner */
    .push-banner {
        padding: 10px 12px;
    }
    
    .push-banner .push-bell {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .push-banner .push-text strong {
        font-size: 0.88rem;
    }
    
    .push-banner .push-text small {
        font-size: 0.75rem;
    }
    
    .push-banner .push-action {
        padding: 6px 12px;
        font-size: 0.78rem;
    }
    
    /* LGPD footer */
    .lgpd-footer {
        font-size: 0.72rem;
        padding: 12px;
    }
    
    /* Back to top */
    .back-to-top {
        width: 38px;
        height: 38px;
        font-size: 1rem;
        bottom: calc(85px + env(safe-area-inset-bottom));
        right: 14px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   MEDIA QUERY EXTRA SMALL DEVICES (<360px)
   ═══════════════════════════════════════════════════════════════ */

@media screen and (max-width: 360px) {
    body {
        font-size: 13px;
    }
    
    .container {
        padding: 10px;
    }
    
    .app-header h1 {
        font-size: 1.05rem;
    }
    
    .store-avatar-header,
    .store-avatar-placeholder {
        width: 38px;
        height: 38px;
    }
    
    .card-body {
        padding: 10px;
    }
    
    .price {
        font-size: 1.05rem;
    }
    
    .cat-btn {
        padding: 6px 12px;
        font-size: 0.82rem;
    }
    
    .nav-link {
        font-size: 0.7rem;
    }
    
    .nav-link i {
        font-size: 1.15rem;
    }
    
    .product-card .card-img {
        width: 85px;
        min-height: 85px;
    }
}

.cc-chat-header {
    height: 56px;
    background: var(--secondary);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    flex-shrink: 0;
}

.cc-back-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}

.cc-back-btn:hover {
    background: rgba(255,255,255,0.2);
}

.cc-chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.cc-chat-header-info {
    flex: 1;
    min-width: 0;
}

.cc-chat-header-info strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cc-chat-header-info small {
    font-size: 0.72rem;
    opacity: 0.7;
}

.cc-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg);
}

.cc-date-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 14px 0;
}

.cc-date-divider span {
    background: var(--gray-light);
    color: var(--gray);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cc-msg {
    display: flex;
    margin-bottom: 4px;
}

.cc-msg-sent {
    justify-content: flex-end;
}

.cc-msg-received {
    justify-content: flex-start;
}

.cc-msg-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.cc-msg-sent .cc-msg-bubble {
    background: var(--secondary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.cc-msg-received .cc-msg-bubble {
    background: var(--white);
    color: var(--secondary);
    border: 1px solid var(--gray-light);
    border-bottom-left-radius: 4px;
}

.cc-msg-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    font-size: 0.6rem;
    opacity: 0.6;
    margin-top: 3px;
}

.cc-empty-chat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    padding: 140px 20px 40px;
    box-sizing: border-box;
    text-align: center;
    color: var(--gray);
}

.cc-empty-chat i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.3;
}

.cc-empty-chat p {
    margin: 0 0 4px;
    font-size: 0.95rem;
    font-weight: 500;
}

.cc-empty-chat small {
    font-size: 0.82rem;
    color: var(--gray);
}

.cc-chat-input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--gray-light);
    background: var(--white);
    flex-shrink: 0;
}

.cc-chat-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--gray-light);
    border-radius: 24px;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    background: var(--bg);
    transition: border-color 0.2s;
}

.cc-chat-input:focus {
    border-color: var(--primary-dark);
    background: var(--white);
}

.cc-send-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: var(--secondary);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.1s;
}

.cc-send-btn:hover {
    background: var(--secondary-soft);
}

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

/* ============================================
   TRACKING & DELIVERY ANIMATIONS
   ============================================ */

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(0.95); }
}

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

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.tracking-live-badge {
    animation: pulse 2s ease-in-out infinite;
}

.tracking-section {
    margin-top: 10px;
    animation: slideIn 0.3s ease;
}

.tracking-header {
    transition: all 0.2s ease;
}

.tracking-header:hover {
    background: var(--primary) !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.tracking-completed {
    animation: slideIn 0.3s ease;
}

/* ETA styles */
.eta-urgent { color: #dc2626; }
.eta-soon { color: #ea580c; }
.eta-normal { color: #16a34a; }

/* Route line animation on map */
.route-line {
    stroke-dasharray: 10;
    animation: dash 1s linear infinite;
}

@keyframes dash {
    to { stroke-dashoffset: -20; }
}

/* Delivery card animations */
.delivery-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.delivery-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Turn by turn navigation styles */
.turn-by-turn {
    animation: slideIn 0.3s ease;
}

.turn-by-turn i {
    animation: bounce 2s infinite;
}

/* ===== VALIDATORS CSS ===== */
/* Estilos para validação de campos */

/* Campo inválido */
.form-group input.invalid,
.form-group select.invalid {
    border-color: var(--danger) !important;
    background-color: var(--danger-soft) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

/* Campo válido */
.form-group input.valid,
.form-group select.valid {
    border-color: var(--success) !important;
    background-color: var(--success-soft) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

/* Ícone de validação no campo */
.form-group {
    position: relative;
}

.form-group input.invalid + .validation-icon,
.form-group input.valid + .validation-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    pointer-events: none;
}

.form-group input.invalid + .validation-icon {
    color: var(--danger);
}

.form-group input.valid + .validation-icon {
    color: var(--success);
}

/* Mensagem de erro do campo */
.field-error-message {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    animation: slideIn 0.2s ease-out;
}

.field-error-message i {
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* Animação de shake para campos inválidos */
@keyframes fieldShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.form-group input.invalid.shake {
    animation: fieldShake 0.3s ease-in-out;
}

/* Destaque para campos obrigatórios */
.required-asterisk {
    color: var(--danger);
    font-weight: 700;
}

.required-note {
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Dark mode para validadores */
.dark-mode .form-group input.invalid,
.dark-mode .form-group select.invalid {
    background-color: rgba(239, 68, 68, 0.1) !important;
    border-color: var(--danger) !important;
}

.dark-mode .form-group input.valid,
.dark-mode .form-group select.valid {
    background-color: rgba(16, 185, 129, 0.1) !important;
    border-color: var(--success) !important;
}

.dark-mode .field-error-message {
    color: #f87171;
}

/* Input com máscara aplicada */
input[data-masked="true"] {
    font-variant-numeric: tabular-nums;
}

/* Transição suave para estados de validação */
.form-group input,
.form-group select {
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

/* Campo em foco após erro */
.form-group input.invalid:focus {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

.form-group input.valid:focus {
    border-color: var(--success) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2) !important;
}

/* Container de formulário com erro */
.form-group.has-error label {
    color: var(--danger);
}

.form-group.has-error label i {
    color: var(--danger) !important;
}

/* Focus ring para acessibilidade */
.form-group input:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-soft);
}

/* Estilo para campo desabilitado */
.form-group input:disabled,
.form-group select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: var(--gray-light) !important;
}

/* Loading state em campos */
.form-group input.loading {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='none' stroke='%236b7280' stroke-width='3' stroke-dasharray='31.416' stroke-dashoffset='10' transform='rotate(-90 12 12)'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='1s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 20px;
    padding-right: 44px;
}

/* Validação de pagamento */
.payment-methods.has-error .payment-method-btn {
    border-color: var(--danger);
    background-color: var(--danger-soft);
}

/* Toast de validação */
.toast.validation-toast {
    border-left: 4px solid var(--danger);
}

.toast.validation-toast.success {
    border-left-color: var(--success);
}

/* Cookie Consent Banner - LGPD/GDPR */
.cookie-banner {
    position: fixed;
    bottom: calc(84px + env(safe-area-inset-bottom));
    left: 20px;
    right: 20px;
    background: #ffffff;
    color: #333333;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.2), 0 5px 15px rgba(0,0,0,0.1);
    z-index: 9999;
    display: none;
    border: 1px solid rgba(0,0,0,0.05);
    animation: slideUpBanner 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-banner.visible {
    display: block !important;
}

@keyframes slideUpBanner {
    from { transform: translateY(100%) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.cookie-banner-content {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cookie-banner-text {
    font-size: 0.95rem;
    color: #333333;
    line-height: 1.5;
}

.cookie-banner-text strong {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #ff6b35;
    margin-bottom: 4px;
    font-size: 1.05rem;
}

.cookie-banner-text a {
    color: #ff6b35;
    text-decoration: underline;
    font-weight: 700;
}

.cookie-banner-actions {
    display: flex;
    gap: 12px;
}

.cookie-banner-actions .btn {
    flex: 1;
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.cookie-banner-actions .btn:first-child {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
}

.cookie-banner-actions .btn:last-child {
    background: #ff6b35;
    color: #ffffff;
}

@media (min-width: 768px) {
    .cookie-banner-content {
        max-width: 1200px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .cookie-banner-text {
        flex: 1;
    }
    
    .cookie-banner-actions {
        width: auto;
    }
    
    .cookie-banner-actions .btn {
        flex: none;
        padding: 12px 28px;
    }
}

.dark-mode .cookie-banner {
    background: #1a1a1a;
    color: #ffffff;
    border-color: rgba(255,255,255,0.1);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
}

.dark-mode .cookie-banner-text {
    color: #eeeeee;
}

.dark-mode .cookie-banner-actions .btn:first-child {
    background: #2d2d2d;
    border-color: #444444;
    color: #cccccc;
}

/* Modal de Confirmação de Entrega */
.confirm-delivery-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 4000;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

.confirm-delivery-overlay.active {
    display: flex;
}

.confirm-delivery-modal {
    background: var(--white);
    border-radius: 20px;
    padding: 28px 24px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: scaleIn 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.confirm-delivery-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--success-soft);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 16px;
}

.confirm-delivery-title {
    margin: 0 0 12px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--secondary);
}

.confirm-delivery-message {
    margin: 0 0 8px;
    font-size: 0.95rem;
    color: var(--gray);
    line-height: 1.5;
}

.confirm-delivery-message strong {
    color: var(--secondary);
}

.confirm-delivery-warning {
    margin: 0 0 20px;
    font-size: 0.85rem;
    color: var(--warning);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.confirm-delivery-actions {
    display: flex;
    gap: 10px;
}

.btn-confirm-delivery-cancel {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid var(--gray-light);
    border-radius: 12px;
    background: transparent;
    color: var(--gray);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-confirm-delivery-cancel:hover {
    border-color: var(--gray);
    background: var(--bg);
}

.btn-confirm-delivery-confirm {
    flex: 1;
    padding: 14px 16px;
    border: none;
    border-radius: 12px;
    background: var(--success);
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-confirm-delivery-confirm:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-confirm-delivery-confirm:active {
    transform: scale(0.98);
}

/* Dark mode para modal de confirmação */
.dark-mode .confirm-delivery-modal {
    background: #1e1e1e;
}

.dark-mode .confirm-delivery-title {
    color: #f0f0f0;
}

.dark-mode .confirm-delivery-message {
    color: #9ca3af;
}

.dark-mode .confirm-delivery-message strong {
    color: #f0f0f0;
}

.dark-mode .btn-confirm-delivery-cancel {
    border-color: #444;
    color: #9ca3af;
}

.dark-mode .btn-confirm-delivery-cancel:hover {
    background: #2a2a2a;
    border-color: #666;
}

/* ============================================
   SISTEMA DE CHAT - VIEW CHAT (estrutura LOJISTA)
   ============================================ */

.chat-container {
    display: flex;
    height: 100vh;
    height: 100dvh;
    background: var(--bg);
}

/* Painel de Chat */
.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-light);
    background: var(--secondary);
    color: white;
    flex-shrink: 0;
}

.chat-back-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: background 0.2s;
}

.chat-back-btn:hover {
    background: rgba(255,255,255,0.25);
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

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

.chat-header-info strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-header-info small {
    font-size: 0.75rem;
    opacity: 0.8;
    color: white;
}

/* Mensagens */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg);
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23e0e5ec' fill-opacity='0.2'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.date-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 16px 0;
}

.date-divider span {
    background: var(--gray-light);
    color: var(--gray);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.msg {
    display: flex;
    margin-bottom: 4px;
}

.msg-sent {
    justify-content: flex-end;
}

.msg-received {
    justify-content: flex-start;
}

.msg-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
    position: relative;
}

.msg-sent .msg-bubble {
    background: var(--secondary);
    color: white;
    border-bottom-right-radius: 4px;
}

.msg-received .msg-bubble {
    background: var(--white);
    color: var(--secondary);
    border: 1px solid var(--gray-light);
    border-bottom-left-radius: 4px;
}

.msg-text {
    display: block;
}

.msg-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    font-size: 0.7rem;
    margin-top: 3px;
}

.msg-sent .msg-meta {
    color: rgba(255,255,255,0.75);
}

.msg-received .msg-meta {
    color: var(--gray);
}

.msg-status {
    font-size: 0.65rem;
}

.empty-chat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 20px;
    text-align: center;
    color: var(--gray);
}

.empty-chat i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.3;
}

.empty-chat p {
    margin: 0 0 4px;
    font-size: 0.95rem;
    font-weight: 500;
}

.empty-chat small {
    font-size: 0.82rem;
}

/* Input de Chat */
.chat-input-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--gray-light);
    background: var(--white);
    flex-shrink: 0;
    position: relative;
}

.chat-char-counter {
    position: absolute;
    right: 70px;
    font-size: 0.75rem;
    color: var(--gray);
    pointer-events: none;
    transition: color 0.2s;
}

.chat-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--gray-light);
    border-radius: 24px;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    background: var(--bg);
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: var(--primary-dark);
    background: var(--white);
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.1s;
}

.chat-send-btn:hover {
    background: var(--primary-dark);
}

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

/* Dark mode para chat */
.dark-mode .chat-header {
    background: #1e1e1e;
    border-bottom-color: #333;
}

.dark-mode .chat-messages {
    background: #121212;
}

.dark-mode .msg-sent .msg-bubble {
    background: #333;
    color: #fff;
    border: 1px solid #444;
}

.dark-mode .chat-input-bar {
    background: #1e1e1e;
    border-top-color: #333;
}

.chat-restriction-warning {
    padding: 12px 16px;
    background: #fee;
    border-top: 1px solid #fcc;
    color: #c00;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-restriction-warning i {
    font-size: 1rem;
    flex-shrink: 0;
}

.dark-mode .chat-restriction-warning {
    background: #3a1a1a;
    border-top-color: #5a2a2a;
    color: #ff6b6b;
}

.dark-mode .chat-input {
    background: #2a2a2a;
    border-color: #444;
    color: #f0f0f0;
}

.dark-mode .chat-input:focus {
    background: #333;
    border-color: var(--primary);
}

.dark-mode .date-divider span {
    background: #333;
    color: #888;
}

.dark-mode .empty-chat {
    color: #666;
}

