/* ============================================
   DELIVERY EXPRESS - Stylesheet Completo
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    /* Paleta */
    --primary: #FF6B35;
    --primary-dark: #E55A28;
    --primary-light: #FF8F66;
    --primary-bg: #FFF3ED;
    --secondary: #1A1A2E;
    --secondary-light: #2D2D44;
    --accent: #FFD23F;
    --accent-dark: #F0C030;
    --success: #2ECC71;
    --success-bg: #E8F8F0;
    --error: #E74C3C;
    --error-bg: #FDEDEC;
    --info: #3498DB;
    --info-bg: #EBF5FB;
    --warning: #F39C12;

    /* Neutros */
    --bg: #F7F7FA;
    --bg-card: #FFFFFF;
    --bg-overlay: rgba(20, 20, 40, .55);
    --text: #1A1A2E;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --border: #E5E7EB;
    --border-light: #F3F4F6;

    /* Sombras */
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.12);
    --shadow-xl: 0 20px 50px rgba(0,0,0,.18);

    /* Raios */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transições */
    --ease: cubic-bezier(.4, 0, .2, 1);
    --duration: .25s;

    /* Espaçamento seguro */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --header-h: 60px;
    --nav-h: 68px;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
}

input {
    font-family: inherit;
    outline: none;
}

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

/* ============================================
   APP CONTAINER
   ============================================ */
#app {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    background: var(--secondary);
    z-index: 100;
    padding-top: var(--safe-top);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 16px;
    max-width: 600px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.3px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-greeting {
    color: rgba(255,255,255,.8);
    font-size: 13px;
    font-weight: 500;
}

.btn-header {
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--accent);
    transition: all var(--duration) var(--ease);
}

.btn-header:hover {
    background: var(--accent);
    color: var(--secondary);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-top: calc(var(--header-h) + var(--safe-top));
    padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
    min-height: calc(100dvh - var(--header-h) - var(--nav-h));
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

/* ============================================
   BOTTOM NAV
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    background: #fff;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    border-top: 1px solid var(--border);
    padding-bottom: var(--safe-bottom);
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,.04);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 2px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    transition: color var(--duration) var(--ease);
    position: relative;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
}

.nav-icon {
    font-size: 22px;
    line-height: 1;
}

.nav-label {
    font-size: 10px;
    letter-spacing: .2px;
}

.cart-nav-item {
    position: relative;
}

.cart-badge {
    position: absolute;
    top: 6px;
    right: 50%;
    transform: translateX(16px);
    background: var(--error);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    border: 2px solid #fff;
}

/* ============================================
   VIEWS
   ============================================ */
.view {
    padding: 16px;
    animation: fadeSlideIn .35s var(--ease);
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    margin: -16px -16px 20px;
}

.hero-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 60%, #C04420 100%);
    padding: 36px 24px 32px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 260px;
    height: 260px;
    background: rgba(255,255,255,.08);
    border-radius: 50%;
}

.hero-banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 180px;
    height: 180px;
    background: rgba(255,255,255,.05);
    border-radius: 50%;
}

.hero-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.5px;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.hero-subtitle {
    font-size: 14px;
    opacity: .88;
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
}

.hero-btn {
    background: var(--accent);
    color: var(--secondary);
    padding: 10px 24px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 14px;
    position: relative;
    z-index: 1;
    transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.hero-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255,210,63,.4);
}

/* ============================================
   SEARCH BAR
   ============================================ */
.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0 16px;
    margin-bottom: 24px;
    transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255,107,53,.12);
}

.search-icon {
    font-size: 18px;
    margin-right: 10px;
    opacity: .5;
}

.search-input {
    border: none;
    background: none;
    flex: 1;
    height: 48px;
    font-size: 14px;
    color: var(--text);
}

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

/* ============================================
   SECTION TITLES
   ============================================ */
.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 14px;
    letter-spacing: -.3px;
    color: var(--text);
}

/* ============================================
   CATEGORIES
   ============================================ */
