:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --background: #0f172a;
    --surface: rgba(30, 41, 59, 0.7);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --glass: rgba(255, 255, 255, 0.05);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--background);
    background-image:
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0, transparent 50%),
        radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.15) 0, transparent 50%);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

.glass-card {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
}

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

.logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--logo-color, var(--primary));
    white-space: nowrap;
    text-decoration: none;
}

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

.user-badge {
    padding: 6px 15px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-icon {
    padding: 10px 20px;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero {
    padding: 40px 0;
    text-align: center;
}

.hero h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

.hero p {
    color: var(--text-muted);
}

.main-banner-container {
    position: relative;
    margin: 20px 1px;
    overflow: hidden;
    border-radius: 20px;
    height: 400px;
    border: 1px solid var(--border);
}

.banner-carousel {
    width: 100%;
    height: 100%;
    position: relative;
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    display: none;
}

.banner-slide.active {
    opacity: 1;
    display: block;
}

.banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.dot.active {
    background: #fff;
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
    .main-banner-container {
        height: 140px;
        /* Reduzido para melhor proporção 3:1 */
        margin: 15px 1px;
    }

    .banner-slide img {
        object-position: center;
        /* Garante que o meio da imagem apareça */
    }

    .carousel-dots {
        bottom: 10px;
    }

    .dot {
        width: 8px;
        height: 8px;
    }
}

.category-block {
    margin-top: 40px;
}

/* Menu de Categorias */
.category-nav-wrapper {
    margin: 20px 0;
    overflow-x: auto;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}

.category-nav-wrapper::-webkit-scrollbar {
    height: 3px;
}

.category-nav-wrapper::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.category-nav {
    display: flex;
    gap: 12px;
    padding: 2px;
    white-space: nowrap;
}

.cat-link {
    padding: 10px 20px;
    background: var(--cat-btn-bg, var(--glass));
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cat-link:hover,
.cat-link.active {
    background: var(--cat-btn-active-bg, var(--primary));
    border-color: var(--cat-btn-active-bg, var(--primary));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.category-title {
    margin-bottom: 20px;
    font-size: 24px;
    border-left: 4px solid var(--primary);
    padding-left: 15px;
    color: var(--cat-name-color, var(--primary));
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
}

.product-card {
    transition: transform 0.3s ease;
}

.product-card:hover {
    transform: translateY(-10px);
}

.product-img {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 15px;
    object-fit: cover;
    margin-bottom: 15px;
    background: var(--prod-img-bg, transparent);
}

.product-info h3 {
    font-size: 15px;
    margin-bottom: 5px;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    cursor: pointer;
    color: var(--prod-name-color, var(--text));
}

.product-info h3 small {
    color: var(--primary);
    font-weight: 700;
}

.product-card .price {
    font-size: 18px;
    margin-bottom: 5px;
    color: var(--prod-price-color, var(--primary));
    font-weight: 700;
}

.stock-badge {
    display: inline-block;
    font-size: 13px;
    color: var(--stock-color);
    margin-bottom: 12px;
    background: var(--glass);
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.stock-badge.low-stock {
    border-color: rgba(248, 113, 113, 0.3);
}

.out-of-stock-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ef4444;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    z-index: 10;
}

.qty-control {
    display: flex;
    align-items: center;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2px;
}

.qty-btn {
    background: none;
    border: none;
    color: var(--text);
    padding: 5px 10px;
    cursor: pointer;
}

.qty-btn i {
    font-size: 10px;
}

.qty-input {
    width: 30px;
    background: none;
    border: none;
    color: var(--text);
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}

.modal-buy-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

#modalAddBtn {
    flex: 1;
    padding: 15px;
    font-size: 16px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-qty {
    padding: 5px;
    border-radius: 12px;
}

.modal-qty .qty-btn {
    padding: 10px 15px;
}

.modal-qty .qty-input {
    width: 40px;
    font-size: 18px;
}

#modalStock {
    display: block;
    margin-top: 10px;
    color: var(--text-muted);
}

.recommendations-title {
    grid-column: 1 / -1;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.recommendations-grid {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 5px;
    margin-top: 15px;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.recommendations-grid::-webkit-scrollbar {
    height: 4px;
}

.recommendations-grid::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.rec-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--glass);
}

.rec-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

.rec-card img {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--prod-img-bg, transparent);
}

.rec-card .rec-info {
    min-width: 0;
}

.rec-card h4 {
    font-size: 12px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--prod-name-color, var(--text));
}

.rec-card .price {
    font-size: 12px;
    margin: 0;
    font-weight: 700;
    color: var(--prod-price-color, var(--primary));
}

.btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

/* Hide number input spinners */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
}

