/**
 * ALANYA TOURS - Responsive Styles
 * Mobile-First Approach
 */

/* ===================================
   BREAKPOINTS
   =================================== */
/* 
   xs: 0-575px (Mobile Portrait)
   sm: 576-767px (Mobile Landscape)
   md: 768-991px (Tablet)
   lg: 992-1199px (Desktop)
   xl: 1200px+ (Large Desktop)
*/

/* ===================================
   TABLET & BELOW (max-width: 991px)
   =================================== */
@media (max-width: 991px) {
    
    /* Typography */
    h1 { font-size: var(--font-size-4xl); }
    h2 { font-size: var(--font-size-3xl); }
    h3 { font-size: var(--font-size-2xl); }
    
    /* Container */
    .container {
        padding: 0 var(--spacing-lg);
    }
    
    /* Hide desktop nav CTA button on mobile */
    .nav-cta {
        display: none !important;
    }
    
    /* Header - Mobile Navigation */
    .mobile-toggle {
        display: flex;
        position: relative;
        z-index: 1000;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background-color: var(--color-white);
        flex-direction: column;
        align-items: flex-start;
        padding: var(--spacing-3xl) var(--spacing-xl);
        box-shadow: var(--shadow-xl);
        transition: right var(--transition-base);
        overflow-y: auto;
        z-index: 999;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-item {
        width: 100%;
        border-bottom: 1px solid var(--color-gray-200);
    }
    
    .nav-link {
        width: 100%;
        padding: var(--spacing-md) 0;
    }
    
    /* Dropdown Submenu - Mobile */
    .dropdown-submenu {
        position: static;
        margin-top: 0;
        margin-left: var(--spacing-lg);
        border: none;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition-base);
    }
    
    .nav-item.dropdown-open .dropdown-submenu {
        max-height: 500px;
    }
    
    .nav-cta {
        margin-left: 0;
        margin-top: var(--spacing-lg);
        width: 100%;
    }
    
    /* Mobile Menu Overlay */
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-base);
        z-index: 998;
        pointer-events: none;
        cursor: pointer;
    }
    
    .mobile-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    
    /* Hero Section */
    .hero-section {
        height: 500px;
    }
    
    .hero-title {
        font-size: var(--font-size-4xl);
    }
    
    .hero-subtitle {
        font-size: var(--font-size-lg);
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }
    
    .hero-actions .btn {
        width: 100%;
    }
    
    .hero-controls {
        padding: 0 var(--spacing-md);
    }
    
    .hero-prev,
    .hero-next {
        width: 40px;
        height: 40px;
    }
    
    /* Search Section - Mobile 2x2 Grid Layout */
    .search-section {
        margin-top: 15px;
        padding-bottom: var(--spacing-xl);
    }
    
    .search-box {
        padding: var(--spacing-md);
    }
    
    .search-form {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: var(--spacing-sm) !important;
    }
    
    .search-header h1 {
        font-size: 24px !important;
        margin: 0 0 6px 0 !important;
    }
    
    .search-header p {
        font-size: 14px !important;
    }
    
    /* Row 1: Search + Location (2 columns) */
    .search-form > div:nth-child(1) {
        grid-column: span 1 !important;
    }
    
    .search-form > div:nth-child(2) {
        grid-column: span 1 !important;
    }
    
    /* Row 2: Category + Featured (2 columns) */
    .search-form > div:nth-child(3) {
        grid-column: span 1 !important;
    }
    
    .search-form > div:nth-child(4) {
        grid-column: span 1 !important;
    }
    
    /* Row 3: Search button (full width) */
    .search-form > button {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        padding: 14px !important;
        font-size: 15px !important;
        margin-top: var(--spacing-xs) !important;
    }
    
    .search-input,
    .search-select {
        padding: 12px !important;
        font-size: 14px !important;
    }
    
    /* Tours Grid */
    .tours-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: var(--spacing-lg);
    }
    
    /* Categories Grid */
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: var(--spacing-md);
    }
    
    /* Features Grid */
    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: var(--spacing-lg);
    }
    
    /* Blog Grid */
    .blog-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    /* CTA Section */
    .cta-title {
        font-size: var(--font-size-3xl);
    }
    
    .cta-text {
        font-size: var(--font-size-base);
    }
    
    .cta-actions {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .cta-actions .btn {
        width: 100%;
    }
}

/* ===================================
   MOBILE LANDSCAPE & BELOW (max-width: 767px)
   =================================== */
