/* ==========================================================================
   Fonte Da Vida - Products Page Styles
   Description: Specific styles for the Products page including the 
   product item grid, thumbnail overlays, and structural overrides.
   ========================================================================== */

/* --------------------------------------------------------------------------
   01. Structural Layout Overrides & Page Header
   -------------------------------------------------------------------------- */
.page-header.animated-header {
    position: relative;
    overflow: hidden;
    padding: 200px 24px 140px;
    z-index: 0;
    text-align: center;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 60px;
}

.page-header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.ph-bg-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: -99;
    transform: scale(1.0);
    animation: slowPan 25s linear infinite alternate;
}

@keyframes slowPan {
    from {
        transform: scale(1.05) translate(0, 0);
    }

    to {
        transform: scale(1.15) translate(-1%, 1%);
    }
}

.ph-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.8) 100%);
    z-index: -98;
}

.ph-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ph-breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 24px;
    font-family: 'JetBrains Mono', monospace;
}

.ph-breadcrumb a {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s;
}

.ph-breadcrumb a:hover {
    color: #fff;
}

.ph-label {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 100px;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.ph-title {
    font-size: clamp(38px, 5vw, 56px);
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -0.03em;
}

.ph-desc {
    font-size: clamp(16px, 2vw, 20px);
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    max-width: 650px;
    margin: 0 auto;
}

.gradient-text {
    background: linear-gradient(135deg, #60A5FA 0%, #3B82F6 60%, #1E40AF 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Force white text and white logo when navbar is transparent at top, in BOTH modes */
.navbar:not(.scrolled) .logo-light {
    display: none !important;
}

.navbar:not(.scrolled) .logo-dark {
    display: block !important;
}

.navbar:not(.scrolled) .nav-links a,
.navbar:not(.scrolled) .btn-ghost,
.navbar:not(.scrolled) .theme-toggle,
.navbar:not(.scrolled) .lang-btn,
.navbar:not(.scrolled) .lang-btn .lang-text {
    color: #ffffff !important;
    transition: transform 0.2s ease, border-color 0.2s ease !important;
}

.navbar:not(.scrolled) .nav-links a {
    display: inline-block;
}

.navbar:not(.scrolled) .lang-btn {
    background: transparent !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
}

.navbar:not(.scrolled) .theme-toggle {
    background: transparent !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
}

.navbar:not(.scrolled) .btn-ghost {
    background: transparent !important;
}

.navbar:not(.scrolled) .nav-toggle span {
    background: #ffffff !important;
}

.navbar:not(.scrolled) .nav-links a:hover,
.navbar:not(.scrolled) .btn-ghost:hover,
.navbar:not(.scrolled) .theme-toggle:hover,
.navbar:not(.scrolled) .lang-btn:hover {
    transform: translateY(-2px) !important;
    color: #ffffff !important;
    background: transparent !important;
}

/* Ensures footer stays at the bottom with no gap if page content is short */
html,
body {
    height: 100%;
    min-height: 100vh;
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.footer {
    margin-top: auto;
}

/* Clear gradient backgrounds behind interactive tools for this specific view */
.pricing-section,
.faq-section {
    background: transparent !important;
}

.contact-section {
    background: transparent !important;
    padding: 120px 0;
    border-top: 1px solid var(--border-subtle);
}

.templates-section:has(.contact-section) {
    padding: 0;
}

/* Removed old breadcrumb styles as they are part of animated-header */

/* --------------------------------------------------------------------------
   02. Product Items Grid
   -------------------------------------------------------------------------- */
.templates-section {
    padding: 120px 0;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.product-card {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-border);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.light-mode .product-card:hover {
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}

/* --------------------------------------------------------------------------
   03. Product Thumbnails & Overlays
   -------------------------------------------------------------------------- */
.product-image-wrap {
    position: relative;
    aspect-ratio: 16 / 11;
    overflow: hidden;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}



.product-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 4px 12px;
    border-radius: 100px;
    z-index: 5;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.product-badge.badge-eco {
    background: #10B981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.product-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px 20px 20px;
    background: linear-gradient(to top, rgba(10, 10, 16, 0.95) 0%, rgba(10, 10, 16, 0.7) 60%, transparent 100%);
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: flex-end;
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 10;
}

.light-mode .product-overlay {
    background: linear-gradient(to top, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.8) 60%, transparent 100%);
}

.product-card:hover .product-overlay {
    transform: translateY(0);
    opacity: 1;
}

.product-overlay .btn {
    flex: 1;
    font-size: 13px;
    padding: 10px 0;
    text-align: center;
}

/* --------------------------------------------------------------------------
   04. Product Item Metadata
   -------------------------------------------------------------------------- */
.product-info {
    padding: 24px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--surface-1);
    position: relative;
    z-index: 2;
}

.product-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 12px;
    transition: color 0.3s ease;
}

.product-card:hover .product-title {
    color: var(--accent);
}

.product-price {
    font-size: 16px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    font-weight: 600;
}

.product-price span {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.browse-more {
    text-align: center;
    margin-top: 56px;
}

/* --------------------------------------------------------------------------
   05. Responsive Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .templates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .page-header.animated-header {
        padding: 130px 24px 80px;
        min-height: 50vh;
    }

    .templates-grid {
        grid-template-columns: 1fr;
        max-width: 480px;
        margin: 0 auto;
    }
}

@media (max-width: 389px) {
    .page-header.animated-header {
        padding: 110px 24px 50px;
        min-height: 50vh;
    }

    .template-info {
        padding: 16px;
    }

    .template-name {
        font-size: 15px;
    }

    .template-desc {
        font-size: 12px;
    }
}

/* --------------------------------------------------------------------------
   06. Product Details Modal
   -------------------------------------------------------------------------- */
.product-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 16, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.light-mode .product-modal-overlay {
    background: rgba(255, 255, 255, 0.5);
}

.product-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.product-modal {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    transform: scale(0.95) translateY(10px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
}

.light-mode .product-modal {
    box-shadow: 0 40px 80px rgba(15, 23, 42, 0.15);
}

.product-modal-overlay.active .product-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    backdrop-filter: blur(5px);
}

.modal-close:hover {
    background: var(--rose);
    color: white;
    border-color: var(--rose);
    transform: rotate(90deg);
}

.modal-content {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 0;
    flex: 1;
    overflow-y: auto;
}

.modal-image-container {
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border-right: 1px solid var(--border-subtle);
    position: relative;
    overflow: hidden;
}

.modal-image-bg {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle at center, var(--accent-soft) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0.5;
}

.modal-image-container img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.2));
}

