:root {
    --primary-color: #10b981;
    /* CAKITO Emerald Green */
    --secondary-color: #000000;
    --bg-dark: #090e17;
    --card-bg: #1e1e1e;
    --drawer-bg: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --border-color: rgba(255, 255, 255, 0.08);
    --success-color: #28a745;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    /* Impede o refresh padrão do navegador */
    position: relative;
}

/* Pull to Refresh Component */
.pull-to-refresh {
    position: fixed;
    top: -60px;
    left: 0;
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.ptr-icon {
    width: 40px;
    height: 40px;
    background: var(--card-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    transform: rotate(0deg);
}

.ptr-icon i {
    font-size: 1.2rem;
}

.ptr-loading {
    animation: ptr-spin 0.8s linear infinite;
}

@keyframes ptr-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background: var(--bg-dark);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.header-btn,
.cart-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    position: relative;
    padding: 8px;
    transition: var(--transition);
}

.header-btn:hover,
.cart-btn:hover {
    color: var(--primary-color);
}

.logo-large {
    height: 80px;
    width: auto;
    display: block;
    margin: 0 auto 5px auto;
}

.store-info-header {
    text-align: center;
    flex: 1;
}

.store-status-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.store-status-text i {
    color: var(--primary-color);
}

.status-open {
    color: #28a745;
    font-weight: 600;
}

.status-closed {
    color: #dc3545;
    font-weight: 600;
}

.status-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 2px;
}

.badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--primary-color);
    color: var(--secondary-color);
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-wrapper {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border-color);
}

.search-wrapper i {
    color: var(--text-secondary);
}

.search-wrapper input {
    background: none;
    border: none;
    color: var(--text-primary);
    width: 100%;
    font-size: 1rem;
    outline: none;
}



/* Product Grid */
.category-section {
    margin-bottom: 40px;
}

.category-section h2 {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-section h2 span {
    font-size: 1.3rem;
}

.btn-view-all {
    font-size: 0.9rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.product-grid {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 10px 0 20px 0;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    /* Firefox */
}

.product-grid::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

/* Grid Override when 'viewing all' */
.product-grid.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    overflow-x: visible;
    flex-wrap: wrap;
}

.product-card {
    flex: 0 0 280px;
    /* Fixed width in scroll mode */
    scroll-snap-align: start;
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

/* Ofertas do Dia Premium Styles */
.offer-section {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.05) 0%, rgba(0, 0, 0, 0) 100%);
    padding: 25px 20px;
    border-radius: 24px;
    border: 1px solid rgba(255, 215, 0, 0.1);
    margin-bottom: 50px;
    position: relative;
    overflow: hidden;
}

.offer-section::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    z-index: 0;
}

.offer-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
}

.offer-section-header i {
    color: #ff4b2b;
    font-size: 1.8rem;
    filter: drop-shadow(0 0 8px rgba(255, 75, 43, 0.4));
    animation: flame 1.5s infinite alternate ease-in-out;
}

@keyframes flame {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 5px rgba(255, 75, 43, 0.4));
    }

    100% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 12px rgba(255, 75, 43, 0.6));
    }
}

.offer-section h2 {
    margin-bottom: 0 !important;
    font-size: 1.8rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.5px;
    color: #fff;
}

.offer-card {
    border: 1px solid rgba(255, 215, 0, 0.2) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.offer-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ff4b2b;
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(255, 75, 43, 0.3);
    letter-spacing: 0.5px;
}

.price-container {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 15px;
}

.old-price {
    text-decoration: line-through;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 400;
}

.offer-card .product-price {
    color: #ff4b2b;
    margin-bottom: 0;
}

.offer-item span {
    color: #ff4b2b;
    font-weight: 700;
}

.offer-item i {
    color: #ff4b2b;
}

.product-grid.grid-view .product-card {
    flex: none;
}

.product-card.in-cart {
    border-color: var(--success-color);
}

