/* Premium CSS for Dom Miguel Atacadista */

:root {
    --primary: #0B2A3D;
    --primary-dark: #081A26;
    --accent: #C5A25A;
    --accent-dark: #A68B4A;
    --white: #FFFFFF;
    --gray-light: #F2F2F2;
    --gray-medium: #E8E8E8;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Tailwind Custom Colors */
.bg-primary {
    background-color: var(--primary);
}

.bg-primary-dark {
    background-color: var(--primary-dark);
}

.text-primary {
    color: var(--primary);
}

.bg-accent {
    background-color: var(--accent);
}

.bg-accent-dark {
    background-color: var(--accent-dark);
}

.text-accent {
    color: var(--accent);
}

.bg-gray-light {
    background-color: var(--gray-light);
}

.bg-gray-medium {
    background-color: var(--gray-medium);
}

/* Header Scroll Effect */
header.scrolled {
    background-color: rgba(11, 42, 61, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Premium Card Styles */
.premium-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.premium-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.premium-card:hover::before {
    transform: scaleX(1);
}

.premium-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Category Card */
.category-card {
    background: white;
    border-radius: 12px;
    padding: 3rem 2rem 2rem 2rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 420px;
}

/* Garantir que o grid de categorias tenha altura igual */
#categories-grid {
    align-items: stretch !important;
}

#categories-grid > .category-card {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(11, 42, 61, 0.05) 0%, rgba(197, 162, 90, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.category-card:hover::before {
    opacity: 1;
}

.category-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.category-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    transition: all 0.4s ease;
}

.category-card:hover .category-icon {
    transform: rotate(5deg) scale(1.1);
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

/* Category Image */
.category-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 1rem;
}

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

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

/* Category Subcategories */
.category-subcategories {
    text-align: left !important;
    padding: 0 1rem !important;
    margin-top: 1rem !important;
    margin-bottom: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto;
    min-height: 150px;
    justify-content: flex-start;
}

.category-subcategories div {
    font-size: 0.9rem !important;
    color: #666 !important;
    margin-bottom: 0.5rem !important;
    line-height: 1.5 !important;
    display: block !important;
}

/* Botão dentro do category-card */
.category-card .btn-primary {
    margin-top: 1.5rem !important;
    margin-bottom: 0 !important;
    align-self: center;
    flex-shrink: 0;
}

/* Product Card */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.product-image {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 1rem;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}

/* Aumentar altura da imagem para produtos de óleo */
#products-grid .product-image {
    height: 400px;
}

.product-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"><rect width="200" height="200" fill="%23f0f0f0"/><circle cx="100" cy="100" r="60" fill="none" stroke="%23ddd" stroke-width="2"/><circle cx="100" cy="100" r="40" fill="none" stroke="%23ddd" stroke-width="1"/></svg>') center/cover;
    opacity: 0.2;
}

.product-image i {
    font-size: 4rem;
    color: var(--primary);
    opacity: 0.2;
    z-index: 1;
    transition: all 0.4s ease;
}

.product-card:hover .product-image i {
    transform: scale(1.1);
    opacity: 0.3;
}

.product-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.product-weight {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 0.75rem;
}

.product-code {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 1rem;
}

.product-description {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 1rem;
    flex-grow: 1;
    line-height: 1.5;
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-block;
    text-align: center;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(11, 42, 61, 0.3);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-block;
    text-align: center;
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(197, 162, 90, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid var(--primary);
    cursor: pointer;
    display: inline-block;
    text-align: center;
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* Hero Section */
.hero-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, var(--accent) 100%);
    position: relative;
    overflow: hidden;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

/* Hero Slider */
.hero-slider {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.hero-slides {
    position: relative;
    width: 100%;
    height: 100vh;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
}

.hero-slide.active {
    opacity: 1;
    z-index: 2;
}

.hero-slide img:not(.hero-slide-soja) {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Imagem da soja - sem container branco */
.hero-slide .hero-slide-soja {
    position: absolute !important;
    right: 15% !important;
    left: auto !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 650px !important;
    height: 650px !important;
    max-width: 650px !important;
    max-height: 650px !important;
    object-fit: contain !important;
    object-position: center !important;
    z-index: 1 !important;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-slide .hero-slide-soja {
        width: 380px !important;
        height: 380px !important;
        max-width: 380px !important;
        max-height: 380px !important;
        right: 10% !important;
        left: auto !important;
    }
}

.hero-slide-title {
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
}

/* Slider Navigation Dots */
.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.slider-dot:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.slider-dot.active {
    background: var(--accent);
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;    border-color: var(--accent);
    width: 32px;
    border-radius: 6px;
}

/* Slider Arrows */
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 30;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.slider-arrow:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: var(--accent);
    transform: translateY(-50%) scale(1.1);
}

.slider-arrow-prev {
    left: 20px;
}

.slider-arrow-next {
    right: 20px;
}

/* Responsive Slider */
@media (max-width: 768px) {
    .slider-arrow {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .slider-arrow-prev {
        left: 10px;
    }
    
    .slider-arrow-next {
        right: 10px;
    }
    
    .hero-slide-title {
        font-size: 3rem !important;
    }
}

/* Wave Separator */
.wave-separator {
    position: relative;
    height: 100px;
    overflow: hidden;
}

.wave-separator svg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 2rem;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: var(--accent);
}

.breadcrumb span {
    color: #999;
}

/* Form Styles */
.form-input {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(11, 42, 61, 0.1);
}

.form-textarea {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    resize: vertical;
    min-height: 120px;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(11, 42, 61, 0.1);
}

/* Timeline */
.timeline-item {
    position: relative;
    padding-left: 3rem;
    padding-bottom: 3rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: -3rem;
    width: 2px;
    background: linear-gradient(180deg, var(--accent), var(--primary));
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-dot {
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 1.25rem;
    height: 1.25rem;
    background: var(--accent);
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 3px var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
    .category-card {
        padding: 2rem 1.5rem;
    }
    
    .product-image {
        height: 200px;
    }
}

/* Loading Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* WhatsApp Floating Button */

/* ===== PROTEÇÃO MÁXIMA PARA #whatsapp-btn ===== */
#whatsapp-btn {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#whatsapp-btn svg {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#whatsapp-btn > *:not(svg) {
    display: none !important;
}

/* ===== FIM PROTEÇÃO #whatsapp-btn ===== */


.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    min-width: 60px;
    min-height: 60px;
    max-width: 60px;
    max-height: 60px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: pulse-whatsapp 2s infinite;
    overflow: hidden;
    text-decoration: none;
    line-height: 0;
    padding: 0;
    margin: 0;
    border: none;
    box-sizing: border-box;
    font-size: 0;
}

/* Esconder qualquer texto que possa aparecer no botão */
.whatsapp-float:not(:has(i)):not(:has(svg)):not(#whatsapp-btn) {
    display: none;
}

/* Remover margem de classes Tailwind que possam estar no ícone */
.whatsapp-float .mr-2,
.whatsapp-float i.mr-2 {
    margin-right: 0 !important;
}

/* Esconder qualquer texto que não seja o ícone */
.whatsapp-float:not(:has(i))::before,
.whatsapp-float:not(:has(i))::after {
    display: none !important;
}

.whatsapp-float:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.6) !important;
}

