/* ============================================
   PATRONE ATACADISTA — Design System
   Cores baseadas na logo: Azul + Laranja
   ============================================ */

/* CSS Variables & Reset */
:root {
    --primary-color: #1E293B;       /* Azul-escuro sofisticado */
    --primary-light: #334155;       /* Azul-escuro mais claro */
    --secondary-color: #F97316;     /* Laranja da logo */
    --secondary-hover: #EA580C;     /* Laranja escuro (hover) */
    --accent-color: #2563EB;        /* Azul vibrante da logo */
    --accent-light: #3B82F6;        /* Azul claro */
    --text-color: #1E293B;
    --text-muted: #64748B;
    --bg-color: #F8FAFC;            /* Fundo azul-cinza suave */
    --white: #ffffff;
    --success: #16A34A;
    --danger: #DC2626;
    --border-color: #E2E8F0;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.15);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* Typography */
h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary-color);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   HEADER
   ============================================ */
header {
    background: var(--white);
    padding: 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.logo img {
    height: 50px;
    transition: var(--transition);
}

.logo img:hover {
    transform: scale(1.03);
}

.search-bar {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 12px 18px;
    border: 2px solid var(--border-color);
    border-right: none;
    border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
    font-family: var(--font-body);
    font-size: 0.95em;
    transition: var(--transition);
    background: var(--bg-color);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: var(--white);
}

.search-bar button {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-light));
    color: #fff;
    border: none;
    padding: 0 22px;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1em;
}

.search-bar button:hover {
    background: linear-gradient(135deg, #1D4ED8, var(--accent-color));
    transform: scale(1.02);
}

/* Autocomplete Dropdown */
.search-autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    z-index: 1050;
    max-height: 440px;
    overflow-y: auto;
    display: none;
}

.search-autocomplete-dropdown::-webkit-scrollbar {
    width: 6px;
}
.search-autocomplete-dropdown::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 4px;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--text-color);
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s ease;
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:hover,
.search-item.active {
    background-color: #f8fafc;
}

.search-item-img {
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

.search-item-info {
    flex: 1;
    min-width: 0;
}

.search-item-category {
    font-size: 0.72rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 2px;
}

.search-item-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 3px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-item-price {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary-color);
}

.search-item-badge {
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.search-item-badge.out-of-stock {
    background: #fee2e2;
    color: #dc2626;
}

.search-autocomplete-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 0.84rem;
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease;
}

.search-autocomplete-footer:hover {
    background: #eff6ff;
}

.search-empty,
.search-loading {
    padding: 18px 14px;
    text-align: center;
    color: #64748b;
    font-size: 0.88rem;
}

.header-actions {
    display: flex;
    gap: 25px;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9em;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.action-item:hover {
    background: var(--bg-color);
}

.action-item i {
    font-size: 1.5em;
    color: var(--accent-color);
}

.cart-badge-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--secondary-color);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.4);
    line-height: 1;
}

.action-item .text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.action-item .text span { font-weight: 600; color: var(--primary-color); }
.action-item .text small { color: var(--text-muted); }

/* Header Bottom (Menu) */
.header-bottom {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

.nav-row {
    display: flex;
    align-items: center;
    height: 50px;
}

.all-cats {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-right: 30px;
    color: var(--white);
}

.main-menu {
    display: flex;
    gap: 25px;
    flex: 1;
}

.main-menu a {
    font-size: 0.95em;
    font-weight: 500;
    color: rgba(255,255,255,0.85);
    position: relative;
    padding: 15px 5px;
    transition: var(--transition);
}

.main-menu a::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: width 0.3s ease;
}

.main-menu a:hover {
    color: #fff;
}

.main-menu a:hover::after {
    width: 100%;
}

.promo-btn {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-hover));
    color: #fff;
    padding: 8px 18px;
    border-radius: 50px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.promo-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
}

/* ============================================
   TRUST BADGES (Selos de Confiança)
   ============================================ */
