/* SiteCatalogo - Frontend Styles */

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #dbeafe;
    --secondary: #0f172a;
    --accent: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}
@media (max-width: 768px) {
    .container { flex-direction: column !important; }
    aside { width: 100% !important; margin-bottom: 20px; }
}
/* --- CONFIGURAÇÕES PARA DESKTOP (Telas > 768px) --- */
    @media (min-width: 769px) {
        .mobile-only { display: none !important; }
    }

    /* --- CONFIGURAÇÕES PARA MOBILE (Telas <= 768px) --- */
    @media (max-width: 768px) {
        /* Esconde elementos que não queremos no mobile (Sidebar e Busca) */
        .desktop-only { display: none !important; }
        
        /* Menu de Categorias Sticky no topo */
        .mobile-only {
            position: -webkit-sticky;
            position: sticky;
            top: 0; /* Se tiver um menu fixo no seu site, ajuste para ex: top: 60px; */
            z-index: 999;
            background: #fff;
            box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        }
    }

/* ==================== HEADER ==================== */

.site-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.95);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--gray-900);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

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

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #25d366;
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.btn-whatsapp:hover {
    background: #128c7e;
    color: white;
    transform: translateY(-1px);
}

.btn-login {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--gray-100);
    color: var(--gray-600);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.btn-login:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

/* ==================== HERO ==================== */

.hero-section {
    background: var(--secondary);
}

.hero-banner,
.hero-slide {
    min-height: 500px !important;
    display: flex;
    align-items: center;
    padding: 60px 0;
}

.hero-content {
    max-width: 600px;
    color: white;
}

.hero-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.125rem;
    color: var(--gray-300);
    margin-bottom: 28px;
    line-height: 1.6;
}

.hero-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 20px 0;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: var(--transition);
}

.dot.active {
    background: var(--primary);
    width: 28px;
    border-radius: 5px;
}

/* ==================== BUTTONS ==================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.btn-text {
    background: transparent;
    color: var(--gray-500);
}

.btn-text:hover {
    color: var(--gray-700);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 14px 24px;
    font-size: 1rem;
}

/* ==================== TOOLBAR ==================== */

.toolbar {
    padding: 24px 0;
}

.search-form {
    display: flex;
    gap: 10px;
    max-width: 100%;
}

.search-input-wrap {
    flex: 1;
    position: relative;
}

.search-input-wrap i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 0.875rem;
}

.search-input {
    width: 100%;
    padding: 11px 14px 11px 40px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-family: inherit;
    background: white;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* ==================== LAYOUT ==================== */

.content-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 32px;
    padding-bottom: 60px;
}

/* ==================== SIDEBAR ==================== */

.sidebar-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--gray-200);
    position: sticky;
    top: 84px;
}

.sidebar-card h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.category-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
}

.category-link i {
    width: 18px;
    text-align: center;
    color: var(--gray-400);
    font-size: 0.8125rem;
}

.category-link:hover {
    background: var(--gray-50);
    color: var(--gray-800);
}

.category-link.active {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 600;
}

.category-link.active i {
    color: var(--primary);
}

.category-link .count {
    margin-left: auto;
    background: var(--gray-100);
    color: var(--gray-500);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
}

/* ==================== PRODUCTS ==================== */

.products-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.products-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
}
/* Container fixado no canto INFERIOR DIREITO */
#toastContainer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse; /* Novo toast entra por baixo */
    gap: 10px;
    pointer-events: none; /* Não bloqueia cliques na página */
}

/* O item do Toast (Estilo inicial: escondido na direita) */
.toast-item {
    pointer-events: auto; /* Reativa os cliques dentro do toast */
    opacity: 0;
    transform: translateX(50px); /* Começa 50px deslocado para a direita */
    /* Transição de 0.5s (500ms) mais suave e desacelerada no final */
    transition: opacity 0.5s cubic-bezier(0.25, 1, 0.5, 1), 
                transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Estado Visível (Garante a entrada suave) */
.toast-item.show {
    opacity: 1;
    transform: translateX(0);
}
.results-count {
    font-size: 0.8125rem;
    color: var(--gray-400);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.product-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--gray-300);
}

