/* ==========================================
   נופש ירין — Warm & Natural Design
   כפרי-מודרני, תחושת בקתה בטבע
   ========================================== */

:root {
    --wood: #6B4226;
    --wood-light: #8B6342;
    --wood-pale: #A67C52;
    --bark: #3E2723;
    --olive: #5C6B3C;
    --olive-light: #7A8A5A;
    --sage: #9CAF88;
    --terra: #C17B4A;
    --terra-light: #D4915E;
    --sand: #F5EDDF;
    --sand-dark: #EAE0CE;
    --linen: #FBF8F2;
    --warm-white: #FFFCF7;
    --text-dark: #3B2F25;
    --text-body: #5C4D3C;
    --text-muted: #8C7E6E;
    --shadow-warm: 0 4px 20px rgba(107, 66, 38, 0.08);
    --shadow-warm-md: 0 8px 30px rgba(107, 66, 38, 0.1);
    --shadow-warm-lg: 0 16px 50px rgba(107, 66, 38, 0.12);
}

/* ---- Reset & Base ---- */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    overflow-x: hidden;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--text-body);
    background: var(--linen);
    line-height: 1.75;
    overflow-x: hidden;
    width: 100%;
}

/* Prevent any section from causing horizontal overflow */
main, section, footer, nav {
    max-width: 100vw;
    overflow-x: hidden;
}

::selection {
    background: var(--terra);
    color: white;
}

/* ---- Typography ---- */
.font-heading {
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: var(--text-dark);
}

.font-display {
    color: var(--text-dark);
    line-height: 1.1;
}

/* Section headers */
.section-label {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--terra);
    display: inline-block;
}

.section-title {
    color: var(--text-dark);
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
}

.section-subtitle {
    color: var(--text-muted);
    max-width: 36rem;
    margin: 0 auto;
}

/* ---- Hero ---- */
.hero-bg {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    animation: heroZoom 25s ease-in-out infinite alternate;
}

@keyframes heroZoom {
    from { transform: scale(1); }
    to { transform: scale(1.08); }
}

#hero h1 {
    text-shadow: 0 2px 30px rgba(0,0,0,0.35);
}

/* ---- Navbar ---- */
#navbar {
    background: transparent;
    transition: background 0.35s ease, box-shadow 0.35s ease;
}

/* Scrolled state */
#navbar.scrolled {
    background: var(--warm-white);
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

#navbar.scrolled .nav-link {
    color: var(--text-muted) !important;
}

#navbar.scrolled .nav-link:hover {
    color: var(--terra) !important;
}

#navbar.scrolled .navbar-text-transition {
    color: var(--text-dark) !important;
}

#navbar.scrolled .navbar-sub-transition {
    color: var(--text-muted) !important;
}

#navbar.scrolled #mobile-menu-btn,
#navbar.scrolled .mobile-phone-link {
    color: var(--text-dark) !important;
}

#navbar.scrolled .nav-phone {
    color: var(--text-body) !important;
}

#navbar.scrolled .nav-phone:hover {
    color: var(--terra) !important;
}

#navbar.scrolled .nav-logo-icon {
    background: var(--sand-dark);
    border-color: transparent;
}

#navbar.scrolled .nav-logo-icon i {
    color: var(--terra) !important;
}

/* Nav link underline on hover */
.nav-link {
    position: relative;
    padding-bottom: 3px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--terra);
    border-radius: 1px;
    transition: width 0.25s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Mobile menu */
.mobile-menu-bg {
    background: var(--bark);
    /* no backdrop-filter needed - solid background */
}

/* ---- Buttons ---- */
.btn-primary {
    background: var(--terra);
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(193, 123, 74, 0.25);
}

.btn-primary:hover {
    background: var(--terra-light);
    box-shadow: 0 6px 25px rgba(193, 123, 74, 0.35);
    transform: translateY(-1px);
}

.btn-outline {
    border: 2px solid rgba(255,255,255,0.45);
    background: rgba(255,255,255,0.08);
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.7);
}

.btn-submit {
    background: var(--olive);
    color: white;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    background: var(--olive-light);
    box-shadow: 0 4px 20px rgba(92, 107, 60, 0.3);
    transform: translateY(-1px);
}

