:root {
    --primary-color: #2ecc71;
    --primary-rgb: 46, 204, 113;
    --secondary-color: #27ae60;
    --text-color: #2c3e50;
    --text-muted: #7f8c8d;
    --border-color: #e0e0e0;
    --card-bg: #ffffff;
    --body-bg: #f8f9fa;
    --border-radius: 15px;
    --transition-speed: 0.3s;
    --brand-gradient: linear-gradient(45deg, #6a11cb 0%, #2575fc 100%);
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --stock-available: #198754;
    --page-bg: #f7f7f9;
}

body {
    background-color: var(--page-bg);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Cards de Seção */
.sessao-card {
    border: none;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    background: var(--card-bg);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: scaleIn 0.5s ease-out;
    margin-bottom: 0.25rem;
}

.sessao-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.sessao-imagem-container {
    position: relative;
    height: 80px;
    overflow: hidden;
}

.sessao-imagem {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-speed) ease;
}

.sessao-card:hover .sessao-imagem {
    transform: scale(1.05);
}

.sessao-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 5px;
    color: white;
}

.sessao-titulo {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Campo de Pesquisa */
.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.search-container input {
    padding-left: 40px;
    padding-right: 40px;
    border-radius: 25px;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    font-size: 1.1rem;
    transition: all var(--transition-speed) ease;
}

.search-container input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.25);
}

