/* ============================================================
   Royal Builders Miami — Global Design System
   Extracted from Royal Windows Tailwind template
   ============================================================ */

/* --- Glass Panel --- */
.glass-panel {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* --- Hero Gradient Overlay --- */
.hero-gradient {
    background: linear-gradient(135deg, rgba(0,35,102,0.85) 0%, rgba(0,163,163,0.3) 100%);
}

/* --- Seal / Badge Gradient --- */
.seal-gradient {
    background: radial-gradient(circle at center, #FFD700 0%, #B8860B 100%);
}

/* --- Map Dot Background --- */
.map-bg {
    background-image: radial-gradient(#00A3A3 1px, transparent 1px);
    background-size: 20px 20px;
}

/* --- Custom Range Slider --- */
input[type='range'] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}
input[type='range']::-webkit-slider-runnable-track {
    background: #E2E8F0;
    height: 0.5rem;
    border-radius: 9999px;
}
input[type='range']::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    margin-top: -6px;
    background-color: #FF5722;
    border-radius: 9999px;
    height: 1.25rem;
    width: 1.25rem;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* --- Before / After Slider --- */
.comparison-slider {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    border-radius: 1rem;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: #0f172a;
    touch-action: none;
}

.comparison-before {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
}

.comparison-after {
    position: absolute;
    inset: 0;
    width: 50%;
    overflow: hidden;
}

.comparison-after img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
}

.comparison-slider-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 0;
    z-index: 4;
    cursor: ew-resize;
}

.comparison-slider-line::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -2px;
    width: 4px;
    background: #d4b067;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.comparison-slider-button {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 66px;
    height: 66px;
    border-radius: 9999px;
    border: 2px solid rgba(255, 255, 255, 0.75);
    background: #c7a967;
    color: #ffffff;
    display: grid;
    place-items: center;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.28);
    font-size: 1.85rem;
    line-height: 1;
    font-weight: 700;
}

.comparison-labels {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

.label-before,
.label-after {
    position: absolute;
    top: 1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.82rem;
    line-height: 1;
    color: #fff;
    padding: 0.85rem 1.2rem;
    border-radius: 0.7rem;
}

.label-before {
    left: 1rem;
    background: rgba(22, 101, 84, 0.85);
}

.label-after {
    right: 1rem;
    background: rgba(201, 168, 103, 0.92);
}

/* --- FAQ Accordion --- */
details > summary::-webkit-details-marker {
    display: none;
}
details[open] .faq-icon {
    transform: rotate(45deg);
}

/* --- Modal via :target --- */
#price-match-modal:target {
    display: flex;
}

/* --- Smooth scroll --- */
html {
    scroll-behavior: smooth;
}

/* --- Mobile nav toggle --- */
.mobile-nav {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
.mobile-nav.open {
    max-height: 1000px;
}

/* --- Dropdown hover --- */
.nav-dropdown {
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s ease;
}
.nav-group:hover .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* --- Header Nav Polish --- */
header nav[class*="hidden"][class*="flex"] {
    column-gap: clamp(1rem, 1.4vw, 1.9rem) !important;
}

header nav[class*="hidden"][class*="flex"] > a,
header nav[class*="hidden"][class*="flex"] > .nav-group > a {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.35rem;
    padding: 0.45rem 0.2rem;
    margin: 0;
    font-size: 0.99rem;
    line-height: 1.2;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

header nav[class*="hidden"][class*="flex"] > a:not([href^="tel:"]):hover,
header nav[class*="hidden"][class*="flex"] > .nav-group > a:hover {
    color: #FF5722;
}

header nav[class*="hidden"][class*="flex"] > a:not([href^="tel:"])::after,
header nav[class*="hidden"][class*="flex"] > .nav-group > a::after {
    content: "";
    position: absolute;
    left: 0.2rem;
    right: 0.2rem;
    bottom: -0.3rem;
    height: 2px;
    background: #FF5722;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}

header nav[class*="hidden"][class*="flex"] > a:not([href^="tel:"]):hover::after,
header nav[class*="hidden"][class*="flex"] > a:not([href^="tel:"]):focus-visible::after,
header nav[class*="hidden"][class*="flex"] > .nav-group > a:hover::after,
header nav[class*="hidden"][class*="flex"] > .nav-group > a:focus-visible::after,
header nav[class*="hidden"][class*="flex"] > a.text-vibrant-orange:not([href^="tel:"])::after {
    transform: scaleX(1);
}

header nav[class*="hidden"][class*="flex"] > .nav-group > a .material-symbols-outlined {
    font-size: 1.05rem;
    line-height: 1;
    transform: translateY(1px);
}

header nav[class*="hidden"][class*="flex"] > a[href^="tel:"] {
    white-space: nowrap !important;
    display: inline-flex;
    flex-wrap: nowrap;
    min-width: max-content;
    font-weight: 800;
    letter-spacing: 0.01em;
}

header a.hidden.md\:inline-block.bg-vibrant-orange {
    white-space: nowrap;
    font-size: 0.9rem;
    letter-spacing: 0.12em;
    padding: 0.78rem 1.6rem;
    border-radius: 0.8rem;
    box-shadow: 0 8px 18px rgba(255, 87, 34, 0.2);
}

header a.hidden.md\:inline-block.bg-vibrant-orange:hover {
    box-shadow: 0 10px 20px rgba(255, 87, 34, 0.26);
}

header .mobile-nav .pt-4.pb-2 a {
    font-size: 0.94rem;
    letter-spacing: 0.07em;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
}

/* --- Financing Cards --- */
.financing-section {
    position: relative;
    background:
        radial-gradient(1200px 300px at 10% 0%, rgba(29, 78, 216, 0.1), transparent 60%),
        radial-gradient(1000px 320px at 90% 100%, rgba(255, 87, 34, 0.12), transparent 55%),
        linear-gradient(180deg, #f6f9ff 0%, #eef4ff 100%);
}

.finance-grid {
    align-items: stretch;
}

.finance-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 100%;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 251, 255, 0.94) 100%);
    border: 1px solid rgba(0, 35, 102, 0.16);
    backdrop-filter: blur(8px);
    box-shadow: 0 14px 34px rgba(0, 35, 102, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.65);
    animation: financeFloatIn 0.7s ease both;
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.finance-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(320px 160px at 88% 0%, rgba(255, 87, 34, 0.08), transparent 70%),
        radial-gradient(300px 160px at 0% 100%, rgba(29, 78, 216, 0.08), transparent 72%);
    pointer-events: none;
}

.finance-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #002366 0%, #00a3a3 60%, #ff5722 100%);
    opacity: 0.92;
}

