/*
Theme Name: AfiliadoTheme
Theme URI: 
Author: Antigravity Assistant
Author URI: 
Description: Um tema focado em conversão de links de afiliado com visual de e-commerce moderno.
Version: 1.3.0
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.0
Text Domain: afiliadotheme
*/

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
	--color-primary: #2D6CDF;
	--color-light: #6FA3FF;
	--color-dark: #1E4FA8;
	--color-soft: #F4F7FB; /* Cor de fundo da home */
	--color-bg: #FFFFFF;
	--color-text: #555555; /* Texto mais suave para subcategorias */
	--color-title: #111111;
	
	--color-buy-button: #318a47; /* Verde do botão (baseado no layout) */
	--color-buy-button-hover: #267138;
}

/* ==========================================================================
   Base Reset
   ========================================================================== */
*, *::before, *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	background-color: var(--color-soft); /* Fundo geral claro */
	color: var(--color-text);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
	color: var(--color-title);
	font-weight: 700;
	line-height: 1.3;
}

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

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

img {
	max-width: 100%;
	height: auto;
	display: block;
}

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

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
	background-color: var(--color-bg);
	padding: 20px 0;
	position: sticky;
	top: 0;
	z-index: 100;
    /* Remover borda pra ficar limpo e botar sombra bem suave */
	box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}

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

.logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--color-title);
}
.logo-link:hover { color: var(--color-title); }

.site-bag-icon {
    stroke: var(--color-title);
}

.site-title-text {
	font-size: 1.6rem;
	font-weight: 800;
	margin: 0;
    letter-spacing: -0.5px;
}

.custom-logo-wrapper img, .custom-logo {
    max-height: 40px;
    width: auto;
    display: block;
}

.main-navigation ul, .main-navigation div > ul {
	list-style: none;
	display: flex;
	gap: 25px;
    margin: 0;
    padding: 0;
}

.main-navigation a {
	color: var(--color-text);
	font-weight: 500;
    font-size: 1rem;
}

.main-navigation a:hover {
	color: var(--color-title);
}

/* ==========================================================================
   FRONT PAGE - HERO & CATEGORIAS (4 COLUNAS)
   ========================================================================== */
.home-hero {
    text-align: center;
    padding: 60px 0 40px;
}

.hero-title {
    font-size: 2.5rem;
    color: var(--color-title);
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: #6c757d;
    max-width: 600px;
    margin: 0 auto;
}

/* 4 columns grid for Home Categories */
.categories-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 24px;
    margin-bottom: 50px;
}

@media (min-width: 992px) {
	.categories-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

.category-card {
	background-color: var(--color-bg);
	border-radius: 12px;
	overflow: hidden;
    position: relative;
    border: 1px solid rgba(0,0,0,0.04);
}

/* Remove hover scale to match cleaner look */
.category-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.06);
}

.category-thumbnail {
	background-color: #ffffff;
    height: 180px; 
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.category-thumbnail img {
    max-height: 100%;
    object-fit: contain;
}

.category-info {
	padding: 20px;
}

.category-title {
	font-size: 1.25rem;
	margin-bottom: 5px;
    color: var(--color-title);
}

.category-desc {
    font-size: 0.9rem;
    color: var(--color-text);
    margin: 0;
}

/* ==========================================================================
   OFERTA POPULAR BANNER (HOME)
   ========================================================================== */
.oferta-popular {
    margin-bottom: 20px;
}

.oferta-inner {
    background-color: var(--color-bg);
    border-radius: 12px;
    padding: 30px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    border: 1px solid rgba(0,0,0,0.04);
}

.oferta-badge {
    font-size: 0.85rem;
    font-weight: 700;
    color: #4a5568;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: block;
}

.oferta-title {
    font-size: 1.5rem;
    color: var(--color-title);
    margin: 0;
    max-width: 400px;
}

.oferta-action {
    display: flex;
    align-items: center;
    gap: 20px;
}

.oferta-img {
    max-height: 80px;
    border-radius: 6px;
}
.oferta-img-placeholder {
    font-size: 2.5rem;
    opacity: 0.5;
}

/* Green Button */
.green-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--color-buy-button);
    color: #ffffff !important;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    transition: background-color 0.2s ease;
}
.green-btn:hover { background-color: var(--color-buy-button-hover); }

.site-disclaimer {
    text-align: center;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 60px;
}

/* ==========================================================================
   ARCHIVE / REGULAR POSTS GRID (3 COLUNAS)
   ========================================================================== */
.site-main:not(.home) { padding: 40px 0; }
.page-header { margin-bottom: 30px; }

.products-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 30px;
}
@media (min-width: 992px) {
	.products-grid { grid-template-columns: repeat(3, 1fr); }
}

