/* ==========================================
   BH Commerce - CSS Principal
   ========================================== */

:root {
    --primary: #1a56db;
    --secondary: #059669;
    --primary-dark: #1e40af;
    --gradient: linear-gradient(135deg, #1a56db 0%, #059669 100%);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

/* ==================== TOP BAR ==================== */
.top-bar {
    position: relative;
    z-index: 60;
    background: #0a0f1e;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.top-bar-btn {
    color: rgba(255,255,255,0.7);
    padding: 0.5rem 0.625rem;
    font-size: 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
    cursor: pointer;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
}

.top-bar-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.top-menu-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    width: 240px;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    z-index: 60;
    animation: topMenuFadeIn 0.15s ease-out;
}

@keyframes topMenuFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.top-menu-link {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.15s;
}

.top-menu-link:hover {
    background: rgba(26,86,219,0.06);
    color: var(--primary);
}

/* ==================== HEADER ==================== */
.header-gradient {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}

.nav-link {
    color: rgba(255,255,255,0.8);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s;
    text-decoration: none;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.1); }

.mobile-nav-link {
    display: block;
    color: rgba(255,255,255,0.8);
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s;
    text-decoration: none;
}
.mobile-nav-link:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* Dropdown */
.group:hover .dropdown-menu { opacity: 1; visibility: visible; }
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.25rem;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    border: 1px solid #f1f5f9;
    padding: 0.5rem 0;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 50;
}
.dropdown-item {
    display: block;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.15s;
}
.dropdown-item:hover { background: rgba(26,86,219,0.05); color: var(--primary); }

/* ==================== FOOTER ==================== */
.footer-gradient {
    background: #1A2437;
}

/* ==================== BOTÕES ==================== */
.btn-gradient {
    background: var(--gradient);
    display: inline-block;
    color: #fff;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}
.btn-gradient:hover {
    background: linear-gradient(135deg, #1e40af 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px -5px rgba(26, 86, 219, 0.3);
    color: #fff;
}

/* ==================== FORMULÁRIOS ==================== */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    background: #fff;
    transition: all 0.2s;
    outline: none;
}
.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}

.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

