/* =====================================================
   Page-specific Styles — Capsule Homes Investment
   ===================================================== */

/* === Market Facts Section === */
/* === Market Facts Section === */
.market-facts {
    background-color: #F5F7FA;
    padding: var(--space-4xl) 0;
    overflow: hidden;
}

/* Layout Wrapper - New 2-column grid */
.market-facts__layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Left (Text) | Right (Grid) */
    gap: var(--space-3xl);
    align-items: center;
    padding-bottom: var(--space-xl);
}

/* Left Column: Content */
.market-facts__content {
    text-align: left;
    max-width: 600px;
}

.market-facts__title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 3vw, 3rem);
    /* Reduced by ~25% */
    font-weight: 800;
    margin-bottom: var(--space-lg);
    color: var(--color-text);
    line-height: 1.15;
    text-wrap: balance;
}

.market-facts__subtitle {
    font-size: var(--text-xl);
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: var(--space-2xl);
    max-width: 90%;
}

/* Right Column: 2x2 Grid */
.facts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

/* Horizontal Card Layout */
.fact-card {
    background: #FFFFFF;
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    /* Reduced padding */
    box-shadow: var(--shadow-card);
    transition: var(--transition-base);
    text-align: left;
    height: 100%;
    display: flex;
    flex-direction: row;
    /* Horizontal Layout */
    align-items: flex-start;
    /* Top align */
    gap: var(--space-md);
}

.fact-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

/* Highlighted Card */
.fact-card--highlight {
    border: 2px solid var(--color-accent);
    background: linear-gradient(135deg, #fff 0%, #fff9e6 100%);
    position: relative;
    overflow: hidden;
}

.fact-card--highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--color-accent);
}

.fact-card__icon {
    flex-shrink: 0;
    margin-bottom: 0;
    /* No bottom margin in row layout */
    color: var(--color-primary);
    padding-top: 4px;
    /* Slight visual alignment with number */
}

/* Wrapper for text content */
.fact-card__details {
    display: flex;
    flex-direction: column;
}

.fact-card__value {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    /* ~40px - Slightly smaller for horizontal */
    font-weight: 800;
    line-height: 1;
    color: var(--color-primary);
    margin-bottom: var(--space-xs);
    letter-spacing: -1px;
}

.fact-card--highlight .fact-card__value {
    color: var(--color-accent);
}

.fact-card__label {
    font-weight: 700;
    font-size: var(--text-sm);
    margin-bottom: var(--space-xs);
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fact-card__desc {
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    /* 13px */
    line-height: 1.4;
}

/* Footer (Trust Badge) */
.market-facts__footer {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 1024px) {
    .market-facts__layout {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--space-2xl);
    }

    .market-facts__content {
        max-width: 800px;
        margin: 0 auto;
        text-align: center;
    }

    .market-facts__title,
    .market-facts__subtitle {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }

    .market-facts__footer {
        justify-content: center;
    }

    /* Keep horizontal cards even on tablet */
    .fact-card {
        padding: var(--space-xl);
    }
}

@media (max-width: 768px) {
    .market-facts {
        padding: var(--space-2xl) 0;
    }

    .facts-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .fact-card__value {
        font-size: 2.5rem;
    }
}

/* === Home Page === */

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
}

@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* Card enhancements for features */
.card__icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-accent) 0%, #D4B87A 100%);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
}

.card__icon svg {
    width: 28px;
    height: 28px;
    color: var(--color-primary);
}

.card__title {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.card__text {
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* Dark Section */
.section--dark {
    background: var(--color-bg-dark);
    color: var(--color-text-light);
}

/* CTA Block */
.cta-block {
    text-align: center;
    padding: var(--space-3xl) 0;
}

.cta-block__title {
    font-family: var(--font-heading);
    font-size: var(--text-4xl);
    font-weight: 800;
    margin-bottom: var(--space-md);
}

.cta-block__text {
    font-size: var(--text-lg);
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: var(--space-xl);
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: var(--space-3xl);
    padding: var(--space-2xl) 0;
    background: var(--color-bg-alt);
}

.stats-bar__item {
    text-align: center;
}

.stats-bar__value {
    font-family: var(--font-heading);
    font-size: var(--text-4xl);
    font-weight: 800;
    color: var(--color-primary);
}

.stats-bar__label {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
}

@media (max-width: 768px) {
    .stats-bar {
        flex-direction: column;
        gap: var(--space-lg);
    }
}

/* === How It Works Section === */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-xl);
    counter-reset: step;
}

.step {
    position: relative;
    text-align: center;
}

.step::before {
    counter-increment: step;
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--color-accent);
    color: var(--color-primary);
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 700;
    border-radius: var(--radius-full);
    margin: 0 auto var(--space-md);
}