@media (max-width: 767px) {
    
    /* ===================================
       MOBILE TOP BAR - CLEAN & COMPACT
       Left: Phone/Email Icons | Right: Lang/Currency with Flags
       =================================== */
    
    /* Top Bar Container */
    .top-bar {
        font-size: 11px;
        padding: 0;
        background-color: #f6f7f6;
    }
    
    .top-bar-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        gap: 8px;
    }
    
    /* Left: Phone & Email Icons Only */
    .top-bar-left {
        display: flex;
        gap: 8px;
        justify-content: flex-start;
    }
    
    .top-link {
        font-size: 0 !important;
        padding: 4px;
        color: #677470;
        transition: color 0.2s;
    }
    
    .top-link:hover {
        color: var(--color-primary);
    }
    
    .top-link svg {
        width: 16px;
        height: 16px;
    }
    
    /* Right: Language & Currency with Flags */
    .top-bar-right {
        display: flex;
        gap: 8px;
        justify-content: flex-end;
    }
    
    .dropdown {
        flex-shrink: 0;
    }
    
    .dropdown-toggle {
        padding: 4px 8px;
        font-size: 10px;
        font-weight: 600;
        border: 1px solid #d8dcda;
        background-color: white;
        border-radius: 4px;
        gap: 4px;
        transition: all 0.2s;
        display: flex;
        align-items: center;
    }
    
    .dropdown-toggle:hover {
        background-color: #f6f7f6;
        border-color: var(--color-primary);
    }
    
    .dropdown-toggle svg {
        width: 8px;
        height: 8px;
    }
    
    /* Keep flag icons visible on mobile */
    .dropdown-toggle .fi {
        font-size: 12px;
    }
    
    /* Hero */
    .hero-section {
        height: 450px;
    }
    
    .hero-title {
        font-size: var(--font-size-3xl);
    }
    
    .hero-subtitle {
        font-size: var(--font-size-base);
    }
    
    /* Section Headers */
    .section-title {
        font-size: var(--font-size-3xl);
    }
    
    .section-subtitle {
        font-size: var(--font-size-base);
    }
    
    /* Tours Grid */
    .tours-grid {
        grid-template-columns: 1fr;
    }
    
    /* Categories Grid */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Features Grid */
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
    }
    
    .feature-icon svg {
        width: 36px;
        height: 36px;
    }
    
    /* Back to Top */
    .back-to-top {
        bottom: var(--spacing-lg);
        right: var(--spacing-lg);
        width: 45px;
        height: 45px;
    }
}

/* ===================================
   MOBILE PORTRAIT (max-width: 575px)
   =================================== */