.in-cart-check {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--success-color);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    z-index: 5;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.product-img-wrapper {
    height: 180px;
    position: relative;
    background: #000;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 15px;
}

.product-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 5px;
    height: 2.8rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
}

.product-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    height: 2.4rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    line-height: 1.2rem;
}

.loyalty-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 215, 0, 0.1);
    color: var(--primary-color);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.loyalty-badge.eligible {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.exchange-badge {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: 5px;
}

.btn-exchange {
    background: transparent;
    border: 1px solid #28a745;
    color: #28a745;
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 5px;
}

.btn-exchange.active {
    background: #28a745;
    color: white;
}

.store-phone-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.store-phone-link:hover {
    color: var(--primary-color);
}

.product-price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.2rem;
    display: block;
    margin-bottom: 15px;
}

.btn-buy {
    width: 100%;
    background: #8B4513;
    /* Brown from image */
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition);
}

.btn-buy:hover {
    filter: brightness(1.2);
}

.card-cart-actions {
    display: flex;
    gap: 8px;
    width: 100%;
}

.card-qty-control {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f0f2f5;
    color: #121212;
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: 700;
}

.card-qty-control button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 5px;
}

.btn-remove-card {
    background: #e4e6eb;
    color: #4b4b4b;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
}

/* Drawer Component */
.drawer {
    position: fixed;
    top: 0;
    height: 100%;
    width: 100%;
    max-width: 380px;
    background: var(--drawer-bg);
    z-index: 2000;
    transition: transform 0.4s ease;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
}

.drawer-left {
    transform: translateX(-110%);
    left: 0;
}

.drawer-right {
    transform: translateX(110%);
    right: 0;
}

.drawer.open {
    transform: translateX(0);
}

.drawer-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-drawer {
    font-size: 2rem;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Sidebar List items */
.drawer-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    gap: 15px;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
}

/* Cart Items */
.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.cart-item-img {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    object-fit: cover;
}

.cart-item-mods {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 3px 0;
}

.cart-item-obs {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-style: italic;
    margin-bottom: 5px;
}

.cart-item-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 700;
}

.cart-footer {
    padding: 20px;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    width: 95%;
    max-width: 600px;
    max-height: 90vh;
    border-radius: 20px;
    position: relative;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
}

/* Custom UI Elements */
.quantity-control {
    display: flex;
    align-items: center;
    background: var(--bg-dark);
    border-radius: 25px;
    padding: 5px;
}

.quantity-control button {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    background: var(--card-bg);
    color: var(--text-primary);
    cursor: pointer;
}

.quantity-control span {
    width: 40px;
    text-align: center;
    font-weight: 700;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--secondary-color);
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
}

.btn-success {
    background: var(--success-color);
    color: #fff;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
}

.btn-block {
    width: 100%;
}

/* Item Modal Details */
.item-modal-header {
    border-bottom: 1px solid var(--border-color);
}

.item-modal-header img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.item-header-info {
    padding: 20px;
}

.item-header-info h2 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.item-header-info p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.modal-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
    margin-top: 10px;
}

.observation-area {
    padding: 0 20px 20px 20px;
}

.observation-area label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.observation-area textarea {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    color: #fff;
    resize: none;
    font-size: 0.9rem;
    outline: none;
}

.observation-area textarea:focus {
    border-color: var(--primary-color);
}

.item-complements-area {
    padding: 0 20px 100px 20px;
}

.complement-group-box {
    margin-top: 25px;
    border: 1px solid transparent;
    transition: var(--transition);
    border-radius: 12px;
}

.complement-group-box.invalid {
    border-color: #ff4b2b;
    background: rgba(255, 75, 43, 0.02);
}

.comp-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.comp-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.mini-qty-comp {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-dark);
    padding: 4px;
    border-radius: 20px;
}

.mini-qty-comp button {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: var(--card-bg);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    cursor: pointer;
}

