﻿/* ===========================================
   Page Builder Component Styles - Pilot Theme
   ===========================================

   TABLE OF CONTENTS
   -----------------
   1. Container Wrapper
   2. Dynamic Slider
   3. Dynamic CTA
   4. Dynamic Banner
   5. Email Popup
   6. Related Products
   7. Gradient Buttons
   8. Entity Reference Components

   =========================================== */

/* ===========================================
   1. Container Wrapper
   =========================================== */
.page-component {
    margin-bottom: 0;
}

/* ===========================================
   2. Dynamic Slider
   =========================================== */
.dynamic-slider {
    position: relative;
    width: 100%;
    height: var(--slider-height, 500px);
    overflow: hidden;
}

@media (max-width: 768px) {
    .dynamic-slider {
        height: var(--slider-mobile-height, 300px);
    }
}

.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.slider-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-slide.active {
    opacity: 1;
}

.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.slide-content {
    position: relative;
    z-index: 1;
    padding: 2rem;
    max-width: 800px;
}

.slide-content.text-left { text-align: left; }
.slide-content.text-center { text-align: center; }
.slide-content.text-right { text-align: right; }

.slide-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .slide-title {
        font-size: 1.75rem;
    }
    .slide-subtitle {
        font-size: 1rem;
    }
}

.slide-subtitle {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.slider-arrow:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.slider-prev { left: 20px; }
.slider-next { right: 20px; }

@media (max-width: 768px) {
    .slider-arrow {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
    .slider-prev { left: 10px; }
    .slider-next { right: 10px; }
}

.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.slider-dot.active,
.slider-dot:hover {
    background: white;
}

/* ===========================================
   3. Dynamic CTA
   =========================================== */
.dynamic-cta {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 300px; /* Fallback if inline style fails */
    /* iOS Safari fix: overflow:hidden clips absolute children incorrectly without this */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.cta-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Video Background */
.cta-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
    /* iOS Safari: force GPU layer so video renders on top of background-color */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
}

.cta-content {
    position: relative;
    z-index: 1;
}

.cta-eyebrow,
.cta-title,
.cta-subtitle {
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
}

.cta-eyebrow {
    display: inline-block;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.cta-highlight {
    margin-bottom: 1rem;
}

.cta-highlight .highlight-number {
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
}

.cta-highlight .highlight-label {
    font-size: 2rem;
    font-weight: 700;
    margin-left: 0.5rem;
}

@media (max-width: 768px) {
    .cta-highlight .highlight-number {
        font-size: 3rem;
    }
    .cta-highlight .highlight-label {
        font-size: 1.25rem;
    }
}

.cta-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .cta-title {
        font-size: 1.75rem;
    }
}

.cta-subtitle {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
    color: inherit;
}

/* CTA Layout Variants */
.cta-layout-centered .cta-content {
    width: 100%;
}

.cta-layout-left .cta-content {
    max-width: 600px;
}

.cta-layout-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .cta-layout-split {
        grid-template-columns: 1fr;
    }
}

/* ===========================================
   4. Dynamic Banner
   =========================================== */
.dynamic-banner {
    position: relative;
    display: block;
    overflow: hidden;
    text-decoration: none;
}

.dynamic-banner .banner-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

@media (max-width: 768px) {
    .dynamic-banner .banner-image {
        min-height: 520px;
        object-fit: cover;
    }
    .banner-title {
        font-size: 1.2rem;
    }
    .banner-subtitle {
        font-size: 0.875rem;
    }
    .banner-content {
        padding: 0.75rem;
    }
}

a.dynamic-banner:hover .banner-image {
    transform: scale(1.02);
}

.banner-content {
    position: absolute;
    padding: 1rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.banner-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.banner-subtitle {
    font-size: 1.25rem;
    margin: 0;
    color: #fff;
}

/* Banner Text Position Classes */
.text-position-top-left .banner-content { top: 20px; left: 20px; }
.text-position-top-center .banner-content { top: 20px; left: 50%; transform: translateX(-50%); }
.text-position-top-right .banner-content { top: 20px; right: 20px; }
.text-position-center-left .banner-content { top: 50%; left: 20px; transform: translateY(-50%); }
.text-position-center .banner-content { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.text-position-center-right .banner-content { top: 50%; right: 20px; transform: translateY(-50%); }
.text-position-bottom-left .banner-content { bottom: 20px; left: 20px; }
.text-position-bottom-center .banner-content { bottom: 20px; left: 50%; transform: translateX(-50%); }
.text-position-bottom-right .banner-content { bottom: 20px; right: 20px; }

/* ===========================================
   5. Email Popup
   =========================================== */
.email-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.email-popup-modal {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.email-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.5;
    z-index: 1;
}

.email-popup-close:hover {
    opacity: 1;
}

.email-popup-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.email-popup-content {
    padding: 2rem;
}

.email-popup-content h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.coupon-preview {
    background: #f3f4f6;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    text-align: center;
}

.coupon-code {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: monospace;
    letter-spacing: 2px;
}

.coupon-code-large {
    font-size: 2rem;
    font-weight: 700;
    font-family: monospace;
    letter-spacing: 3px;
    padding: 1rem;
    background: #f3f4f6;
    border-radius: 8px;
}

/* ===========================================
   6. Related Products
   =========================================== */
.dynamic-related-products {
    padding: 3rem 0;
}

.dynamic-related-products .section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.dynamic-related-products .section-header h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.product-carousel {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.product-carousel > * {
    flex: 0 0 auto;
    width: 280px;
    scroll-snap-align: start;
}

/* Hide scrollbar but keep functionality */
.product-carousel::-webkit-scrollbar {
    height: 6px;
}

.product-carousel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.product-carousel::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.product-carousel::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* ===========================================
   7. Gradient Buttons
   =========================================== */
.btn-gradient-purple {
    background: linear-gradient(to right, #8b5cf6, #6366f1);
    color: white;
    border: none;
}

.btn-gradient-purple:hover {
    background: linear-gradient(to right, #7c3aed, #4f46e5);
    color: white;
}

.btn-gradient-gold {
    background: linear-gradient(to right, #f59e0b, #eab308);
    color: white;
    border: none;
}

.btn-gradient-gold:hover {
    background: linear-gradient(to right, #d97706, #ca8a04);
    color: white;
}

.btn-gradient-red {
    background: linear-gradient(to right, #ef4444, #dc2626);
    color: white;
    border: none;
}

.btn-gradient-red:hover {
    background: linear-gradient(to right, #dc2626, #b91c1c);
    color: white;
}

.btn-gradient-green {
    background: linear-gradient(to right, #22c55e, #16a34a);
    color: white;
    border: none;
}

.btn-gradient-green:hover {
    background: linear-gradient(to right, #16a34a, #15803d);
    color: white;
}

/* ===========================================
   8. Entity Reference Components
   =========================================== */
.entity-content {
    padding: 1rem 0;
}

.entity-slider,
.entity-banner,
.entity-section {
    margin-bottom: 1rem;
}
