:root {
    --primary: #00A26B;
    /* Target site green */
    --accent-blue: #0088CC;
    /* Blue for category underline and icons */
    --secondary: #ffffff;
    --bg-page: #FAF8F8;
    --card-bg: #ffffff;
    --text-dark: #333333;
    /* Slightly softer than pure black */
    --text-secondary: #777777;
    --text-light: #ffffff;
    --danger: #f44336;
    --divider: #EBEBEB;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Utilitário global - ocultar elemento */
.hidden {
    display: none !important;
}

html {
    overflow-x: hidden;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-dark);
    padding-bottom: 80px;
    line-height: 1.5;
}

#app {
    width: 100%;
    /* overflow-x: clip is safe for sticky children, unlike overflow: hidden */
    overflow-x: clip;
}

/* When checkout modal is open, hide the sticky header */
body.modal-open header {
    display: none;
}

header {
    background: var(--secondary);
    padding: 0.5rem 0 0 0;
    position: sticky;
    top: 0;
    z-index: 500;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    width: 100%;
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
    font-weight: 800;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo {
    max-height: 120px;
    /* Adjust as needed */
    width: auto;
    object-fit: contain;
}

.badge-18 {
    background: #ffffff;
    color: var(--primary);
    font-size: 0.5em;
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 10px;
    font-weight: 800;
}

.search-container input {
    width: 100%;
    max-width: 600px;
    padding: 12px 20px;
    border-radius: 12px;
    /* Less rounded than 30px */
    border: 1px solid #E2E2E2;
    background: #F4F4F4;
    color: var(--text-dark);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.search-container input::placeholder {
    color: #999;
}

.search-container input:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 162, 107, 0.2);
}

#product-list {
    padding: 1rem;
    display: block;
    max-width: 1000px;
    margin: 0 auto;
    overflow-x: hidden;
    /* Prevent horizontal scroll on desktop */
    width: 100%;
}

.product-card {
    background: transparent;
    padding: 1rem 0;
    display: flex;
    flex-direction: row;
    /* Horizontal layout */
    justify-content: space-between;
    align-items: stretch;
    /* Change from center to stretch so left and right match height */
    border-bottom: 1px solid var(--divider);
    min-height: auto;
    gap: 1rem;
}

.product-card-left {
    flex: 1;
    min-width: 0;
    /* CRITICAL: prevents text overflow on flex children */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card-right {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    width: 80px;
    flex-shrink: 0;
}

.product-card img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: #ffffff;
    border: 1px solid #eee;
    padding: 2px;
}

/* Smaller screens: even more compact */
@media (max-width: 375px) {
    .product-card-right {
        width: 65px;
    }

    .product-card img {
        width: 65px;
        height: 65px;
    }
}

.product-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text-dark);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    /* Increased to 3 lines to avoid cutting long names */
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    word-break: break-word;
    /* Force break if a single word is too long */
}

.product-price {
    color: var(--text-dark);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-actions {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: flex-start;
    /* Align quantity selector to left to match the reference image */
    margin-top: auto;
    /* Push to bottom */
}

.qty-selector {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    background: #fff;
}

.qty-selector.small .qty-btn {
    width: 28px;
    height: 28px;
    font-size: 1rem;
}

.qty-selector.small .qty-value {
    min-width: 28px;
    height: 28px;
    font-size: 1rem;
}

.qty-btn {
    background: transparent;
    color: var(--primary);
    border: none;
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: #f0f0f0;
}

.qty-value {
    background: transparent;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1rem;
    flex: 1;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-btn {
    background: #333333;
    /* Dark background as requested */
    color: #ffffff;
    border: 1px solid #222;
    width: 100%;
    height: 32px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    /* Smooth transition for feedback */
}

.add-btn.btn-success {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
    transform: scale(1.05);
}

.add-btn:hover {
    background: #444444;
}

.add-btn:active {
    background: #eee;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.item-subtotal {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
}

#cart-summary {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary);
    color: #ffffff;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -4px 15px rgba(0, 162, 107, 0.2);
    z-index: 200;
}

#cart-summary.hidden {
    transform: translateY(100%);
}

.cart-info {
    display: flex;
    flex-direction: column;
}

#cart-total {
    font-size: 1.4rem;
    font-weight: 800;
}

#checkout-btn {
    background: #ffffff;
    color: var(--primary);
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 300;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #ffffff;
    width: 100%;
    max-width: 500px;
    border-radius: 20px 20px 0 0;
    padding: 2rem;
    max-height: 90vh;
    /* Increased from 80vh to fit iPhone SE */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Keep rounded corners */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