.trust-badges {
    background: linear-gradient(135deg, #EFF6FF, #F0F9FF);
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.trust-badges .container {
    display: flex;
    justify-content: center;
    gap: 50px;
    flex-wrap: wrap;
}

.trust-badge {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    font-size: 0.9em;
    color: var(--primary-color);
    flex: 1 1 200px;
    text-align: left;
}

.trust-badge i {
    font-size: 2em;
    color: var(--accent-color);
    flex-shrink: 0;
}

.trust-badge div {
    display: flex;
    flex-direction: column;
}

.trust-badge strong {
    font-weight: 600;
}

.trust-badge small {
    color: var(--text-muted);
    font-size: 0.85em;
    margin-top: 2px;
}

/* ============================================
   CAROUSEL
   ============================================ */
.main-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    max-height: 500px;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.carousel-slide {
    display: none;
    width: 100%;
}
.carousel-slide.active { display: block; animation: fadeSlide 0.8s ease; }
.carousel-slide img { width: 100%; height: auto; object-fit: cover; }

@keyframes fadeSlide {
    from { opacity: 0; transform: scale(1.02); }
    to { opacity: 1; transform: scale(1); }
}

.carousel-nav {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    background: rgba(255,255,255,0.4);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}
.carousel-dot.active { 
    background: var(--secondary-color); 
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(249,115,22,0.5);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, rgba(30,41,59,0.85), rgba(37,99,235,0.75)), url('../logo.png');
    background-size: cover;
    background-position: center;
    color: var(--white);
    padding: 100px 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--white);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-hover));
    color: var(--white);
    padding: 12px 30px;
    border-radius: var(--border-radius-sm);
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.9em;
    letter-spacing: 0.5px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.25);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.35);
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: translateY(0);
}

/* ============================================
   PRODUCT GRID & CARDS
   ============================================ */
.products-section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 45px;
    position: relative;
    padding-bottom: 18px;
}

.section-title h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.section-title p {
    color: var(--text-muted);
    margin-top: 5px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--secondary-color));
    border-radius: 2px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 28px;
}

.product-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    position: relative;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
    border-color: rgba(37, 99, 235, 0.2);
}

.product-image {
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #fafafc;
    position: relative;
    overflow: hidden;
}

.product-image .product-img-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.product-image img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.06);
}

/* Badges */
.card-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    gap: 6px;
}

.card-badges .card-badge {
    position: static;
    pointer-events: auto;
}

.card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.badge-bestseller {
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    color: #ffffff;
    border: none;
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(239, 68, 68, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-available {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.badge-low {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

.badge-out {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.product-price-condition {
    font-size: 0.8rem;
    color: #059669;
    font-weight: 600;
    display: block;
    margin-top: 3px;
}

.product-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--white);
}

.product-title {
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--primary-color);
    font-weight: 600;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.9em;
}

.product-title a {
    color: var(--primary-color);
    transition: color 0.2s ease;
}

.product-title a:hover {
    color: var(--accent-color);
}

.product-price-box {
    margin-bottom: 15px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.product-price {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--accent-color);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.product-price-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.btn-buy {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.92rem;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination-wrapper {
    margin-top: 50px;
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.pagination-info {
    font-size: 0.92rem;
    color: var(--text-muted);
    background: #ffffff;
    padding: 6px 18px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.pagination-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
    padding: 0 16px;
    border-radius: 12px;
    background: var(--white);
    border: 2px solid #fdba74;
    color: var(--secondary-hover);
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.12);
    cursor: pointer;
}

.page-link:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-hover));
    border-color: var(--secondary-color);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(249, 115, 22, 0.4);
}

.page-link.active {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-hover)) !important;
    border-color: var(--secondary-color) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.45) !important;
    transform: translateY(-1px);
}

.page-link.next {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-hover)) !important;
    border: 2px solid var(--secondary-color) !important;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 1.05rem;
    padding: 0 24px;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.4) !important;
}

