/**
 * Estilos customizados COMUNS para templates do m�dulo Peti��es Custom Theme
 * Este arquivo cont�m:
 * - Vari�veis CSS
 * - Reset CSS
 * - Estilos do Header
 * - Estilos do Footer
 * - Estilos Mobile Responsivos
 */

/* ========================================
   VARI�VEIS CSS
   ======================================== */
:root {
    --primary-green: #2d5f2e;
    --secondary-green: #4a8f4d;
    --light-green: #6bc96e;
    --accent-green: #8ed18f;
    --dark-green: #1a3d1b;
    --gold-accent: #d4af37;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --gray: #6c757d;
    --dark-gray: #343a40;
    --font-primary: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ========================================
   RESET CSS
   ======================================== */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    color: var(--dark-gray);
    background: var(--light-gray);
    padding-top: 0;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Prevenir overflow horizontal em mobile */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    * {
        max-width: 100%;
    }

    /* Garantir que containers principais n�o excedam viewport */
    .container,
    .container-fluid,
    .row {
        max-width: 100%;
        overflow-x: hidden;
    }
}

/* ========================================
   HEADER & NAVIGATION
   ======================================== */

.site-header {
    background: var(--white);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 1000;
    transition: all 0.3s ease;
    width: 100%;
}

.site-header.scrolled {
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.12);
}

/* ===== HEADER TOP (Logo, Busca, Autentica��o) ===== */
.header-top {
    background: #203A24;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    width: 100% !important;
}

.header-top-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: space-between;
}

/* Logo */
.navbar-brand {
    padding: 0;
    display: flex;
    align-items: center;
    transition: opacity 0.3s ease;
    flex-shrink: 0;
}

.navbar-brand:hover {
    opacity: 0.8;
}

.logo-img {
    height: 45px;
    width: auto;
    max-width: 200px;
    transition: height 0.3s ease;
}

.site-header.scrolled .logo-img {
    height: 40px;
}

/* Campo de Busca */
.header-search {
    flex: 1;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.search-form {
    width: 100%;
}

.search-input-wrapper .ae {
    display: none;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 1rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.5rem 0.9rem 0.5rem 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    outline: none;
    background: rgba(255, 255, 255, 0.95);
}

.search-input:focus {
    border-color: var(--white);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
    background: var(--white);
}

.search-input::placeholder {
    color: #999;
}

/* Bot�o Lupa */
.search-icon-btn {
    position: absolute;
    top: 50%;
    right: 0px;
    transform: translateY(-50%);
    background: transparent !important;
    border: none !important;
    color: #666;
    font-size: 1.2rem;
    z-index: 10;
    padding: 0 10px;
    cursor: pointer;
}

.search-icon-btn:hover {
    color: #000;
    background: transparent;
}

/* Backdrop para busca ativa */
#peticoes-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.65);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

body.search-active #peticoes-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

body.search-active {
    overflow: hidden;
}

body.search-active .search-input-wrapper {
    position: relative;
    z-index: 9999;
}

body.search-active .search-input-wrapper input.form-control {
    background-color: #fff !important;
    border-color: #fff !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    color: #212529;
}

body.search-active .header-search {
    position: relative;
    z-index: 10001;
}

body.search-active header,
body.search-active .site-header {
    position: relative;
    z-index: 10001;
    transform: none !important;
    opacity: 1 !important;
}

body.search-active .header-top-content {
    position: relative;
    z-index: 10001;
}

body.search-active .search-input-wrapper {
    position: relative;
    z-index: 10002;
}

/* Bot�es de Autentica��o */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-shrink: 0;
    margin-left: auto;
}

.btn-auth {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--white);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

.btn-auth:hover {
    background: rgba(255, 255, 255, 0.25);
    color: var(--white);
    transform: translateY(-1px);
}

.btn-auth:active {
    transform: translateY(0);
}

.btn-auth i {
    font-size: 1.1rem;
}

.btn-register {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--white);
    color: var(--white);
    font-weight: 600;
}

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

.btn-login {
    background: var(--white);
    color: var(--primary-green) !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    background: var(--light-gray);
}