.mini-qty-comp span {
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 15px;
    text-align: center;
}

.group-label {
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.group-label span {
    font-weight: 700;
    display: block;
}

.group-label small {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.rule-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 5px;
    width: fit-content;
}

.rule-badge.mandatory {
    background: rgba(255, 75, 43, 0.1);
    color: #ff4b2b;
}

.rule-badge.optional {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

#addToCartBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #444 !important;
}

.comp-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.comp-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.comp-price {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.modal-item-footer {
    position: sticky;
    bottom: 0;
    background: var(--card-bg);
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

/* Checkout View */
.checkout-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--drawer-bg);
    z-index: 10;
    transform: translateX(100%);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.checkout-view.active {
    transform: translateX(0);
}

.checkout-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 15px;
}

#backToCart {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
}

.form-section {
    margin-bottom: 25px;
}

.section-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.auto-fill-badge {
    font-size: 0.7rem;
    background: rgba(255, 215, 0, 0.1);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.form-section h4 {
    margin-bottom: 0;
    color: var(--primary-color);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-left: 3px solid var(--primary-color);
    padding-left: 10px;
}

.form-group-checkout {
    margin-bottom: 18px;
}

.form-group-checkout label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    margin-left: 5px;
}

.form-control,
.form-group-checkout input {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 14px 18px;
    border-radius: 12px;
    outline: none;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus,
.form-group-checkout input:focus {
    border-color: var(--primary-color);
    background: rgba(255, 215, 0, 0.03);
}

.form-control option {
    background: var(--card-bg);
    color: #fff;
}

.hidden {
    display: none !important;
}

/* Integrated Checkout (Single View) */
.checkout-integrated {
    padding-bottom: 30px;
}

.checkout-integrated .form-section {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px dashed var(--border-color);
}

.checkout-integrated h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkout-integrated .form-group-checkout {
    margin-bottom: 15px;
}

.checkout-summary {
    background: var(--bg-dark);
    padding: 20px;
    border-radius: 12px;
    margin-top: 15px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.summary-line.total {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.2rem;
}

/* Order Type Style (PDV Unified) */
.order-type {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 15px 0;
}

.type-btn {
    padding: 12px 10px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
    font-size: 0.85rem;
}

.type-btn i {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.type-btn.active {
    background: var(--primary-color);
    color: var(--secondary-color);
    border-color: var(--primary-color);
    font-weight: 700;
}

.type-btn.active i {
    color: var(--secondary-color);
}

.type-btn:hover:not(.active) {
    border-color: var(--primary-color);
    background: rgba(255, 215, 0, 0.05);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .drawer {
        max-width: 100%;
    }

    .product-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .product-card {
        border-radius: 10px;
    }

    .product-img-wrapper {
        height: 130px;
    }

    .product-info {
        padding: 10px;
    }

    .product-name {
        font-size: 0.9rem;
        height: 2.6rem;
    }

    .product-price {
        font-size: 1rem;
    }
}

/* --- Added Styles --- */
.status-open {
    color: #28a745 !important;
    font-weight: 600;
}

.status-closed {
    color: #dc3545 !important;
    font-weight: 600;
}

.store-info-body {
    background: var(--card-bg);
}

.fees-table {
    width: 100%;
    margin-top: 10px;
    border-collapse: collapse;
}

.fees-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-color);
}

.fees-table tr:last-child td {
    border-bottom: none;
}

.complement-group-box.invalid {
    border: 1px solid #dc3545 !important;
    background: rgba(220, 53, 69, 0.05) !important;
    border-radius: 8px;
    padding: 5px;
}

.closed-icon {
    animation: moon-pulse 2s infinite ease-in-out;
}

@keyframes moon-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

#openStoreInfoBtn i {
    color: var(--primary-color);
}

.text-center {
    text-align: center;
}

.btn-block {
    width: 100%;
    display: block;
}