/* Modal Estilos */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    color: var(--modal-close-color, var(--text-muted));
    cursor: pointer;
    background: none;
    border: none;
}

.modal-close:hover {
    color: #ef4444;
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
        position: relative;
        width: 100%;
        overflow-x: hidden;
    }

    .container {
        width: 100%;
        overflow-x: hidden;
        padding: 0 10px;
    }

    header {
        padding: 10px 0;
        gap: 8px;
    }

    .logo {
        font-size: 16px;
    }

    .hero h1 {
        font-size: 22px !important;
    }

    .modal-overlay {
        padding: 5px;
    }

    .modal-content {
        grid-template-columns: minmax(0, 1fr) !important;
        /* Fix para não esticar */
        padding: 15px;
        max-height: 92vh;
        width: 100% !important;
        margin: 0;
        border-radius: 12px;
        gap: 15px !important;
        overflow-x: hidden;
    }

    .modal-left {
        margin-bottom: 0;
    }

    #modalImg {
        width: 150px !important;
        height: 150px !important;
    }

    .modal-right h2 {
        font-size: 18px !important;
        margin-top: 5px !important;
    }

    .modal-right .price {
        margin: 8px 0 !important;
        font-size: 20px !important;
    }

    .modal-right #modalDesc {
        margin-bottom: 15px !important;
        font-size: 12px;
    }

    .recommendations-title {
        margin-top: 15px;
        padding-top: 10px;
        width: 100% !important;
        min-width: 0;
        /* Importante para flex/grid containers */
        overflow-x: hidden;
    }

    .recommendations-title h4 {
        font-size: 11px;
    }

    .recommendations-grid {
        gap: 6px !important;
        padding: 5px 0;
    }

    .rec-card {
        min-width: calc(50% - 3px) !important;
        flex: 0 0 calc(50% - 3px) !important;
        padding: 4px 6px !important;
        gap: 5px !important;
    }

    .rec-card img {
        width: 40px;
        height: 40px;
    }

    .modal-buy-container {
        gap: 8px;
    }

    #modalAddBtn {
        padding: 10px;
        font-size: 14px;
        height: 44px;
    }

    .modal-qty {
        padding: 2px;
    }

    .modal-qty .qty-btn {
        padding: 8px 10px;
    }

    .modal-qty .qty-input {
        width: 30px;
        font-size: 15px;
    }

    .rec-card h4 {
        font-size: 10px;
    }
}

footer {
    margin-top: 80px;
    padding: 60px 0 30px 0;
    background: var(--glass);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(20px);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: var(--footer-title-color, var(--primary));
    margin-bottom: 20px;
    font-size: 18px;
}

.footer-col p {
    color: var(--footer-text-color, var(--text-muted));
    line-height: 1.6;
    font-size: 14px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--footer-link-color, var(--text-muted));
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--footer-link-hover-color, var(--primary));
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-icon {
    width: 40px;
    height: 40px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    text-decoration: none;
    transition: all 0.3s;
}

.social-icon:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
}

.footer-bottom {
    padding-top: 30px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--footer-copyright-color, var(--text-muted));
    font-size: 13px;
}

.hero p {
    color: var(--hero-subtitle-color);
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .product-info h3 {
        font-size: 14px !important;
    }

    .product-info .price {
        font-size: 16px !important;
    }

    .btn {
        padding: 6px 8px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 12px !important;
        color: #ffffff !important;
        min-height: 40px !important;
    }

    .qty-input {
        width: 25px !important;
        font-size: 12px !important;
    }
}

/* Ajuste Ultra-Mobile (350px-360px) */
@media (max-width: 360px) {
    .modal-content {
        padding: 10px !important;
        gap: 10px !important;
    }

    .modal-buy-container {
        display: flex !important;
        gap: 4px !important;
        padding: 0 5px !important;
    }

    #modalAddBtn {
        flex: 1 !important;
        margin: 0 1px !important;
        /* Separação de 1px pedida */
        font-size: 10.5px !important;
        padding: 0 5px !important;
        height: 38px !important;
        white-space: nowrap !important;
        color: #ffffff !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .modal-qty .qty-btn {
        padding: 4px 6px !important;
    }

    .modal-qty .qty-input {
        width: 15px !important;
        font-size: 11px !important;
    }
}