.search-icon {
    position: absolute;
    left: 35px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.btn-clear {
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
}

.btn-clear:hover {
    color: var(--text-color);
}

/* Cards de Produto */
.produto-card {
    border: none;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    background: var(--card-bg);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease-out;
}

.produto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.produto-imagem {
    height: 200px;
    object-fit: cover;
    transition: transform var(--transition-speed) ease;
}

.produto-card:hover .produto-imagem {
    transform: scale(1.05);
}

.produto-info {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.produto-preco {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.produto-unidade {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* Input de Quantidade e Botão de Adicionar */
.quantidade-input {
    border-radius: 20px 0 0 20px;
    border: 2px solid var(--border-color);
    padding: 0.5rem 1rem;
    font-size: 1rem;
    transition: all var(--transition-speed) ease;
}

.quantidade-input:focus {
    border-color: var(--primary-color);
    box-shadow: none;
}

.adicionar-carrinho {
    border-radius: 0 20px 20px 0;
    padding: 0.5rem 1rem;
    transition: all var(--transition-speed) ease;
}

.adicionar-carrinho:hover {
    transform: scale(1.05);
}

/* Paginação */
.pagination {
    margin-top: 2rem;
}

.page-link {
    color: var(--primary-color);
    border: none;
    padding: 0.5rem 1rem;
    margin: 0 0.2rem;
    border-radius: 20px;
    transition: all var(--transition-speed) ease;
}

.page-link:hover {
    background-color: var(--primary-color);
    color: white;
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Responsividade */
@media (max-width: 768px) {
    .sessao-imagem-container {
        height: 150px;
    }
    
    .sessao-titulo {
        font-size: 1rem;
    }
    
    .produto-imagem {
        height: 150px;
    }
    
    .produto-info {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    .produto-preco {
        font-size: 1.1rem;
    }
    
    .search-container {
        padding: 10px;
    }
    
    .search-container input {
        font-size: 1rem;
    }
}

/* Mensagens de Feedback */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    min-width: 300px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transform: translateX(120%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.toast-success .toast-icon {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.toast-message {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ajuste do grid para 4 colunas em telas grandes */
@media (min-width: 992px) {
    .row-cols-lg-6 > * {
        flex: 0 0 auto;
        width: 16.666667%;
    }
}

/* Ajuste do espaçamento entre os cards */
.row-cols-2.row-cols-sm-3.row-cols-md-4.row-cols-lg-6.g-2 {
    --bs-gutter-y: 0.5rem;
    --bs-gutter-x: 0.5rem;
}

/* Cards de Produto Premium */
.product-card-premium {
    display: flex;
    background-color: var(--card-bg);
    border-radius: 1rem;
    box-shadow: 0 4px 25px rgba(0,0,0,0.07);
    overflow: hidden;
    position: relative;
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid #e9ecef;
    width: 100%;
}

.product-card-premium:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 12px 35px rgba(0,0,0,0.1);
}

.product-image-container {
    flex-shrink: 0;
    width: 40%;
    min-width: 250px;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card-premium:hover .product-image {
    transform: scale(1.1);
}

.product-details {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.product-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.product-title-gradient {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

.product-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.product-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
}

.stock-status {
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    color: var(--stock-available);
}

.stock-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background-color: var(--stock-available);
    border-radius: 50%;
    margin-right: 0.5rem;
}

.product-pricing {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.current-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.old-price {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

.product-actions {
    margin-top: auto;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 100px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease-in-out;
}

.product-card-premium:hover .quantity-control {
    opacity: 1;
    transform: translateY(0);
}

.quantity-control .btn {
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #2575fc;
}

.quantity-display {
    font-weight: 500;
    color: var(--text-primary);
    padding: 0 0.75rem;
    font-size: 1.1rem;
}

.quantity-display .quantidade-input {
    border: none;
    text-align: center;
    width: 50px;
    padding: 0;
    margin: 0;
    font-weight: 500;
    color: var(--text-primary);
    background: transparent;
}

.quantity-display .quantidade-input:focus {
    box-shadow: none;
    outline: none;
}

.remove-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #f1f1f1;
    color: var(--text-secondary);
    text-decoration: none;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    border: none;
    padding: 0;
}

.product-card-premium:hover .remove-btn {
    opacity: 1;
    transform: scale(1);
}

.remove-btn:hover {
    background-color: #e44d4d;
    color: white;
    transform: scale(1.1) !important;
}

@media (max-width: 768px) {
    .product-card-premium {
        display: flex;
        flex-direction: row;
        padding: 0.5rem;
        align-items: flex-start;
        min-height: auto;
        gap: 0.75rem;
    }

    .product-image-container {
        width: 80px;
        height: 80px;
        min-width: 80px;
        max-width: 80px;
        margin: 0;
        padding: 0;
        border-radius: 8px;
        overflow: hidden;
        flex: 0 0 80px;
        aspect-ratio: 1;
    }

    .product-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .product-details {
        padding: 0;
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        align-items: flex-end;
        text-align: right;
    }

    .product-info {
        width: 100%;
        text-align: right;
    }

    .product-title {
        font-size: 0.9rem;
        margin-bottom: 0;
        line-height: 1.2;
    }

    .product-description,
    .product-meta,
    .old-price {
        display: none;
    }

    .product-pricing {
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 0.1rem;
    }

    .current-price {
        font-size: 1rem;
        font-weight: 600;
    }

    .product-unit {
        font-size: 0.8rem;
        color: var(--text-secondary);
        margin-left: 0.25rem;
    }

    .product-actions {
        margin: 0;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        gap: 0.5rem;
    }

    .quantity-control {
        opacity: 1;
        transform: none;
        background: white;
        width: fit-content;
        height: 28px;
        border-radius: 14px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        background-image: none;
    }

    .quantity-control .btn {
        width: 24px;
        height: 24px;
        padding: 0;
    }

    .quantity-display {
        padding: 0 0.25rem;
        background-image: none;
    }

    .quantity-display .quantidade-input {
        width: 30px;
        font-size: 0.85rem;
        height: 24px;
        padding: 0;
        text-align: center;
    }

    .add-to-cart-btn {
        margin-top: 0;
        padding: 0.25rem 0.75rem;
        font-size: 0.85rem;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.25rem;
        width: auto;
    }

    .remove-btn {
        display: none;
    }
}

@media (max-width: 480px) {
    .product-card-premium {
        padding: 0.35rem;
        gap: 0.5rem;
    }

    .product-image-container {
        width: 70px;
        height: 70px;
        min-width: 70px;
        max-width: 70px;
        flex: 0 0 70px;
        aspect-ratio: 1;
    }

    .product-title {
        font-size: 0.85rem;
    }

    .current-price {
        font-size: 0.9rem;
    }

    .product-unit {
        font-size: 0.75rem;
        margin-left: 0.2rem;
    }

    .quantity-control {
        height: 24px;
        border-radius: 12px;
        background-image: none;
    }

    .quantity-display {
        padding: 0 0.25rem;
        background-image: none;
    }

    .quantity-control .btn {
        width: 22px;
        height: 22px;
        padding: 0;
    }

    .quantity-display .quantidade-input {
        width: 25px;
        font-size: 0.8rem;
        height: 22px;
    }

    .add-to-cart-btn {
        padding: 0.2rem 0.6rem;
        font-size: 0.8rem;
        height: 24px;
        gap: 0.2rem;
    }

    .remove-btn {
        display: none;
    }
}

/* Ajuste do grid para reduzir espaçamento vertical */
#produtos {
    --bs-gutter-y: 0.5rem;
}

#produtos .col-12 {
    margin-bottom: 0.5rem;
} 