.whatsapp-float i {
    font-size: 32px;
    color: white;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin: 0 !important;
    padding: 0;
    width: 32px;
    height: 32px;
    box-sizing: border-box;
}

/* Garantir que apenas o ícone seja visível, esconder qualquer texto */
.whatsapp-float {
    text-indent: -9999px;
    overflow: hidden;
    white-space: nowrap;
}

.whatsapp-float i {
    text-indent: 0;
    display: block;
}

/* Esconder qualquer texto que apareça no botão */
.whatsapp-float > *:not(i):not(svg) {
    display: none !important;
}

/* Garantir que o botão tenha apenas um ícone */
.whatsapp-float i:not(:first-of-type) {
    display: none !important;
}

.whatsapp-float:hover i {
    transform: scale(1.1);
}

/* Tooltip do WhatsApp */
.whatsapp-float::before {
    content: 'Fale conosco no WhatsApp' !important;
    position: absolute !important;
    right: 70px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: var(--primary) !important;
    color: white !important;
    padding: 10px 15px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    white-space: nowrap !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    z-index: 1001 !important;
}

.whatsapp-float::after {
    content: '';
    position: absolute;
    right: 65px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: var(--primary);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.whatsapp-float:hover::before,
.whatsapp-float:hover::after {
    opacity: 1;
}

/* Animação de pulso */
@keyframes pulse-whatsapp {
    0% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4), 0 0 0 10px rgba(37, 211, 102, 0.1);
    }
    100% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
}

/* Responsive WhatsApp Button */
@media (max-width: 768px) {
    .whatsapp-float {
        width: 56px;
        height: 56px;
        min-width: 56px;
        min-height: 56px;
        max-width: 56px;
        max-height: 56px;
        bottom: 15px;
        right: 15px;
    }
    
    .whatsapp-float i {
        font-size: 28px;
        width: 28px;
        height: 28px;
    }
    
    .whatsapp-float::before {
        right: 65px;
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .whatsapp-float::after {
        right: 60px;
    }
}

/* Language Selector Styles */
#language-selector {
    position: relative;
    z-index: 1000;
}

#language-dropdown {
    border: 1px solid rgba(0, 0, 0, 0.1);
    top: 100%;
    margin-top: 0.5rem;
    pointer-events: none; /* Desabilitar quando invisível */
    z-index: 1001;
    min-width: 200px;
}

#language-dropdown.visible {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important; /* Habilitar quando visível */
    display: block !important;
}

.language-option {
    color: #333;
    font-size: 0.95rem;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.language-option:hover {
    background-color: #f5f5f5;
}

.language-option:active {
    background-color: #e5e5e5;
}

.language-option-mobile {
    cursor: pointer;
    filter: grayscale(0.3);
    transition: all 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
}

.language-option-mobile:hover {
    filter: grayscale(0);
    transform: scale(1.15);
}

#language-btn {
    cursor: pointer;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

/* Active language indicator */
.language-option[data-lang="pt"].active,
.language-option[data-lang="es"].active,
.language-option[data-lang="en"].active {
    background-color: #f0f0f0;
    font-weight: 600;
}

/* Ajuste de enquadramento para imagem de Ovos de Codorna (categoria frango) */
.category-card.category-frango .category-image img {
    object-position: center 60%; /* desce um pouco o enquadramento da imagem */
}