.categories-section {
    margin-bottom: 24px;
}

.categories-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

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

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 80px;
    padding: 12px 8px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    transition: all var(--duration) var(--ease);
    cursor: pointer;
    flex-shrink: 0;
}

.category-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.category-card.active {
    background: var(--primary-bg);
    border-color: var(--primary);
    box-shadow: 0 2px 10px rgba(255,107,53,.15);
}

.category-icon {
    font-size: 26px;
    line-height: 1;
}

.category-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 72px;
}

.category-card.active .category-name {
    color: var(--primary-dark);
}

/* ============================================
   PRODUCTS GRID
   ============================================ */
.products-section {
    margin-bottom: 24px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 480px) {
    .products-grid {
        gap: 14px;
    }
}

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: all var(--duration) var(--ease);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

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

.product-image {
    height: 130px;
    background: linear-gradient(145deg, var(--primary-bg), #FDE8DB);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--error);
    color: #fff;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
    animation: badgePulse 2s ease infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231,76,60,.4); }
    50%      { box-shadow: 0 0 0 6px rgba(231,76,60,0); }
}

.product-info {
    padding: 10px 12px 14px;
}

.product-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    letter-spacing: -.2px;
}

.product-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

/* ============================================
   GROUP VIDEO
   ============================================ */
.group-video-section {
    margin-bottom: 20px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    position: relative;
}

.group-video-section video {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    display: block;
    background: #000;
}

.group-video-label {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0,0,0,.65);
    color: #fff;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

/* ============================================
   PROMO SECTION
   ============================================ */
.promo-section {
    margin: -16px -16px 24px;
}

.promo-banner {
    background: linear-gradient(135deg, #E74C3C 0%, #C0392B 50%, #922B21 100%);
    padding: 32px 24px;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.promo-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,.06);
    border-radius: 50%;
}

.promo-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    position: relative;
}

.promo-subtitle {
    font-size: 14px;
    opacity: .85;
    position: relative;
}

/* ============================================
   CART
   ============================================ */
.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px;
}

.cart-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: .4;
}

.cart-empty-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
}

.cart-empty-text {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.cart-item {
    display: flex;
    gap: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    animation: fadeSlideIn .3s var(--ease);
}

.cart-item-image {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    background: var(--primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    flex-shrink: 0;
    overflow: hidden;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.cart-item-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border-radius: var(--radius-full);
    padding: 2px;
}

.qty-btn-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all var(--duration) var(--ease);
}

.qty-btn-small:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.qty-value-small {
    font-size: 14px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.btn-remove {
    padding: 6px;
    font-size: 18px;
    opacity: .5;
    transition: opacity var(--duration) var(--ease);
}

.btn-remove:hover {
    opacity: 1;
}

/* Cart Summary */
.cart-summary {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.summary-row.total {
    border-top: 1.5px solid var(--border);
    margin-top: 4px;
    padding-top: 12px;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}

/* ============================================
   DELIVERY FEE SECTION
   ============================================ */
.delivery-fee-section {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.delivery-fee-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 12px 0;
}

.delivery-addr-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.delivery-addr-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-light);
    background: var(--bg);
    cursor: pointer;
    transition: all 0.2s ease;
}

.delivery-addr-option:hover {
    border-color: var(--primary);
    background: rgba(255, 107, 53, 0.04);
}

.delivery-addr-option.selected {
    border-color: var(--primary);
    background: rgba(255, 107, 53, 0.06);
}

.delivery-addr-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}

.delivery-addr-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.delivery-addr-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.delivery-addr-text {
    font-size: 11.5px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.delivery-addr-check {
    color: var(--primary);
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

/* Delivery Fee Info */
.delivery-fee-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.spinner-small {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 107, 53, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

.delivery-fee-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(239, 68, 68, 0.08);
    border-radius: var(--radius-sm);
    color: #dc2626;
    font-size: 13px;
    margin-top: 4px;
}

.delivery-fee-error-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.delivery-fee-info {
    margin-top: 4px;
}

.delivery-distance-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.06);
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    color: #2563eb;
    font-weight: 500;
}