/* ---- Scroll Animations ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in-up {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.animation-delay-200 { animation-delay: 0.15s; }
.animation-delay-400 { animation-delay: 0.3s; }
.animation-delay-600 { animation-delay: 0.45s; }
.animation-delay-800 { animation-delay: 0.6s; }
.animation-delay-1000 { animation-delay: 0.75s; }

.reveal-up, .reveal-left, .reveal-right, .reveal-scale {
    opacity: 0;
    transition: all 0.7s ease-out;
}

.reveal-up { transform: translateY(30px); }
.reveal-left { transform: translateX(-30px); }
.reveal-right { transform: translateX(30px); }
.reveal-scale { transform: scale(0.95); }

.reveal-up.revealed,
.reveal-left.revealed,
.reveal-right.revealed,
.reveal-scale.revealed {
    opacity: 1;
    transform: none;
}

/* ---- Cards ---- */
.unit-card {
    background: var(--warm-white);
    border-radius: 20px;
    border: 1px solid rgba(107, 66, 38, 0.06);
    transition: all 0.4s ease;
    box-shadow: var(--shadow-warm);
}

.unit-card:hover {
    box-shadow: var(--shadow-warm-lg);
    transform: translateY(-5px);
}

.unit-badge {
    backdrop-filter: blur(8px);
    background: rgba(62, 39, 35, 0.55);
    border: 1px solid rgba(255,255,255,0.15);
}

.price-tag {
    color: var(--terra);
    font-weight: 700;
}

/* Amenity cards */
.amenity-card {
    background: var(--warm-white);
    border-radius: 20px;
    border: 1px solid rgba(107, 66, 38, 0.06);
    transition: all 0.3s ease;
}

.amenity-card:hover {
    box-shadow: var(--shadow-warm-md);
}

/* Attraction cards */
.attraction-card {
    background: var(--warm-white);
    border-radius: 16px;
    border: 1px solid rgba(107, 66, 38, 0.06);
    transition: all 0.3s ease;
}

.attraction-card:hover {
    box-shadow: var(--shadow-warm-md);
    transform: translateY(-3px);
}

/* Pricing cards */
.pricing-card {
    background: var(--warm-white);
    border-radius: 24px;
    border: 1px solid rgba(107, 66, 38, 0.06);
    transition: all 0.3s ease;
}

.pricing-card:hover {
    box-shadow: var(--shadow-warm-md);
}

/* Review cards */
.review-card {
    background: var(--warm-white);
    border-radius: 24px;
    border: 1px solid rgba(107, 66, 38, 0.06);
    box-shadow: var(--shadow-warm);
}

.review-dot {
    transition: all 0.3s ease;
}

.review-dot.active {
    background-color: var(--terra) !important;
    width: 24px;
    border-radius: 9999px;
}

/* Contact info */
.contact-info-card {
    background: var(--warm-white);
    border-radius: 20px;
    border: 1px solid rgba(107, 66, 38, 0.06);
    transition: all 0.3s ease;
}

.contact-info-card:hover {
    box-shadow: var(--shadow-warm-md);
}

/* ---- Gallery ---- */
.gallery-item {
    border-radius: 16px;
    transition: all 0.4s ease;
}

.gallery-item.hidden-filter {
    opacity: 0;
    transform: scale(0.85);
    position: absolute;
    pointer-events: none;
}

.gallery-filter {
    transition: all 0.25s ease;
    border: 1.5px solid transparent;
    border-radius: 999px;
}

.gallery-filter.active {
    background: var(--wood);
    color: white;
    border-color: var(--wood);
}

.gallery-filter:not(.active):hover {
    border-color: var(--terra);
    color: var(--terra);
    background: transparent;
}

/* ---- Gallery Mobile Carousel ---- */
#gallery-carousel {
    touch-action: pan-y pinch-zoom;
}

#gallery-carousel-track {
    transition: transform 0.35s ease-out;
    cursor: grab;
}

#gallery-carousel-track:active {
    cursor: grabbing;
}

.gallery-slide {
    padding: 0 2px;
}

.gallery-slide img {
    user-select: none;
    -webkit-user-drag: none;
}

