/*
Theme Name: Criador Engenharia
Theme URI: https://criadorengenharia.com.br
Author: Daniel de Sá
Author URI: https://danieldesa.com
Description: Tema personalizado para a Criador Engenharia - Construção Civil, Reformas e Projetos em Manaus/AM. Refatorado com Tailwind CSS.
Version: 4.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: criador-engenharia
Tags: one-page, custom-logo, featured-images, full-width-template, dark-mode, tailwind
*/

/* ==========================================================================
   Tailwind @layer overrides & custom utilities
   ========================================================================== */

/* Smooth scroll */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    /* Prevent horizontal overflow caused by slide-left / slide-right animations on mobile (esp. iOS Safari) */
    overflow-x: hidden;
}

/* Prevent text size adjust on iOS */
body {
    -webkit-text-size-adjust: 100%;
}

/* ==========================================================================
   Hero Slider — States & Transitions
   ========================================================================== */
.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease, visibility 1s ease;
    z-index: 0;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
    animation: heroZoom 8s ease forwards;
}

/* Slide-in animations for active content */
.hero-slide.active .hero-badge-anim {
    animation: slideDown 0.7s ease 0.15s both;
}

.hero-slide.active h1 {
    animation: slideUp 0.7s ease 0.3s both;
}

.hero-slide.active p {
    animation: slideUp 0.7s ease 0.5s both;
}

.hero-slide.active .hero-buttons {
    animation: slideUp 0.7s ease 0.7s both;
}

/* Hero overlay gradient */
.hero-overlay {
    background: linear-gradient(160deg, rgba(13, 17, 23, 0.93) 0%, rgba(27, 38, 49, 0.75) 50%, rgba(232, 163, 23, 0.12) 100%);
}

/* Hero progress bar gradient */
.hero-progress-bar {
    background: linear-gradient(90deg, #E8A317, #E67E22);
}

/* ==========================================================================
   Header scrolled state (toggled by JS)
   ========================================================================== */
.site-header.scrolled {
    background: rgba(13, 17, 23, 0.92);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    border-bottom-color: rgba(232, 163, 23, 0.3);
}

/* ==========================================================================
   Nav active link — handled in mobile menu section below
   ========================================================================== */

/* ==========================================================================
   Gradient text utility
   ========================================================================== */
.gradient-text {
    background: linear-gradient(135deg, #E8A317, #F5C34B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Gradient backgrounds */
.gradient-gold {
    background: linear-gradient(135deg, #E8A317, #E67E22);
}

.gradient-gold-hover:hover {
    background: linear-gradient(135deg, #C78C0A, #E8A317);
}

/* Section title bar */
.section-bar::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #E8A317, #E67E22);
    margin: 15px auto 0;
    border-radius: 2px;
}

/* About text bar */
.about-bar::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #E8A317, #E67E22);
    margin-top: 15px;
    border-radius: 2px;
}

/* Service icon gradient */
.service-icon-gradient {
    background: linear-gradient(135deg, #E8A317, #E67E22);
}

/* Service Card v2 — modern flat style */
.service-card-v2 {
    border: 1px solid rgba(229, 231, 235, 0.5);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    isolation: isolate;
}

.service-card-v2:hover {
    border-color: rgba(232, 163, 23, 0.3);
    box-shadow: 0 8px 32px rgba(232, 163, 23, 0.1), 0 2px 8px rgba(0,0,0,0.06);
}

[data-theme="dark"] .service-card-v2 {
    border-color: rgba(48, 54, 61, 0.6);
}

[data-theme="dark"] .service-card-v2:hover {
    border-color: rgba(232, 163, 23, 0.35);
    box-shadow: 0 8px 32px rgba(232, 163, 23, 0.08), 0 2px 8px rgba(0,0,0,0.2);
}

/* Mobile active/tap feedback */
@media (max-width: 767px) {
    .service-card-v2:active {
        transform: scale(0.98);
        box-shadow: 0 4px 16px rgba(232, 163, 23, 0.15);
    }
    .service-card-v2 {
        -webkit-tap-highlight-color: transparent;
    }
}

/* Value card left border */
.value-card-border {
    border-left: 4px solid #E8A317;
}

.value-card-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(232, 163, 23, 0.03), transparent);
    pointer-events: none;
}

.value-card-border:hover {
    border-left-color: #E67E22;
}

/* Portfolio overlay gradients */
.portfolio-overlay {
    background: linear-gradient(to top, rgba(13, 17, 23, 0.9) 0%, transparent 60%);
}

.portfolio-card-wrap:hover .portfolio-overlay {
    background: linear-gradient(to top, rgba(13, 17, 23, 0.95) 0%, rgba(232, 163, 23, 0.15) 100%);
}

/* Portfolio tag gradient */
.portfolio-tag {
    background: linear-gradient(135deg, #E8A317, #E67E22);
}

/* CTA section glow */
.cta-glow::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(232, 163, 23, 0.08) 0%, transparent 50%);
    animation: floatGlow 8s ease-in-out infinite;
}

.cta-glow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #E8A317, #E67E22, #E8A317);
}