.light-mode .modal-image-container img {
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.05));
}

.modal-details {
    padding: 40px;
    display: flex;
    flex-direction: column;
}

.modal-details h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.modal-price {
    font-size: 18px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 24px;
}

.modal-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.modal-meta span {
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    padding: 6px 14px;
    border-radius: 100px;
    color: var(--text-secondary);
}

.modal-description {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 32px;
}

.modal-specs ul {
    list-style: none;
    padding: 0;
    margin: 0 0 40px 0;
}

.modal-specs li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.modal-specs li::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233B82F6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    margin-top: 1px;
}

.modal-actions {
    margin-top: auto;
}

/* Mobile Tap to show overlay logic */
.product-card.mobile-tap-active .product-overlay {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .product-modal {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    .modal-content {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
        min-height: 100%;
    }

    .modal-image-container {
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
        padding: 40px 20px 20px;
        min-height: 250px;
    }

    .modal-details {
        padding: 24px 20px 40px;
        flex: 1;
    }
}

/* --- Premium CTA Upgrade --- */
.cta-carousel-section {
    position: relative;
    overflow: hidden;
    padding: 140px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
}

.cta-bg-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.cta-bg-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: opacity 1.5s ease-in-out, transform 10s ease-out;
}

.cta-overlay-premium {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.85) 100%);
    z-index: 10;
}

.cta-container {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
}

.cta-glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 32px;
    padding: 80px 60px;
    max-width: 850px;
    text-align: center;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.cta-glass-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 50px 120px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.cta-badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60A5FA;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 100px;
    margin-bottom: 24px;
}

.cta-premium-title {
    color: #fff;
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
}

.gradient-text-premium {
    background: linear-gradient(135deg, #60A5FA 0%, #fff 50%, #3B82F6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cta-premium-desc {
    color: rgba(255, 255, 255, 0.85);
    font-size: clamp(16px, 2vw, 20px);
    line-height: 1.6;
    margin: 0 auto 48px;
    max-width: 600px;
}

.cta-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn-glow {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: #fff;
    border: none;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    padding: 16px 36px;
    font-size: 16px;
    border-radius: 100px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-glow:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 15px 40px rgba(37, 99, 235, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-arrow-right {
    transition: transform 0.3s ease;
}

.btn-glow:hover .btn-arrow-right {
    transform: translateX(4px);
}

.btn-glass-outline {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 16px 36px;
    font-size: 16px;
    border-radius: 100px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-glass-outline:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .cta-glass-card {
        padding: 50px 30px;
        border-radius: 20px;
    }

    .cta-actions {
        flex-direction: column;
        width: 100%;
    }

    .cta-actions a {
        width: 100%;
        justify-content: center;
    }
}