.product-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: var(--gray-100);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.badge {
    position: absolute;
    top: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-destaque {
    left: 10px;
    background: var(--warning);
    color: white;
}

.badge-promo {
    right: 10px;
    background: var(--danger);
    color: white;
}

.badge-esgotado {
    right: 10px;
    background: var(--gray-600);
    color: white;
}

.product-info {
    padding: 16px;
}

.product-category {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
}

.product-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-desc {
    font-size: 0.8125rem;
    color: var(--gray-500);
    line-height: 1.5;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-price {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.price-current {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
}

.price-old {
    font-size: 0.8125rem;
    color: var(--gray-400);
    text-decoration: line-through;
}

.price-consult {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-500);
    font-style: italic;
}

.btn-add-cart {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-add-cart:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.btn-add-cart.added {
    background: var(--accent);
}

/* ==================== EMPTY STATE ==================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
}

.empty-state svg {
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.875rem;
}

/* ==================== PAGINATION ==================== */

.pagination-wrap {
    margin-top: 32px;
}

.pagination-nav {
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    gap: 6px;
    align-items: center;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    background: white;
    border: 1px solid var(--gray-200);
    text-decoration: none;
    transition: var(--transition);
}

.page-link:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.page-link.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-link.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ==================== CART SIDEBAR ==================== */

.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.cart-overlay.open {
    opacity: 1;
    visibility: visible;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 90vw;
    height: 100%;
    background: white;
    z-index: 210;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
}

.cart-sidebar.open {
    transform: translateX(0);
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--gray-200);
}

.cart-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    cursor: pointer;
    color: var(--gray-500);
    transition: var(--transition);
}

.cart-close:hover {
    background: var(--gray-200);
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--gray-400);
    text-align: center;
}

.cart-empty p {
    margin-top: 12px;
    font-weight: 500;
    color: var(--gray-500);
}

.cart-empty span {
    font-size: 0.8125rem;
    margin-top: 4px;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

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

.cart-item-name {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    font-size: 0.8125rem;
    color: var(--primary);
    font-weight: 600;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cart-item-actions button {
    width: 26px;
    height: 26px;
    border: none;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    color: var(--gray-600);
    font-size: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-200);
}

.cart-item-actions button:hover {
    background: var(--gray-100);
}

.cart-item-actions button.btn-remove {
    color: var(--danger);
    margin-left: 4px;
}

.cart-item-actions span {
    font-size: 0.8125rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.cart-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 1rem;
}

.cart-total strong {
    color: var(--primary);
    font-size: 1.125rem;
}

.cart-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.cart-toggle:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    font-size: 0.6875rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== MODAL ==================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    background: white;
    border-radius: var(--radius);
    z-index: 310;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
}

.modal.open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    cursor: pointer;
    color: var(--gray-500);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

/* ==================== FORMS ==================== */

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--gray-800);
    background: white;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--gray-600);
    transition: var(--transition);
}

.radio-label:hover {
    border-color: var(--primary);
}

.radio-label input[type="radio"] {
    width: auto;
    margin: 0;
}

.radio-label input[type="radio"]:checked + i,
.radio-label:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
}

.cart-summary {
    background: var(--gray-50);
    padding: 12px;
    border-radius: var(--radius-sm);
    margin: 16px 0;
    font-size: 0.8125rem;
}

.cart-summary p {
    margin-bottom: 4px;
    color: var(--gray-600);
}

.cart-summary hr {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: 8px 0;
}

.success-message {
    text-align: center;
    padding: 20px;
}

.success-message h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 16px 0 8px;
}

.success-message p {
    color: var(--gray-500);
    margin-bottom: 20px;
}

/* ==================== FOOTER ==================== */

.site-footer {
    background: var(--secondary);
    color: var(--gray-300);
    padding: 48px 0 24px;
    margin-top: 60px;
}

.footer-inner {
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: white;
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 12px;
}

.footer-desc {
    color: var(--gray-400);
    font-size: 0.875rem;
    margin-bottom: 20px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.footer-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-300);
    transition: var(--transition);
}

.footer-links a:hover {
    background: var(--primary);
    color: white;
}

.footer-copy {
    font-size: 0.8125rem;
    color: var(--gray-500);
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
    .content-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .hero-content h1 {
        font-size: 1.75rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .header-actions span {
        display: none;
    }
    
    .btn-whatsapp,
    .btn-login {
        padding: 8px 12px;
    }
    .grid-produtos {
            grid-template-columns: repeat(2, 1fr) !important;
            gap: 10px !important; /* Opcional: reduz um pouco o gap no mobile para caber melhor */
        }
}