/* Button ripple effect */
.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-ripple:hover::after {
    width: 300px;
    height: 300px;
}

/* Footer column heading underline */
.footer-heading::after {
    content: '';
    display: block;
    width: 30px;
    height: 2px;
    background: #E8A317;
    margin-top: 8px;
}

/* About image decorative corner */
.about-corner::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 100px;
    height: 100px;
    border: 3px solid #E8A317;
    border-radius: 16px;
    z-index: -1;
}

/* Form focus ring with gold */
.form-gold:focus {
    outline: none;
    border-color: #E8A317;
    box-shadow: 0 0 0 4px rgba(232, 163, 23, 0.1);
}

/* ==========================================================================
   Keyframe Animations
   ========================================================================== */
@keyframes heroZoom {
    from { transform: scale(1); }
    to   { transform: scale(1.08); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-12px); }
    60% { transform: translateX(-50%) translateY(-6px); }
}

@keyframes floatGlow {
    0%, 100% { transform: translate(0, 0); }
    25%      { transform: translate(2%, 3%); }
    50%      { transform: translate(-1%, 5%); }
    75%      { transform: translate(3%, -2%); }
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.3); }
    50% { box-shadow: 0 0 0 12px rgba(37, 211, 102, 0); }
}

/* ==========================================================================
   Scroll-triggered Animation Classes (toggled by JS)
   ========================================================================== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.slide-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-right {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.slide-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger delays */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* ==========================================================================
   WhatsApp Float Pulse
   ========================================================================== */
.whatsapp-pulse {
    animation: pulse 2s infinite;
}

/* Scroll indicator bounce */
.scroll-bounce {
    animation: bounce 2s infinite;
}

/* ==========================================================================
   Mobile Menu Transition (mobile-first: base = mobile, md: = desktop)
   ========================================================================== */
.main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(300px, 85vw);
    height: 100vh;
    height: 100dvh;
    background: rgba(13, 17, 23, 0.98);
    backdrop-filter: blur(20px);
    padding: 80px 30px 30px;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
    z-index: 999;
    border-left: 2px solid rgba(232, 163, 23, 0.2);
    overflow-y: auto;
}

.main-nav.active {
    right: 0;
}

.main-nav a.active {
    background: transparent !important;
    color: #E8A317 !important;
    padding-left: 10px;
    box-shadow: none !important;
    -webkit-text-fill-color: #E8A317 !important;
}