.delivery-fee-free {
    padding: 8px 12px;
    background: rgba(34, 197, 94, 0.08);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: #16a34a;
    font-weight: 600;
    margin-top: 6px;
    text-align: center;
}

.delivery-fee-hint {
    padding: 8px 0;
    font-size: 12.5px;
    color: var(--text-light);
    font-style: italic;
}

/* Fee labels in summary */
.fee-free-label {
    color: #16a34a;
    font-weight: 600;
}

.fee-calculating {
    color: var(--text-light);
    font-size: 12px;
    font-style: italic;
}

.fee-unavailable {
    color: #dc2626;
    font-weight: 500;
}

/* Disabled checkout button */
.btn-disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

/* ============================================
   PROFILE
   ============================================ */
.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0 20px;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    box-shadow: 0 4px 16px rgba(255,107,53,.3);
}

.profile-name {
    font-size: 20px;
    font-weight: 700;
}

.profile-phone {
    font-size: 14px;
    color: var(--text-secondary);
}

.profile-menu {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background var(--duration) var(--ease);
}

.profile-menu-item:last-child {
    border-bottom: none;
}

.profile-menu-item:hover {
    background: var(--bg);
}

.profile-menu-icon {
    font-size: 20px;
}

.profile-menu-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.profile-menu-arrow {
    font-size: 20px;
    color: var(--text-muted);
    font-weight: 300;
}

/* Profile Info Card */
.profile-info-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.profile-info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
}

.profile-info-label {
    color: var(--text-muted);
    font-weight: 500;
}

.profile-info-value {
    color: var(--text);
    font-weight: 600;
    text-align: right;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--duration) var(--ease);
    letter-spacing: -.1px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 12px rgba(255,107,53,.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255,107,53,.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255,107,53,.3);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1.5px solid var(--border);
}

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

.btn-full {
    width: 100%;
}

.btn-small {
    padding: 8px 14px;
    font-size: 13px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
}

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

.mt-2 {
    margin-top: 16px;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.form-group input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    background: var(--bg-card);
    transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255,107,53,.1);
}

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

.form-row {
    display: flex;
    gap: 10px;
}

.form-row .form-group {
    flex: 1;
}

.form-row .form-group.flex-1 {
    flex: .6;
}

.form-row .form-group.flex-3 {
    flex: 2;
}

.form-row .form-group.small {
    flex: .4;
    max-width: 70px;
}

.form-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
}

.form-divider::before,
.form-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.form-divider span {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.input-with-button {
    display: flex;
    gap: 8px;
}

.input-with-button input {
    flex: 1;
}

/* ============================================
   MODALS
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s var(--ease), visibility .3s;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(3px);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 90dvh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform .35s var(--ease);
    padding-bottom: var(--safe-bottom);
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-content.modal-center {
    border-radius: var(--radius-xl);
    margin: auto 16px;
    max-height: 80dvh;
}

.modal-content.modal-large {
    max-height: 94dvh;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 0;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--text-muted);
    border-radius: 50%;
    transition: background var(--duration) var(--ease);
}

.modal-close:hover {
    background: var(--bg);
}

.modal-body {
    padding: 20px;
}

/* Product Modal */
.product-modal-image {
    height: 200px;
    background: linear-gradient(145deg, var(--primary-bg), #FDE8DB);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 72px;
    margin-bottom: 16px;
    overflow: hidden;
}

.product-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-modal-info {
    margin-bottom: 16px;
}

.product-modal-info h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.product-modal-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 10px;
}

.product-modal-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}

.quantity-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    background: var(--bg);
    padding: 12px;
    border-radius: var(--radius-md);
}

.qty-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    background: var(--bg-card);
    border: 2px solid var(--primary);
    transition: all var(--duration) var(--ease);
}

.qty-btn:hover {
    background: var(--primary);
    color: #fff;
}

.qty-value {
    font-size: 22px;
    font-weight: 700;
    min-width: 36px;
    text-align: center;
}