/* ---- Lightbox ---- */
#lightbox {
    background: rgba(30, 20, 15, 0.95);
    transition: opacity 0.3s ease;
}

#lightbox.show {
    display: flex;
    opacity: 1;
}

#lightbox img {
    border-radius: 12px;
}

/* ---- Form ---- */
#contact-form input,
#contact-form select,
#contact-form textarea {
    font-size: 16px;
    border: 1.5px solid rgba(107, 66, 38, 0.1);
    border-radius: 14px;
    background: var(--warm-white);
    transition: all 0.3s ease;
    color: var(--text-dark);
}

#contact-form input:focus,
#contact-form select:focus,
#contact-form textarea:focus {
    border-color: var(--terra);
    box-shadow: 0 0 0 3px rgba(193, 123, 74, 0.12);
    background: white;
    outline: none;
}

@media (min-width: 640px) {
    #contact-form input,
    #contact-form select,
    #contact-form textarea { font-size: inherit; }
}

#contact-form .error {
    border-color: #D32F2F !important;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1) !important;
}

#contact-form .error-message {
    color: #D32F2F;
    font-size: 0.75rem;
    margin-top: 0.3rem;
}

.btn-loading {
    pointer-events: none;
    opacity: 0.7;
}
.btn-loading span, .btn-loading i { visibility: hidden; }
.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    right: calc(50% - 10px);
    top: calc(50% - 10px);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- WhatsApp ---- */
#whatsapp-float {
    animation: gentlePulse 3s ease-in-out infinite;
}

@keyframes gentlePulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3); }
    50% { box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3), 0 0 0 10px rgba(34, 197, 94, 0); }
}

#whatsapp-float span {
    left: auto;
    right: calc(100% + 12px);
    border-radius: 10px;
    box-shadow: var(--shadow-warm-md);
}

/* ---- Footer ---- */
footer {
    background: var(--bark);
}

.footer-divider {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    height: 1px;
}

/* ---- Scroll indicator ---- */
.scroll-indicator {
    animation: gentleBounce 2.5s ease-in-out infinite;
}

@keyframes gentleBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.5; }
    50% { transform: translateX(-50%) translateY(-8px); opacity: 0.9; }
}

/* ---- Mobile CTA ---- */
#mobile-cta {
    backdrop-filter: blur(16px);
    box-shadow: 0 -2px 15px rgba(0,0,0,0.06);
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 380px) {
    #hero h1 { font-size: 1.85rem; }
    .gallery-filter { padding: 0.35rem 0.7rem; font-size: 0.7rem; }
    #contact-form { padding: 1rem; }
}

@media (max-width: 640px) {
    #hero { min-height: 100svh; min-height: -webkit-fill-available; }

    #gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }

    .gallery-filters-wrap {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        justify-content: flex-start;
        gap: 6px;
        padding-bottom: 6px;
    }
    .gallery-filters-wrap::-webkit-scrollbar { display: none; }
    .gallery-filter { white-space: nowrap; flex-shrink: 0; font-size: 0.75rem; padding: 0.4rem 0.9rem; }

    .amenity-card { padding: 1.25rem; }
    .attractions-map { height: 250px; }
    .review-card { padding: 1.25rem; }
    #contact-form { padding: 1.25rem; }
    #whatsapp-float span { display: none; }
    #lightbox-img { max-width: 95vw; max-height: 75vh; }
    footer { padding-bottom: 5rem; }
    #whatsapp-float { bottom: 4.5rem; }
}

@media (max-width: 768px) {
    .unit-card:hover { transform: none; }
}

@supports (height: 100svh) {
    #hero { height: 100svh; }
}

@media (hover: none) {
    .unit-card:hover, .attraction-card:hover, .pricing-card:hover { transform: none; }
    .btn-primary:hover, .btn-submit:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .hero-slide.active { animation: none; }
    .reveal-up, .reveal-left, .reveal-right, .reveal-scale { opacity: 1; transform: none; }
}

@media print {
    #navbar, #whatsapp-float, #lightbox, .hero-slide, #mobile-cta { display: none !important; }
    body { color: black; background: white; }
}