.page-link.next:hover {
    background: linear-gradient(135deg, var(--secondary-hover), #c2410c) !important;
    border-color: #c2410c !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(249, 115, 22, 0.6) !important;
    color: #ffffff !important;
}

.page-link.prev {
    background: var(--white);
    border: 2px solid #cbd5e1;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1rem;
    padding: 0 20px;
    gap: 8px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

.page-link.prev:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    background: #fff7ed;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.2);
}

.page-dots {
    padding: 0 8px;
    color: #94a3b8;
    font-weight: 800;
    font-size: 1.1rem;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0F172A 100%);
    color: var(--white);
    padding: 60px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
}

.footer-col h3 {
    margin-bottom: 20px;
    color: var(--secondary-color);
    font-size: 1.1em;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--secondary-color);
    border-radius: 1px;
}

.footer-col p {
    margin-bottom: 8px;
    color: rgba(255,255,255,0.75);
    font-size: 0.92em;
    line-height: 1.7;
}

.footer-col a {
    color: rgba(255,255,255,0.75);
    transition: var(--transition);
}

.footer-col a:hover {
    color: var(--secondary-color);
    padding-left: 5px;
}

.footer-col .social-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: rgba(255,255,255,0.08);
    border-radius: 50px;
    margin-top: 5px;
    transition: var(--transition);
}

.footer-col .social-link:hover {
    background: var(--secondary-color);
    color: #fff;
    padding-left: 15px;
}

.copyright {
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 20px;
    font-size: 0.88rem;
    color: rgba(255,255,255,0.5);
}

/* ============================================
   MOBILE RESPONSIVENESS
   ============================================ */
@media (max-width: 768px) {
    .header-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .logo {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .logo img {
        max-height: 55px;
        object-fit: contain;
    }

    .search-bar {
        width: 100%;
        max-width: 100%;
    }

    .search-bar form {
        width: 100%;
        display: flex;
    }

    .search-bar input {
        flex: 1;
        font-size: 1rem;
        padding: 12px;
    }

    .search-bar button {
        padding: 0 18px;
    }

    .header-actions {
        display: flex;
        justify-content: space-around;
        border-top: 1px solid var(--border-color);
        padding-top: 8px;
    }

    .action-item {
        flex-direction: column;
        gap: 3px;
        font-size: 0.75rem;
    }

    .action-item i {
        font-size: 1.4rem;
    }

    .action-item .text {
        display: block;
        text-align: center;
    }

    .header-bottom {
        display: none;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .trust-badges .container {
        gap: 20px;
    }

    .trust-badge {
        font-size: 0.8em;
    }

    .products-section {
        padding: 30px 0;
    }

    .container {
        padding: 0 12px;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }

    .product-card {
        border-radius: 12px;
    }

    .product-image {
        height: 150px;
        padding: 10px;
    }

    .card-badge {
        font-size: 0.62rem;
        padding: 2px 6px;
        top: 6px;
        left: 6px;
    }

    .product-info {
        padding: 10px 8px;
    }

    .product-title {
        font-size: 0.82rem;
        min-height: 2.4em;
        margin-bottom: 6px;
        line-height: 1.35;
    }

    .product-price-box {
        margin-bottom: 8px;
        padding-top: 6px;
    }

    .product-price {
        font-size: 1.12rem;
    }

    .product-price-sub {
        font-size: 0.66rem;
    }

    .btn-buy {
        padding: 8px 6px;
        font-size: 0.8rem;
        border-radius: 8px;
        gap: 4px;
    }

    .section-title {
        margin-bottom: 25px;
    }

    .section-title h2 {
        font-size: 1.35rem;
    }

    .pagination-wrapper {
        margin-top: 35px;
        gap: 12px;
    }

    .pagination-info {
        font-size: 0.82rem;
        padding: 4px 14px;
    }

    .page-link {
        min-width: 42px;
        height: 42px;
        padding: 0 12px;
        font-size: 0.92rem;
        border-radius: 10px;
    }

    .page-link.next,
    .page-link.prev {
        padding: 0 16px;
        font-size: 0.9rem;
    }
}