/* Payment Modal */
.payment-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 16px;
    background: var(--bg);
    border-radius: var(--radius-md);
    border: 2px solid var(--border);
    transition: all var(--duration) var(--ease);
    cursor: pointer;
    text-align: left;
    width: 100%;
}

.payment-option:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.payment-icon {
    font-size: 28px;
}

.payment-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.payment-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.payment-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Processing Modal */
.processing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 20px;
}

.processing-content h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.processing-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.spinner-large {
    width: 56px;
    height: 56px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin-bottom: 20px;
}

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

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: var(--radius-full);
    width: 0;
    transition: width 1s linear;
}

.timeout-text {
    font-size: 12px;
    color: var(--text-muted);
}

/* Success Modal */
.success-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 20px;
}

.success-icon {
    font-size: 56px;
    margin-bottom: 16px;
    animation: successBounce .6s var(--ease);
}

@keyframes successBounce {
    0%   { transform: scale(0); }
    60%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.success-content h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--success);
}

.success-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.order-summary {
    width: 100%;
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 24px;
    text-align: left;
}

.order-summary p {
    margin-bottom: 4px;
    font-size: 14px;
}

/* ============================================
   TOAST
   ============================================ */
.toast {
    position: fixed;
    top: calc(var(--header-h) + var(--safe-top) + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(-120%);
    background: var(--secondary);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 300;
    box-shadow: var(--shadow-lg);
    transition: transform .35s var(--ease);
    max-width: calc(100vw - 32px);
    white-space: nowrap;
}

.toast.active {
    transform: translateX(-50%) translateY(0);
}

.toast-icon {
    font-size: 16px;
    font-weight: 700;
}

.toast-message {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   MIX SECTION (Pizza Mix)
   ============================================ */
.mix-section {
    margin-bottom: 16px;
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: 14px;
    border: 1.5px dashed var(--border);
}

.mix-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.mix-icon {
    font-size: 24px;
}

.mix-header-text {
    display: flex;
    flex-direction: column;
}

.mix-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.mix-subtitle {
    font-size: 11px;
    color: var(--text-muted);
}

.mix-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mix-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    text-align: left;
    width: 100%;
}

.mix-option:hover {
    border-color: var(--primary-light);
    background: var(--primary-bg);
}

.mix-option.selected {
    border-color: var(--primary);
    background: var(--primary-bg);
    box-shadow: 0 0 0 2px rgba(255,107,53,.12);
}

.mix-option-check {
    font-size: 16px;
    color: var(--text-muted);
    min-width: 20px;
    text-align: center;
    transition: color var(--duration) var(--ease);
}

.mix-option.selected .mix-option-check {
    color: var(--primary);
}

.mix-option-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    flex: 1;
}

/* Cart item mix tag */
.cart-item-mix {
    font-size: 11px;
    color: var(--primary-dark);
    background: var(--primary-bg);
    padding: 3px 8px;
    border-radius: var(--radius-full);
    display: inline-block;
    margin-bottom: 4px;
    font-weight: 500;
}

/* Order detail mix tag */
.order-detail-item-mix {
    font-size: 11px;
    color: var(--primary-dark);
    margin-top: 2px;
    font-weight: 500;
}

/* ============================================
   MISC HELPERS
   ============================================ */
.text-center {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    padding: 32px 0;
}

.hidden {
    display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 480px) {
    .modal-content {
        border-radius: var(--radius-xl);
        margin: auto 16px;
        max-height: 85dvh;
    }

    .modal {
        align-items: center;
    }
}

@media (min-width: 600px) {
    .main-content {
        padding-left: 16px;
        padding-right: 16px;
    }
}
/* ============================================
   MEUS PEDIDOS & MEUS ENDEREÇOS
   ============================================ */

/* Subview Header */
.subview-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.back-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.back-btn:hover {
    background: var(--bg);
    transform: translateX(-2px);
}

.subview-title {
    font-size: 20px;
    font-weight: 700;
    flex: 1;
}