/* Desktop: reset mobile menu to inline nav */
@media (min-width: 768px) {
    .main-nav {
        position: static;
        width: auto;
        height: auto;
        background: transparent;
        backdrop-filter: none;
        padding: 0;
        box-shadow: none;
        border-left: none;
        overflow-y: visible;
        right: auto;
    }

    .main-nav a.active {
        color: #0D1117 !important;
        background: transparent !important;
        box-shadow: none !important;
        font-weight: 700;
        padding-left: 18px;
        border-radius: 9999px;
        -webkit-text-fill-color: #0D1117 !important;
        position: relative;
        z-index: 1;
    }

    /* Sliding indicator */
    .main-nav ul {
        position: relative;
    }

    .nav-slider {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        background: linear-gradient(135deg, #E8A317, #F5C34B);
        border-radius: 9999px;
        box-shadow: 0 2px 12px rgba(232, 163, 23, 0.4);
        transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 0;
        pointer-events: none;
        opacity: 0;
    }

    .nav-slider.visible {
        opacity: 1;
    }
}

/* ==========================================================================
   Dark mode overrides for elements that need special treatment
   ========================================================================== */
[data-theme="dark"] .form-gold:focus {
    background: #1C2128;
}

/* Service card v2 icon hover (legacy class kept for compatibility) */
.service-card:hover .service-icon-glow {
    background: linear-gradient(135deg, #E8A317, #E67E22);
    transform: rotate(5deg) scale(1.05);
    box-shadow: 0 4px 15px rgba(232, 163, 23, 0.3);
}

/* Portfolio card hover effects */
.portfolio-card-wrap:hover .portfolio-title {
    transform: translateY(0);
}

.portfolio-card-wrap:hover .portfolio-desc {
    opacity: 1;
    transform: translateY(0);
}

.portfolio-title {
    transform: translateY(10px);
    transition: transform 0.3s ease;
}

.portfolio-desc {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ==========================================================================
   Modal (Serviços)
   ========================================================================== */
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-wrap.active {
    pointer-events: auto;
}

.modal-wrap.active .modal-box {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.modal-body p {
    margin-bottom: 0.75em;
}

.modal-body ul, .modal-body ol {
    padding-left: 1.25em;
    margin-bottom: 0.75em;
}

.modal-body li {
    margin-bottom: 0.35em;
}

.modal-body h2, .modal-body h3, .modal-body h4 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    margin: 1em 0 0.5em;
}

.modal-body img {
    max-width: 100%;
    border-radius: 8px;
    margin: 0.5em 0;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
    max-width: 420px;
    width: calc(100% - 2.5rem);
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 14px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateX(calc(100% + 2rem));
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
    position: relative;
    overflow: hidden;
}

.toast.toast-visible {
    transform: translateX(0);
    opacity: 1;
}

.toast.toast-exit {
    transform: translateX(calc(100% + 2rem));
    opacity: 0;
}

.toast-success {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.toast-error {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

[data-theme="dark"] .toast-success {
    background: rgba(28, 33, 40, 0.92);
    border-color: rgba(34, 197, 94, 0.3);
}

[data-theme="dark"] .toast-error {
    background: rgba(28, 33, 40, 0.92);
    border-color: rgba(239, 68, 68, 0.3);
}

.toast-icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.toast-success .toast-icon {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
}

.toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: #1f2937;
    margin-bottom: 0.15rem;
    line-height: 1.3;
}

[data-theme="dark"] .toast-title {
    color: #E6EDF3;
}

.toast-message {
    font-size: 0.82rem;
    color: #6b7280;
    line-height: 1.4;
}

[data-theme="dark"] .toast-message {
    color: #8b949e;
}

.toast-close {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s, color 0.2s;
    margin-top: 0.1rem;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #4b5563;
}

[data-theme="dark"] .toast-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #d1d5db;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 14px 14px;
    animation: toastProgress linear forwards;
}

.toast-success .toast-progress {
    background: linear-gradient(90deg, #22c55e, #86efac);
}

.toast-error .toast-progress {
    background: linear-gradient(90deg, #ef4444, #fca5a5);
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* Mobile: toast full-width centered at top */
@media (max-width: 639px) {
    .toast-container {
        top: 0.75rem;
        right: 0.75rem;
        left: 0.75rem;
        max-width: none;
        width: auto;
    }

    .toast {
        transform: translateY(-120%);
        border-radius: 12px;
        padding: 0.875rem 1rem;
    }

    .toast.toast-visible {
        transform: translateY(0);
    }

    .toast.toast-exit {
        transform: translateY(-120%);
    }
}

/* ==========================================================================
   WordPress Admin Bar Compatibility
   ========================================================================== */
.admin-bar .site-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .site-header {
        top: 46px;
    }
}