.product-card {
	background-color: var(--color-bg);
	border: 1px solid #e1e8f0;
	border-radius: 8px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
.product-thumbnail { aspect-ratio: 1 / 1; }
.product-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.product-info { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.product-title { font-size: 1.1rem; margin-bottom: 15px; flex-grow: 1; }
.product-title a:hover { color: var(--color-primary); }

.product-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.btn-buy-small, .btn-details {
    flex: 1;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 10px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-buy-small {
    background-color: var(--color-buy-button);
    color: #ffffff !important;
    border: 1px solid var(--color-buy-button);
}
.btn-buy-small:hover {
    background-color: var(--color-buy-button-hover);
    border-color: var(--color-buy-button-hover);
}

.btn-details {
    background-color: #ffffff;
    color: var(--color-text);
    border: 1px solid #d1d9e6;
}
.btn-details:hover {
    background-color: #f1f5f9;
    color: var(--color-title);
    border-color: #cbd5e1;
}

.btn-buy {
	display: inline-block; background-color: var(--color-buy-button); color: #ffffff !important;
	padding: 12px 20px; border-radius: 6px; text-align: center; font-weight: 600; text-transform: uppercase; font-size: 0.95rem;
}

/* ==========================================================================
   SINGLE PRODUCT PAGE (E-COMMERCE STYLE)
   ========================================================================== */
.single-product-page {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
    margin-bottom: 40px;
}

.product-top-row {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-bottom: 50px;
}

@media (min-width: 768px) {
    .product-top-row {
        flex-direction: row;
    }
    .product-gallery-col {
        flex: 1;
        max-width: 50%;
    }
    .product-info-col {
        flex: 1;
    }
}

.product-main-image {
    background: #f8fafc;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    border: 1px solid #e2e8f0;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-main-image img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: opacity 0.3s;
}

.product-gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.gallery-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.7;
    transition: all 0.2s;
}

.gallery-thumb:hover {
    opacity: 1;
}

.gallery-thumb.active {
    border-color: var(--color-primary);
    opacity: 1;
}

.product-info-col .entry-title {
    font-size: 2rem;
    margin-top: 0;
    margin-bottom: 15px;
    line-height: 1.2;
}

.product-short-desc {
    color: #475569;
    font-size: 1.05rem;
    margin-bottom: 30px;
    line-height: 1.6;
}

.product-buy-action {
    background: #f8fafc;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.product-buy-action .btn-buy {
    background-color: var(--color-buy-button);
    display: block;
    width: 100%;
    padding: 16px;
    font-size: 1.15rem;
}
.product-buy-action .btn-buy:hover {
    background-color: var(--color-buy-button-hover);
}

.safe-buy-text {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 12px;
    margin-bottom: 0;
}

.section-title {
    font-size: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* FAQ Accordion */
.faq-accordion {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.faq-item {
    border-bottom: 1px solid #e2e8f0;
}
.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    padding: 15px 20px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1.05rem;
    color: var(--color-title);
    list-style: none; /* Hide default triangle in clear browsers */
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--color-primary);
}
.faq-item[open] .faq-question::after {
    content: '-';
}

.faq-answer {
    padding: 0 20px 20px;
    color: var(--color-text);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
	background-color: var(--color-dark);
	color: #ffffff;
	padding: 60px 0 20px;
}
.site-footer a { color: var(--color-light); }
.site-footer a:hover { color: #ffffff; }
.site-footer h4.widget-title { color: #ffffff; font-size: 1.2rem; margin-bottom: 20px; }
.footer-widgets {
	display: grid; grid-template-columns: 1fr; gap: 30px; margin-bottom: 40px;
}
@media (min-width: 576px) { .footer-widgets { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .footer-widgets { grid-template-columns: repeat(4, 1fr); } }
.widget ul { list-style: none; }
.widget ul li { margin-bottom: 10px; }
.site-info { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; text-align: center; font-size: 0.9rem; color: var(--color-soft); }

/* ==========================================================================
   Carousel Widget Styles
   ========================================================================== */
.aft-carousel-wrapper {
    position: relative;
    max-width: 100%;
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.aft-carousel-slides {
    position: relative;
    width: 100%;
    background: var(--color-soft);
}

.aft-carousel-slide {
    display: none;
    width: 100%;
}

.aft-carousel-slide.active {
    display: block;
    animation: afiFadeIn 0.5s ease-out forwards;
}

.aft-carousel-slide img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

@keyframes afiFadeIn {
    from { opacity: 0; transform: scale(0.99); }
    to { opacity: 1; transform: scale(1); }
}

.aft-carousel-prev,
.aft-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.3);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    z-index: 2;
}

.aft-carousel-prev:hover,
.aft-carousel-next:hover {
    background: rgba(0,0,0,0.8);
}

.aft-carousel-prev { left: 10px; }
.aft-carousel-next { right: 10px; }

.aft-carousel-dots {
    position: absolute;
    bottom: 15px;
    width: 100%;
    text-align: center;
    z-index: 2;
}

.aft-dot {
    cursor: pointer;
    height: 10px;
    width: 10px;
    margin: 0 5px;
    background-color: rgba(255,255,255,0.5);
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.aft-dot.active, .aft-dot:hover {
    background-color: var(--color-primary);
}

.aft-carousel-caption {
    position: absolute;
    bottom: 40px;
    left: 40px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 30px;
    border-radius: 8px;
    max-width: 400px;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.5s ease 0.3s;
}

.aft-carousel-slide.active .aft-carousel-caption {
    transform: translateY(0);
    opacity: 1;
}

.aft-carousel-caption h3 {
    margin: 0 0 15px 0;
    font-size: 1.5rem;
    color: var(--color-title);
    line-height: 1.3;
}

.aft-carousel-btn {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s;
}

.aft-carousel-slide a:hover .aft-carousel-btn {
    background: var(--color-dark);
}

@media (max-width: 768px) {
    .aft-carousel-caption {
        bottom: 30px; 
        left: 15px; 
        right: 15px; 
        max-width: auto; 
        padding: 15px; 
        text-align: center;
    }
    .aft-carousel-caption h3 { font-size: 1.2rem; }
}