.btn-cart {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: auto;
    min-width: 55px;
    height: 44px;
    padding: 0 15px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: var(--white);
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-cart > i.bi-cart3 {
    position: absolute;
    left: 5px;
}

.btn-cart > i.bi-arrow-right-short {
    position: absolute;
    right: 2px;
    line-height: 0;
}

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

.btn-cart i {
    font-size: 1.3rem;
}

.btn-cart .cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ===== MENU PRINCIPAL (Linha Inferior) ===== */
.navbar-main {
    background: var(--secondary-green);
    padding: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.navbar-main .container {
    padding: 0;
}

/* Navigation Links (Menu Principal) */
.navbar-nav {
    gap: 0.2rem;
    padding: 0.5rem 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.5rem 1rem !important;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.3s ease;
    position: relative;
    border-bottom: 3px solid transparent;
}

.nav-link i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.nav-link:hover {
    color: var(--white) !important;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link:hover i {
    transform: scale(1.1);
}

/* Active state indicator */
.nav-item .nav-link.active {
    color: var(--white) !important;
    border-bottom-color: var(--white);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile Menu Toggle */
.navbar-toggler {
    border: 2px solid var(--white);
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
    transition: all 0.3s ease;
    display: none;
}

.navbar-toggler:hover {
    background: rgba(255, 255, 255, 0.15);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    width: 24px;
    height: 24px;
}

/* Breadcrumb */
.breadcrumb-wrapper {
    padding: 0.8rem 0;
    background: transparent;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
    display: flex;
    flex-wrap: nowrap;
    flex-direction: row;
    align-items: center;
}

/* Breadcrumb container */
.breadcrumb-custom {
    max-width: 1320px;
    margin: 0 auto;
    /*margin-bottom: 1.5rem;*/
}

.breadcrumb-custom .breadcrumb {
    margin-bottom: 0;
    background-color: transparent;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.breadcrumb-item {
    color: #666;
}

/* Botão Home destacado - primeiro item */
.breadcrumb-item:first-child a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--secondary-green);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.breadcrumb-item:first-child a:hover {
    background: var(--primary-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 95, 46, 0.3);
}

.breadcrumb-item:first-child a .bi-house-door {
    font-size: 1.125rem;
    color: white;
}

/* Links normais dos outros itens */
.breadcrumb-item:not(:first-child) a {
    color: var(--secondary-green);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.breadcrumb-item:not(:first-child) a:hover {
    color: var(--primary-green);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #333;
    font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #999;
    font-size: 1.25rem;
    line-height: 1;
    margin: 0;
    padding: 0;
    padding-right: 10px;
}

.placeholder {
    background-color:unset;
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    background: var(--dark-gray);
    color: var(--white);
    padding: 60px 0 30px;
}

.footer-title {
    color: var(--light-green);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: var(--light-green);
    padding-left: 5px;
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */

@media (max-width: 768px) {
    /* Header Mobile */
    .site-header {
        position: sticky;
        top: 0;
        z-index: 1001;
    }

    .navbar-custom {
        padding: 0.5rem 0;
        position: relative;
    }

    .logo-img {
        height: 35px;
    }

    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        margin-top: 0;
        padding: 1rem;
        border-radius: 0 0 10px 10px;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
        z-index: 9999;
    }

    .navbar-nav {
        gap: 0.3rem;
    }

    .nav-link {
        padding: 0.8rem 1rem !important;
        justify-content: flex-start;
        border-radius: 8px;
        font-size: 1.5rem;
    }

    .nav-link i {
        font-size: 1.2rem;
    }

    .nav-item-cta {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(45, 95, 46, 0.1);
    }

    /* Breadcrumb Mobile */
    .breadcrumb-wrapper {
        padding: 0.6rem 0;
    }

    .breadcrumb {
        font-size: 0.8rem;
    }

    .breadcrumb-item + .breadcrumb-item::before {
        padding: 0 0.3rem;
    }

    /* Header Actions Mobile */
    .header-top-content {
        flex-wrap: wrap;
    }

    .search-input-wrapper {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin-top: 15px;
    }

    .btn-auth span {
        display: none;
    }

    .btn-cart i:last-child {
        display: none;
    }

    .header-actions {
        margin-left: unset;
        justify-content: center;
        width: 75%;
        gap: 1.3rem;
    }

    .footer {
        text-align: center;
    }

    .footer-title {
        font-size: 28px;
    }

    .footer-links {
        font-size: 25px;
    }
}

@media (max-width: 992px) {
    .navbar-toggler {
        display: block;
    }

    .navbar-collapse {
        display: none;
    }

    .navbar-collapse.show {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 10000;
        background: var(--white);
        margin-top: 48px;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
        border-radius: 10px;
        background: #4a8f4d;
    }

    .navbar-nav {
        flex-direction: column;
        gap: 0;
        padding: 20px 0;
    }

    .nav-link {
        border-bottom: none;
        border-left: 3px solid transparent;
    }

    .nav-link:hover,
    .nav-link.active {
        border-left-color: var(--secondary-green);
        background: var(--light-gray);
    }
}

/* Account Dropdown Styles */
.account-wrapper {
    position: relative;
    display: inline-block;
}

.account-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 8px;
    min-width: 200px;
    z-index: 10000 !important;
    border: 1px solid #dee2e6;
}

.account-dropdown[style*="display: block"],
.account-dropdown.show {
    display: block !important;
}

.account-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: #333;
    cursor: pointer;
    border-radius: 6px;
    text-align: left;
    transition: background 0.2s;
    width: 100%;
    font-size: 14px;
}

.account-option:hover {
    background: #f8f9fa;
}

.account-option i {
    font-size: 18px;
    color: #1a5943;
    width: 20px;
    text-align: center;
}