#close-cart,
#close-cart-2 {
    background: #eee;
    border: none;
    color: #333;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#close-cart:hover,
#close-cart-2:hover {
    background: #e0e0e0;
}

#cart-items {
    overflow-y: auto;
    flex-grow: 1;
    -webkit-overflow-scrolling: touch;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.item-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    max-width: 70%;
}

.item-price {
    color: var(--primary);
    font-weight: 700;
}

.remove-btn {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 1.2rem;
    cursor: pointer;
}

.modal-footer {
    padding-top: 1.5rem;
    text-align: center;
}

#modal-total,
#modal-total-2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

#btn-advance {
    width: 100%;
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 18px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

#btn-advance:active {
    opacity: 0.85;
}

#final-checkout-btn {
    width: 100%;
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    margin-bottom: 10px;
}

.btn-back {
    background: none;
    border: none;
    color: var(--accent-blue);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 4px 0;
}

.btn-secondary {
    width: 100%;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
    margin-top: 5px;
}

.btn-secondary:hover {
    color: var(--text-dark);
}

.loader {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: #ffffff;
    font-weight: 600;
}

/* Footer Legal */
footer {
    padding: 3rem 1rem;
    text-align: center;
    background: #ffffff;
    color: var(--text-secondary);
    font-size: 0.85rem;
    border-top: 1px solid var(--divider);
}

.legal-links {
    margin-bottom: 1rem;
}

.legal-links a {
    color: var(--text-secondary);
    text-decoration: underline;
    margin: 0 10px;
}

/* Estado desabilitado para botÃµes */
button:disabled {
    background-color: #bdc3c7 !important;
    color: #7f8c8d !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

#shipping-info-msg {
    font-size: 0.85rem;
    font-weight: 800;
    color: #ffeb3b;
    margin-top: 4px;
    display: block;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

}

.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 1rem 0;
    border-top: 1px solid var(--divider);
    margin-top: 1rem;
}

.checkout-form h3 {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.checkout-form input,
.checkout-form textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.checkout-form input:focus,
.checkout-form textarea:focus {
    border-color: var(--primary);
}

.checkout-form textarea {
    resize: vertical;
}

/* Category Navigation - Tab Style */
.category-nav {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Smooth iOS momentum scrolling */
    gap: 0;
    padding: 0;
    scrollbar-width: none;
    align-items: center;
    background: #fff;
    margin-top: 10px;
    border-bottom: 2px solid var(--divider);
    width: 100%;
    position: relative;
    /* Added for hint positioning */
}

.nav-hint {
    position: absolute;
    top: 2px;
    /* Adjust to be inside the bar slightly */
    right: 10px;
    font-size: 0.7rem;
    color: var(--primary);
    /* Use brand color for better visibility */
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
    pointer-events: none;
    z-index: 10;
    /* Ensure it's above the pills */
    animation: fadeHint 6s forwards;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

@keyframes fadeHint {
    0% {
        opacity: 1;
    }

    70% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

@media (min-width: 1024px) {
    .category-nav {
        justify-content: center;
        padding: 0 50px;
    }
}

.category-nav::-webkit-scrollbar {
    display: none;
}

.category-pill {
    white-space: nowrap;
    padding: 12px 20px;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 0;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
    user-select: none;
    border-bottom: 3px solid transparent;
    flex-shrink: 0;
}

.category-pill.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

.category-pill:hover {
    color: var(--text-dark);
}

/* Category Sections */
.category-section {
    width: 100%;
    margin-top: 2rem;
    padding-top: 0.5rem;
}

.category-title {
    display: none;
    /* User wants only tabs, no redundant headers */
}

.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    /* Rows separated by borders */
    width: 100%;
    background: #fff;
    border-top: 1px solid var(--divider);
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0 20px;
    }

    .product-card {
        padding: 1rem 0.5rem;
    }
}

.bundle-price {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 8px;
    margin-top: -4px;
}

/* Search bar adjustment */
.search-container {
    padding: 0 15px;
}
/* PDF Distributor Link */
.header-links {
    margin: 10px 0;
    display: flex;
    justify-content: center;
    padding: 0 15px;
}

.btn-pdf-header {
    background: #f4f4f4;
    color: var(--primary);
    padding: 8px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    border: 1px solid #E2E2E2;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 600px;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    cursor: pointer;
    pointer-events: auto;
}

.btn-pdf-header:hover {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 162, 107, 0.15);
}

.btn-pdf-header i {
    font-size: 1.1rem;
}