/* Loading & Empty States */
.loading-state, .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.empty-state-text {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.spinner-large {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Order Cards */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.order-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.order-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.order-card-date {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.order-card-status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    width: fit-content;
}

.status-done {
    background: var(--success-bg, #E8F5E9);
    color: var(--success, #2E7D32);
}

.status-open {
    background: var(--info-bg, #E3F2FD);
    color: var(--info, #1565C0);
}

.status-cancelled {
    background: var(--error-bg, #FFEBEE);
    color: var(--error, #C62828);
}

.status-delivered {
    background: #E8F5E9;
    color: #2E7D32;
}

.order-card-total {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.order-card-summary {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.order-card-items-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

.order-card-items-preview {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-card-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s var(--ease);
}

.order-card.expanded .order-card-detail {
    max-height: 1000px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.order-detail-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.order-detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
}

.order-detail-item-qty {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 30px;
}

.order-detail-item-name {
    flex: 1;
    color: var(--text);
}

.order-detail-item-price {
    font-weight: 600;
    color: var(--primary);
}

.order-detail-payment {
    margin-top: 12px;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.order-detail-label {
    font-weight: 600;
    color: var(--text-secondary);
}

/* Address Cards */
.addresses-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.address-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: all var(--duration) var(--ease);
}

.address-card:hover {
    box-shadow: var(--shadow-md);
}

.address-principal {
    border-color: var(--primary);
    background: var(--primary-bg, rgba(255, 107, 53, 0.05));
}

.address-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.address-card-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.address-card-icon {
    font-size: 20px;
}

.address-card-rotulo {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.addr-badge-principal {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.address-card-actions {
    display: flex;
    gap: 6px;
}

.addr-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.addr-action-btn:hover {
    background: var(--border-light);
    transform: scale(1.1);
}

.addr-delete-btn:hover {
    background: var(--error-bg, #FFEBEE);
    border-color: var(--error, #C62828);
}

.address-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.address-card-full {
    font-size: 13px;
    color: var(--text);
    line-height: 1.4;
}

.address-card-cep {
    font-size: 12px;
    color: var(--text-muted);
}

/* Utility Classes */
.mt-2 {
    margin-top: 16px;
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    text-align: center;
}

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

/* ========== Delivery Fechado Banner ========== */
.delivery-closed-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
    border: 1px solid #FFB74D;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.delivery-closed-banner.cart-closed {
    margin-top: 8px;
    margin-bottom: 8px;
}

.closed-banner-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.closed-banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.closed-banner-text strong {
    font-size: 14px;
    color: #E65100;
}

.closed-banner-text span {
    font-size: 12px;
    color: #BF360C;
}

.btn-disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

/* ---- Produto Bloqueado ---- */
.product-card-bloq {
    opacity: .55;
    filter: grayscale(40%);
    pointer-events: auto;
}
.product-card-bloq .product-price {
    text-decoration: line-through;
    opacity: .6;
}
.product-badge-bloq {
    background: #ef4444 !important;
    color: #fff !important;
}

/* ============================================
   TEMPO DE ESPERA ESTIMADO
   ============================================ */
.tempo-espera-section {
    background: linear-gradient(135deg, #FFF8F0 0%, #FFF3E6 100%);
    border: 1px solid #FFD9B3;
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
}

.tempo-espera-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #888;
    font-size: 0.9rem;
}

.tempo-espera-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.tempo-espera-icon {
    font-size: 1.6rem;
}

.tempo-espera-info {
    display: flex;
    flex-direction: column;
}

.tempo-espera-titulo {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tempo-espera-valor {
    font-size: 1.3rem;
    font-weight: 700;
    color: #FF6B35;
}

.tempo-espera-detalhe {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid #FFD9B3;
}

.tempo-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #555;
}

.tempo-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-fila      { background: #F59E0B; }
.dot-preparo   { background: #3B82F6; }
.dot-entregador{ background: #8B5CF6; }
.dot-ok        { background: #10B981; }
.dot-destino   { background: #EF4444; }