/* ==================== MODAL AUTH ==================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-box {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 28rem;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
    position: relative;
}
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: #9ca3af;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    transition: color 0.2s;
}
.modal-close:hover { color: #4b5563; }

.modal-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: #f3f4f6;
    padding: 0.25rem;
    border-radius: 0.75rem;
}
.modal-tab-button {
    flex: 1;
    padding: 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    border: none;
    background: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}
.modal-tab-button.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ==================== MODAL AVALIAÇÕES ==================== */
.modal-avaliacoes {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-content-avaliacoes {
    background: #fff; border-radius: 1rem; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    width: 100%; max-width: 42rem; max-height: 90vh; overflow-y: auto; padding: 1.5rem; position: relative;
}
.close-avaliacoes {
    position: absolute; top: 1rem; right: 1rem; color: #9ca3af; font-size: 1.5rem;
    cursor: pointer; z-index: 10; transition: color 0.2s;
}
.close-avaliacoes:hover { color: #4b5563; }

.modal-tabs-avaliacoes { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.modal-tab-button-avaliacoes {
    flex: 1; padding: 0.5rem; border-radius: 0.75rem; font-size: 0.875rem;
    font-weight: 500; border: none; cursor: pointer; transition: all 0.2s;
    background: #f3f4f6; color: #4b5563;
}
.modal-tab-button-avaliacoes.active { background: var(--primary); color: #fff; }

/* ==================== MODAL SEE ==================== */
.modal-see {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-see-content {
    background: #fff; border-radius: 1rem; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    width: 100%; max-width: 32rem; max-height: 80vh; overflow-y: auto; padding: 1.5rem; position: relative;
}
.modal-see-close {
    position: absolute; top: 1rem; right: 1rem; color: #9ca3af; font-size: 1.5rem;
    cursor: pointer; z-index: 10;
}

/* ==================== MODAL COMENTÁRIOS ==================== */
.modal-comentarios {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-comentarios-content {
    background: #fff; border-radius: 1rem; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    width: 100%; max-width: 42rem; max-height: 90vh; overflow-y: auto; position: relative;
}
.modal-comentarios-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.5rem; border-bottom: 1px solid #e5e7eb; position: sticky; top: 0;
    background: #fff; z-index: 10;
}
.modal-comentarios-body { padding: 1.5rem; }
.close-comentarios {
    color: #9ca3af; font-size: 1.5rem; cursor: pointer; transition: color 0.2s;
}
.close-comentarios:hover { color: #4b5563; }

/* ==================== BACK TO TOP ==================== */
.back-to-top {
    position: fixed;
    bottom: 1.5rem;
    left: 1rem;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    background: var(--gradient);
    color: #fff;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(26,86,219,0.3);
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(26,86,219,0.4); }

/* ==================== WHATSAPP ==================== */
.whatsapp-float { position: fixed; bottom: 1rem; right: 1rem; z-index: 50; }
.whatsapp-float a {
    display: block; background: #25d366; color: #fff; padding: 0.75rem;
    border-radius: 50%; box-shadow: 0 4px 15px rgba(37,211,102,0.4);
    transition: all 0.3s; text-decoration: none; font-size: 1.5rem;
    text-align: center; line-height: 1;
}
.whatsapp-float a:hover { background: #128c7e; transform: scale(1.1); }

/* ==================== BANNER CAROUSEL ==================== */
.banner-slide { transition: opacity 0.7s ease-in-out; }
.banner-slide:not(.opacity-100) { pointer-events: none; }

/* ==================== ESTRELAS ==================== */
.estrelas-avaliacao .estrela-btn.active,
.estrelas-avaliacao .estrela-btn.active ~ .estrela-btn { color: #facc15; }

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ==================== RESPONSIVO ==================== */
@media (max-width: 640px) {
    .whatsapp-float a { padding: 0.625rem; font-size: 1.25rem; }
    .back-to-top { width: 40px; height: 40px; left: 1rem; }
}

/* ==================== PRINT ==================== */
@media print {
    .header-gradient, .footer-gradient, .back-to-top, .whatsapp-float { display: none !important; }
}

/* ==================== HIDDEN UTILITY ==================== */
.hidden { display: none !important; }

/* ==================== BANNER POPUP ==================== */
.popup-banner-wrapper {
    position: fixed;
    z-index: 200;
    pointer-events: none;
    top: 50%;
    right: 0;
    transition: top 1.5s cubic-bezier(0.22, 1, 0.36, 1), left 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.popup-banner-box {
    position: relative;
    width: 350px;
    height: 350px;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.1);
    pointer-events: all;
    cursor: pointer;
    transition: box-shadow 0.3s;
}

.popup-banner-box:hover {
    box-shadow: 0 15px 50px rgba(0,0,0,0.5), 0 0 0 2px rgba(26,86,219,0.5);
}

.popup-banner-box img {
    width: 350px;
    height: 350px;
    object-fit: cover;
    display: block;
}

.popup-banner-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 10;
    transition: all 0.2s;
}

.popup-banner-close:hover {
    background: rgba(220,38,38,0.9);
    transform: scale(1.15);
}

.popup-banner-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    padding: 24px 14px 14px;
    color: #fff;
}

.popup-banner-info h3 {
    font-weight: 700;
    font-size: 0.9rem;
    margin: 0;
}

.popup-banner-info p {
    font-size: 0.75rem;
    opacity: 0.85;
    margin: 2px 0 0;
}

/* Slide-in from right */
@keyframes popupSlideIn {
    0% {
        transform: translateX(calc(100vw + 400px)) rotate(12deg);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    75% {
        transform: translateX(8px) rotate(-2deg);
    }
    100% {
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }
}

/* Slide-out to right */
@keyframes popupSlideOut {
    0% {
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateX(calc(100vw + 400px)) rotate(12deg);
        opacity: 0;
    }
}

.popup-banner-wrapper.animate-in {
    animation: popupSlideIn 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.popup-banner-wrapper.animate-out {
    animation: popupSlideOut 0.8s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

/* Timer bar */
.popup-timer-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #1a56db, #059669);
    border-radius: 0 0 1rem 1rem;
    transition: width linear;
    z-index: 11;
}

/* Reopen button */
.popup-reopen-btn {
    position: fixed;
    bottom: 100px;
    right: 20px;
    z-index: 190;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #1a56db, #059669);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(26,86,219,0.4);
    transition: all 0.3s;
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
}

.popup-reopen-btn.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: all;
}

.popup-reopen-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(26,86,219,0.6);
}

.popup-reopen-btn::after {
    content: attr(data-title);
    position: absolute;
    right: 56px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.popup-reopen-btn:hover::after {
    opacity: 1;
}

@media (max-width: 400px) {
    .popup-banner-box { width: 260px; height: 260px; }
    .popup-banner-box img { width: 260px; height: 260px; }
}

@media print {
    .popup-banner-wrapper, .popup-reopen-btn { display: none !important; }
}

/* ==================== PASSWORD STRENGTH ==================== */
.password-strength {
    user-select: none;
}

.ps-bar {
    height: 4px;
    flex: 1;
    border-radius: 4px;
    background: #e5e7eb;
    transition: background 0.3s;
}

.ps-bar.active {
    background: #dc2626;
}

.ps-bar.active:nth-child(2) {
    background: #f97316;
}

.ps-bar.active:nth-child(3) {
    background: #eab308;
}

.ps-bar.active:nth-child(4) {
    background: #22c55e;
}

.ps-requirements {
    list-style: none;
    padding: 0;
    margin: 4px 0 0;
    font-size: 10px;
    color: #9ca3af;
}

.ps-requirements li {
    padding: 1px 0;
    transition: color 0.3s;
}

.ps-requirements li::before {
    content: '○ ';
}

.ps-requirements li.met {
    color: #22c55e;
}

.ps-requirements li.met::before {
    content: '● ';
}