.finance-card--pace::after {
    background: linear-gradient(90deg, #002366 0%, #2f5db5 55%, #ff5722 100%);
}

.finance-card--homerun::after {
    background: linear-gradient(90deg, #00a3a3 0%, #2c7be5 58%, #ff5722 100%);
}

.finance-card--ygrene::after {
    background: linear-gradient(90deg, #7cb342 0%, #00a3a3 60%, #ff5722 100%);
}

.finance-card > * {
    position: relative;
    z-index: 1;
}

.finance-card:nth-child(2) {
    animation-delay: 0.08s;
}

.finance-card:nth-child(3) {
    animation-delay: 0.16s;
}

.finance-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 24px 48px rgba(0, 35, 102, 0.2), 0 10px 28px rgba(255, 87, 34, 0.12);
    border-color: rgba(29, 78, 216, 0.34);
}

.finance-header {
    padding-top: 0.55rem;
    padding-right: 3rem;
}

.finance-popular-tag {
    border-bottom-right-radius: 1rem;
}

.finance-corner-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    width: 2.65rem;
    height: 2.65rem;
    border-radius: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(255, 255, 255, 1) 0%, rgba(231, 239, 255, 0.95) 100%);
    border: 1px solid rgba(0, 35, 102, 0.14);
    color: #002366;
    font-size: 1.2rem;
    box-shadow: 0 8px 18px rgba(0, 35, 102, 0.14);
}

.finance-card--homerun .finance-corner-icon {
    color: #008a8a;
    background: linear-gradient(145deg, #f3fffd 0%, #e4f5f5 100%);
}

.finance-card--ygrene .finance-corner-icon {
    color: #ff5722;
    background: linear-gradient(145deg, #fff7f3 0%, #ffefe8 100%);
}

.finance-logo-wrap {
    height: 2.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 35, 102, 0.14);
    border-radius: 0.9rem;
    padding: 0.35rem 0.6rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6), 0 6px 12px rgba(0, 35, 102, 0.08);
}

.finance-logo-wrap-home-run {
    height: 4.2rem;
    min-width: 15rem;
    padding: 0.35rem 0.7rem;
    max-width: 100%;
}

.finance-brand-cfpb {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.8rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(0, 35, 102, 0.14);
    background: #ffffff;
    box-shadow: 0 6px 12px rgba(0, 35, 102, 0.08);
}

.finance-pill {
    font-size: 0.68rem;
    line-height: 1;
    padding: 0.48rem 0.78rem;
    border: 1px solid rgba(0, 35, 102, 0.1);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.finance-content {
    display: flex;
    flex-direction: column;
}

.finance-title {
    letter-spacing: -0.01em;
    text-wrap: balance;
}

.finance-description {
    max-width: 30ch;
}

.finance-feature-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.1rem;
}

.finance-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 0.78rem;
    background: rgba(29, 78, 216, 0.1);
    border: 1px solid rgba(0, 35, 102, 0.12);
    font-size: 1.14rem;
    line-height: 1;
}

.finance-feature-label {
    font-size: 0.67rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(0, 35, 102, 0.62);
}

.finance-link {
    padding-top: 0.5rem;
}

.finance-link .material-symbols-outlined {
    transition: transform 0.2s ease;
}

.finance-link:hover .material-symbols-outlined {
    transform: translateX(3px);
}

.finance-logo {
    max-height: 2.4rem;
    width: auto;
    object-fit: contain;
}

.finance-logo-home-run {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
}

@media (max-width: 768px) {
    .finance-card {
        padding: 2rem 1.6rem !important;
    }

    .finance-header {
        padding-right: 0;
        padding-top: 1.95rem;
    }

    .finance-corner-icon {
        top: 0.9rem;
        right: 0.9rem;
        width: 2.45rem;
        height: 2.45rem;
    }

    .finance-logo-wrap-home-run {
        min-width: 12rem;
        height: 3.6rem;
    }
}

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

/* --- Animations --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}