.step__title {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.step__text {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

@media (max-width: 1024px) {
    .steps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .steps-grid {
        grid-template-columns: 1fr;
    }
}

/* === Gallery/Projects Section === */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.project-card {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    aspect-ratio: 4/3;
}

.project-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.project-card:hover .project-card__image {
    transform: scale(1.05);
}

.project-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 50%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-lg);
    color: var(--color-text-light);
}

.project-card__title {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 700;
}

.project-card__location {
    font-size: var(--text-sm);
    opacity: 0.7;
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* === Testimonials Section === */
.testimonial {
    background: var(--color-bg);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-card);
}

.testimonial__quote {
    font-size: var(--text-lg);
    font-style: italic;
    line-height: 1.7;
    margin-bottom: var(--space-lg);
}

.testimonial__author {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.testimonial__avatar {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.testimonial__name {
    font-family: var(--font-heading);
    font-weight: 600;
}

.testimonial__role {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

/* === About Page === */
.about-hero {
    padding-top: calc(var(--space-3xl) + 80px);
}

.about-content {
    max-width: 800px;
}

.about-content p {
    font-size: var(--text-lg);
    line-height: 1.8;
    margin-bottom: var(--space-lg);
}

/* === Contacts Page === */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.contact-item__icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-alt);
    border-radius: var(--radius-lg);
    flex-shrink: 0;
}

.contact-item__icon svg {
    width: 24px;
    height: 24px;
    color: var(--color-accent);
}

.contact-item__label {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-xs);
}

.contact-item__value {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: 600;
}

.contact-form {
    background: var(--color-bg);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-card);
}

@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

/* === Policy & Terms Pages === */
.legal-content {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-2xl) 0;
    padding-top: calc(var(--space-2xl) + 80px);
}

.legal-content h1 {
    margin-bottom: var(--space-xl);
}

.legal-content h2 {
    font-size: var(--text-xl);
    margin: var(--space-xl) 0 var(--space-md);
}

.legal-content p {
    margin-bottom: var(--space-md);
    color: var(--color-text-muted);
    line-height: 1.7;
}

.legal-content ul {
    margin: var(--space-md) 0;
    padding-left: var(--space-lg);
}

/* === Product Showcase Section === */
.product-showcase {
    background-color: var(--color-bg-dark);
    padding: var(--space-3xl) 0;
    /* Reduced from 4xl */
    color: var(--color-text-light);
    overflow: hidden;
}

/* Header */
.product-showcase__header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 60px;
    /* Explicit 60px spacing as requested (was 30px/lg) */
}

.product-showcase__title {
    color: var(--color-text-light);
    font-size: clamp(2rem, 4vw, 3.5rem);
    margin-bottom: var(--space-md);
    text-transform: uppercase;
}

.product-showcase__subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--text-lg);
    line-height: 1.6;
}

/* Hero Image & Hotspots */
.product-showcase__hero {
    position: relative;
    margin-bottom: var(--space-xl);
}

.product-showcase__image-wrapper {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.product-showcase__image {
    width: 100%;
    height: auto;
    display: block;
    /* Optional: drop shadow for depth */
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5));
}

/* Hotspots */
.hotspot {
    position: absolute;
    width: 30px;
    height: 30px;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 20;
}

.hotspot__dot {
    width: 100%;
    height: 100%;
    background-color: var(--color-accent);
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 0 0 rgba(255, 69, 0, 0.7);
    animation: pulse-orange 2s infinite;
}

.hotspot__tooltip {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    /* Default hidden state */
    background-color: rgba(10, 25, 47, 0.95);
    /* Deep Blue Background */
    color: var(--color-text-light);
    /* White Text */
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    width: 240px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 100;
    border: 1px solid rgba(255, 171, 0, 0.2);
    /* Subtle Amber Border */
    backdrop-filter: blur(4px);
}

.hotspot__tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: rgba(10, 25, 47, 0.95) transparent transparent transparent;
    /* Match Background */
}

.hotspot__tooltip strong {
    display: block;
    color: var(--color-accent);
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.hotspot__tooltip span {
    font-size: 0.8rem;
    line-height: 1.4;
    display: block;
}

/* Show tooltip on Active state (Click) or Hover */
.hotspot.active .hotspot__tooltip,
.hotspot:hover .hotspot__tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Specific Override for Hotspot 1 (Roof/Aluminum) to appear TOP-LEFT so it doesn't cover title or other hotspots */
.hotspot--1 .hotspot__tooltip {
    top: auto;
    bottom: 12px;
    /* Even closer to remove gap */
    left: auto;
    right: 10px;
    /* Shift to left relative to dot */
    transform: none;
    /* Remove centering transform */
}

.hotspot--1 .hotspot__tooltip::after {
    top: 100%;
    /* Arrow at bottom */
    bottom: auto;
    left: auto;
    right: 20px;
    /* Align arrow with dot */
    margin-left: 0;
    border-color: rgba(10, 25, 47, 0.95) transparent transparent transparent;
    /* Point down */
}

@keyframes pulse-orange {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 69, 0, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 15px rgba(255, 69, 0, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 69, 0, 0);
    }
}