@media (max-width: 575px) {
    
    /* Container */
    .container {
        padding: 0 var(--spacing-md);
    }
    
    /* Typography */
    h1 { font-size: var(--font-size-3xl); }
    h2 { font-size: var(--font-size-2xl); }
    h3 { font-size: var(--font-size-xl); }
    
    /* Buttons */
    .btn {
        padding: 10px 20px;
        font-size: var(--font-size-sm);
    }
    
    .btn-lg {
        padding: 14px 28px;
        font-size: var(--font-size-base);
    }
    
    /* ===================================
       ULTRA SMALL SCREENS (320px)
       =================================== */
    
    /* Top Bar - Even More Compact */
    .top-bar {
        font-size: 10px;
        background-color: #f6f7f6;
    }
    
    .top-bar-content {
        grid-template-columns: auto 1fr auto;
        gap: 6px;
        padding: 6px 0;
    }
    
    .top-bar-left {
        gap: 6px;
    }
    
    .top-link svg {
        width: 14px;
        height: 14px;
    }
    
    /* Book Button - Slightly Smaller */
    .mobile-book-btn {
        padding: 5px 12px;
        font-size: 11px;
        border-radius: 5px;
    }
    
    /* Language & Currency */
    .top-bar-right {
        gap: 4px;
    }
    
    .dropdown-toggle {
        padding: 3px 5px;
        font-size: 9px;
        min-width: 38px;
    }
    
    /* Logo */
    .site-logo img {
        height: 50px;
        max-width: 150px;
        object-fit: contain;
    }
    
    /* Book Now Button - Ultra Minimal Mobile */
    .nav-cta {
        display: none !important; /* Hidden on mobile - replaced by sidebar */
    }
    
    /* ===================================
       STICKY SIDEBAR BOOK BUTTON (Mobile Only)
       LEFT SIDE - MINIMAL & CLEAN
       =================================== */
    .mobile-sidebar-book {
        position: fixed;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        z-index: 998;
        writing-mode: vertical-rl;
        text-orientation: mixed;
        background: #0d7377;
        color: white;
        padding: 16px 6px;
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        border-radius: 0 6px 6px 0;
        box-shadow: 2px 2px 8px rgba(0,0,0,0.15);
        cursor: pointer;
        transition: all 0.3s ease;
        text-decoration: none;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-sidebar-book:hover {
        background: #0a5a5d;
        box-shadow: 3px 3px 12px rgba(0,0,0,0.2);
    }
    
    /* Remove icon */
    .mobile-sidebar-book::before {
        display: none;
    }
    
    /* Hero */
    .hero-section {
        height: 400px;
    }
    
    .hero-title {
        font-size: var(--font-size-2xl);
    }
    
    .hero-subtitle {
        font-size: var(--font-size-sm);
    }
    
    .hero-content {
        padding: var(--spacing-lg);
    }
    
    .hero-prev,
    .hero-next {
        width: 36px;
        height: 36px;
    }
    
    .hero-dots {
        bottom: var(--spacing-md);
    }
    
    .hero-dot {
        width: 10px;
        height: 10px;
    }
    
    /* Search Box */
    .search-box {
        padding: var(--spacing-lg);
    }
    
    /* Section Spacing */
    .featured-tours-section,
    .categories-section,
    .why-section,
    .blog-section,
    .cta-section {
        padding: var(--spacing-2xl) 0;
    }
    
    /* Section Headers */
    .section-header {
        margin-bottom: var(--spacing-xl);
    }
    
    .section-title {
        font-size: var(--font-size-2xl);
    }
    
    .section-subtitle {
        font-size: var(--font-size-sm);
    }
    
    /* Tour Card */
    .tour-image {
        height: 200px;
    }
    
    .tour-content {
        padding: var(--spacing-md);
    }
    
    .tour-title {
        font-size: var(--font-size-lg);
    }
    
    .tour-meta {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .tour-footer {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .tour-footer .btn {
        width: 100%;
    }
    
    /* Categories */
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .category-image {
        height: 120px;
    }
    
    .category-content {
        padding: var(--spacing-md);
    }
    
    /* Blog Card */
    .blog-image {
        height: 180px;
    }
    
    .blog-content {
        padding: var(--spacing-md);
    }
    
    .blog-title {
        font-size: var(--font-size-lg);
    }
    
    /* Footer */
    .site-footer {
        padding: var(--spacing-2xl) 0 var(--spacing-md);
    }
    
    .footer-grid {
        gap: var(--spacing-lg);
    }
    
    .footer-col {
        text-align: center;
    }
    
    .footer-logo {
        margin: 0 auto var(--spacing-md);
    }
    
    .footer-contact a {
        justify-content: center;
    }
    
    .footer-links {
        text-align: center;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-btn {
        width: 100%;
    }
    
    .social-links {
        justify-content: center;
    }
    
    /* CTA Section */
    .cta-section {
        padding: var(--spacing-2xl) 0;
    }
    
    .cta-title {
        font-size: var(--font-size-2xl);
    }
    
    .cta-text {
        font-size: var(--font-size-sm);
    }
    
    /* Breadcrumb */
    .breadcrumb-list {
        font-size: var(--font-size-xs);
    }
    
    /* Back to Top */
    .back-to-top {
        bottom: var(--spacing-md);
        right: var(--spacing-md);
        width: 40px;
        height: 40px;
    }
    
    .back-to-top svg {
        width: 20px;
        height: 20px;
    }
}

/* ===================================
   LARGE DESKTOP (min-width: 1200px)
   =================================== */
@media (min-width: 1200px) {
    
    /* Container */
    .container {
        max-width: 1320px;
    }
    
    /* Hero */
    .hero-section {
        height: 700px;
    }
    
    .hero-title {
        font-size: 56px;
    }
    
    .hero-subtitle {
        font-size: var(--font-size-2xl);
    }
    
    /* Tours Grid */
    .tours-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Categories Grid */
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===================================
   EXTRA LARGE DESKTOP (min-width: 1400px)
   =================================== */
@media (min-width: 1400px) {
    
    /* Container */
    .container {
        max-width: 1400px;
    }
    
    /* Hero */
    .hero-section {
        height: 750px;
    }
}

/* ===================================
   PRINT STYLES
   =================================== */
@media print {
    
    /* Hide non-essential elements */
    .site-header,
    .site-footer,
    .back-to-top,
    .hero-controls,
    .hero-dots,
    .cta-section,
    .search-section {
        display: none !important;
    }
    
    /* Optimize for printing */
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    a {
        text-decoration: underline;
        color: #000;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
    
    .tour-card,
    .blog-card,
    .category-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #d8dcda;
    }
}

/* ===================================
   ACCESSIBILITY - REDUCED MOTION
   =================================== */
@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 {
        transition: none;
    }
}

/* ===================================
   DARK MODE SUPPORT (OPTIONAL)
   =================================== */
@media (prefers-color-scheme: dark) {
    /* Future: Add dark mode styles here */
}

/* ===================================
   WHATSAPP STICKY BUTTON (All Devices)
   =================================== */

.whatsapp-sticky {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 997;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #25D366;
    color: white;
    padding: 12px 16px 12px 12px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    text-decoration: none;
    transition: all 0.3s ease;
    animation: whatsappPulse 2s infinite;
}

.whatsapp-sticky:hover {
    background: #20BA5A;
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.5);
    transform: translateY(-2px);
}

.whatsapp-sticky svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.whatsapp-badge {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    animation: badgeSlide 0.5s ease forwards;
}

/* Pulse animation */
@keyframes whatsappPulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.6);
    }
}