/* Mobile Features List */
.product-showcase__mobile-features {
    display: none;
    /* Hidden on desktop */
    margin-top: var(--space-xl);
    list-style: none;
    padding: 0;
}

.product-showcase__mobile-features li {
    margin-bottom: var(--space-sm);
    font-size: var(--text-base);
    color: rgba(255, 255, 255, 0.9);
}

/* Comparison Grid */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    max-width: 1000px;
    margin: 0 auto var(--space-4xl);
}

.comparison-card {
    background: rgba(31, 41, 55, 0.3);
    /* Darker glass base */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.comparison-card:hover {
    background: rgba(31, 41, 55, 0.5);
    border-color: var(--color-accent);
    box-shadow: 0 0 24px rgba(255, 171, 0, 0.25);
    transform: translateY(-6px);
}

/* Icons */
.card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-md);
    color: var(--color-accent);
    /* Amber icons */
}

/* Typography & Layout */
.card-label {
    display: block;
    font-family: var(--font-body);
    /* Inter */
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1.5px;
    color: var(--color-text-muted);
    /* Gray */
    text-transform: uppercase;
    margin-bottom: var(--space-sm);
}

.card-values {
    font-family: var(--font-heading);
    /* Montserrat */
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-light);
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    /* Stack on small screens if needed, or keeping inline */
    align-items: center;
    gap: 4px;
}

/* Advantage / Disadvantage Styling */
.advantage {
    color: var(--color-accent);
    /* Amber for advantage */
    font-weight: 600;
}

.divider {
    color: var(--color-text-muted);
    opacity: 0.5;
    font-size: 0.9em;
    margin: 4px 0;
    /* Vertical spacing if stacked */
}

.disadvantage {
    color: rgba(255, 255, 255, 0.6);
    /* Light Gray */
    font-weight: 400;
    font-size: 0.95em;
}

/* CTA */
.product-showcase__cta {
    text-align: center;
}

.product-showcase__micro-copy {
    margin-top: var(--space-sm);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

/* Responsive */
/* Mobile Slider Styles */
.product-showcase__mobile-slider {
    display: none;
    /* Hidden on desktop */
}

@media (max-width: 768px) {

    /* Hide interactive hotspots on mobile */
    .hotspot {
        pointer-events: none;
        /* Disable interaction */
        opacity: 0.7;
        width: 16px;
        height: 16px;
    }

    .hotspot__tooltip {
        display: none !important;
        /* Never show tooltips on mobile */
    }

    /* Hide the old static list */
    .product-showcase__mobile-features {
        display: none !important;
    }

    /* Show Mobile Slider */
    .product-showcase__mobile-slider {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: var(--space-md);
        padding: var(--space-md) var(--space-lg);
        /* Add horizontal padding for peek effect */
        margin-top: 40px;
        /* Space between image and cards */
        padding-bottom: var(--space-lg);
        /* Space for scrollbar if any */
        position: relative;
        z-index: 10;
        -webkit-overflow-scrolling: touch;
        /* Smooth scroll on iOS */
    }

    /* Hide scrollbar for cleaner look */
    .product-showcase__mobile-slider::-webkit-scrollbar {
        display: none;
    }

    .feature-card {
        flex: 0 0 85%;
        /* Card width */
        scroll-snap-align: center;
        background-color: rgba(10, 25, 47, 0.85);
        /* Dark Blue */
        backdrop-filter: blur(8px);
        border: 1px solid rgba(255, 171, 0, 0.2);
        border-radius: var(--radius-md);
        padding: var(--space-md);
        color: var(--color-text-light);
        display: flex;
        align-items: flex-start;
        gap: var(--space-sm);
        transition: transform 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
    }

    .feature-card__icon {
        font-size: 1.5rem;
        line-height: 1;
    }

    .feature-card__content strong {
        display: block;
        color: var(--color-accent);
        /* Amber */
        margin-bottom: 4px;
        font-size: 1rem;
    }

    .feature-card__content p {
        font-size: 0.9rem;
        line-height: 1.4;
        margin: 0;
        color: rgba(255, 255, 255, 0.9);
    }

    /* Active state for card (to be toggled via JS intersection observer) */
    .feature-card.active {
        border-color: var(--color-accent);
        background-color: rgba(10, 25, 47, 0.98);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }

    .comparison-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
        padding: 0 var(--space-md);
    }

    /* Mobile Hotspot Highlight */
    .hotspot.mobile-highlight .hotspot__dot {
        background-color: #fff;
        transform: scale(1.4);
        box-shadow: 0 0 20px rgba(255, 171, 0, 1);
        animation: none;
        /* Stop pulsing, just stay bright */
        border: 2px solid var(--color-accent);
    }
}