/* Badge slide in */
@keyframes badgeSlide {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Smaller screens - compact version */
@media (max-width: 575px) {
    .whatsapp-sticky {
        left: 15px;
        bottom: 15px;
        padding: 10px 14px 10px 10px;
    }
    
    .whatsapp-sticky svg {
        width: 24px;
        height: 24px;
    }
    
    .whatsapp-badge {
        font-size: 12px;
    }
}
/* ===================================
   OVERFLOW SAFEGUARD (global)
   =================================== */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* ===================================
   ATG GALLERY — SINGLE SOURCE OF TRUTH
   Slider: absolute-positioned slides with opacity fade
   =================================== */

/* Gallery wrapper */
.atg-gallery {
    margin-bottom: 24px;
    width: 100%;
    max-width: 100%;
}

/* Slider container — aspect-ratio scales height with actual width */
.atg-slider-wrap {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 10;
    max-height: 460px;
    overflow: hidden;
    border-radius: 12px;
    background: #1c2826;
}

.atg-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Slides: stacked, fade with opacity (controlled by JS via inline style) */
.atg-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.4s ease;
}

.atg-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Nav arrows */
.atg-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.atg-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

.atg-nav-prev { left: 10px; }
.atg-nav-next { right: 10px; }

/* Counter badge */
.atg-counter {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    z-index: 4;
}

/* Expand / view-all button */
.atg-expand {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    z-index: 4;
    transition: background 0.2s ease;
}

.atg-expand:hover {
    background: rgba(0, 0, 0, 0.85);
}

/* Thumbnail strip */
.atg-thumb-strip {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    overflow-x: auto;
    padding: 2px;
    scrollbar-width: thin;
}

.atg-thumb {
    flex-shrink: 0;
    width: 78px;
    height: 58px;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.atg-thumb:hover {
    opacity: 1 !important;
}

.atg-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Lightbox (JS toggles display via inline style) */
.atg-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.atg-lb-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    z-index: 2;
}

.atg-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s ease;
}

.atg-lb-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.atg-lb-prev { left: 16px; }
.atg-lb-next { right: 16px; }

#atgLbImg {
    max-width: 92vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 6px;
    transition: opacity 0.2s ease;
}

.atg-lb-counter {
    color: #b9c0bd;
    font-size: 14px;
    margin-top: 12px;
}

/* ATG Responsive: aspect-ratio handles slider height automatically.
   These breakpoints adjust only decorative element sizes. */
@media (max-width: 991px) {
    .atg-slider-wrap { max-height: 360px; }
}

@media (max-width: 767px) {
    .atg-slider-wrap { max-height: 300px; aspect-ratio: 16 / 11; }
    .atg-nav { width: 34px; height: 34px; font-size: 14px; }
    .atg-expand { font-size: 11px; padding: 4px 8px; }
    .atg-counter { font-size: 11px; padding: 2px 8px; }
}

@media (max-width: 575px) {
    .atg-slider-wrap { max-height: 240px; aspect-ratio: 4 / 3; }
    .atg-thumb { width: 54px; height: 42px; }
    .atg-lb-nav { width: 38px; height: 38px; font-size: 18px; }
    .atg-lb-prev { left: 8px; }
    .atg-lb-next { right: 8px; }
}