/* ========================================
   Travel Booking Platform v1.027
   Base Stylesheet — Mobile-First Architecture
   ======================================== */

/* ========================================
   CSS CUSTOM PROPERTIES
   ======================================== */
:root {
    /* Brand Colors */
    --primary: #f26722;
    --primary-hover: #e05b17;
    --primary-light: rgba(242, 103, 34, 0.1);
    --primary-shadow: rgba(242, 103, 34, 0.2);
    --primary-focus: rgba(242, 103, 34, 0.3);
    --accent: #667eea;
    --accent-hover: #5568d3;

    /* Semantic Colors */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    /* Text */
    --text-dark: #333;
    --text-medium: #555;
    --text-light: #666;
    --text-muted: #999;

    /* Backgrounds */
    --bg-primary: #fff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #f9f9f9;

    /* Borders & Shadows */
    --border: #e0e0e0;
    --border-light: #f0f0f0;
    --shadow-xs: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-sm: 0 2px 5px rgba(0,0,0,0.05);
    --shadow-md: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 5px 20px rgba(0,0,0,0.15);
    --shadow-nav: 0 -2px 5px rgba(0,0,0,0.1);

    /* Radius */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
    --radius-full: 50%;

    /* Spacing */
    --sp-xs: 4px;
    --sp-sm: 8px;
    --sp-md: 12px;
    --sp-lg: 16px;
    --sp-xl: 20px;
    --sp-2xl: 24px;
    --sp-3xl: 32px;

    /* Typography */
    --fs-xs: 0.6875rem;
    --fs-sm: 0.8125rem;
    --fs-base: 0.875rem;
    --fs-md: 0.9375rem;
    --fs-lg: 1rem;
    --fs-xl: 1.125rem;
    --fs-2xl: 1.25rem;
    --fs-3xl: 1.5rem;

    /* Transitions */
    --ease-fast: 0.15s ease;
    --ease-base: 0.2s ease;
    --ease-slow: 0.3s ease;

    /* Z-index layers */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal: 400;
    --z-overlay: 500;
}

/* ========================================
   BASE RESET
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-dark);
    padding-bottom: 70px; /* Space for bottom nav */
    text-rendering: optimizeLegibility;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.fade-in { animation: fadeIn var(--ease-slow); }

/* ========================================
   BOTTOM NAVIGATION
   ======================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    background: var(--bg-primary);
    padding: var(--sp-sm) var(--sp-xs);
    box-shadow: var(--shadow-nav);
    z-index: var(--z-fixed);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.main-bottom-nav .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-xs);
    text-decoration: none;
    color: var(--text-light);
    padding: var(--sp-xs);
    width: 25%;
    font-size: var(--fs-base);
    transition: all var(--ease-base);
    border-radius: var(--radius-sm);
}

.main-bottom-nav .bottom-nav-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.main-bottom-nav .bottom-nav-item i {
    font-size: var(--fs-xl);
}

.main-bottom-nav .bottom-nav-item span {
    font-size: var(--fs-xs);
    font-weight: 500;
}

.main-bottom-nav .bottom-nav-item.active {
    color: var(--primary);
    font-weight: 600;
    background: var(--primary-light);
}

/* ========================================
   SERVICE GRID
   ======================================== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-sm);
    padding: var(--sp-lg);
    max-width: 1200px;
    margin: var(--sp-xl) auto 0;
    scroll-margin-top: 90px;
}

.service-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--sp-sm);
    padding: var(--sp-sm) var(--sp-xs);
    color: var(--text-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    min-height: 60px;
    text-align: center;
    text-decoration: none;
    transition: all var(--ease-base);
}

.service-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.service-item:active {
    transform: translateY(0);
}

.service-icon {
    font-size: var(--fs-3xl);
    color: var(--primary);
    transition: transform var(--ease-base);
}

.service-image-icon {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    width: 48px;
    height: 48px;
    object-fit: cover;
}

.service-item:hover .service-icon,
.service-item:hover .service-image-icon {
    transform: scale(1.1);
}

.service-text {
    font-size: 10px;
    line-height: 1.2;
    font-weight: 600;
}

/* ========================================
   FORM CONTAINER
   ======================================== */
.form-container:empty {
    display: none;
}

.booking-form {
    display: none;
    background: var(--bg-primary);
    padding: var(--sp-2xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 800px;
    margin: var(--sp-2xl) auto;
    border: 1px solid var(--border-light);
}

.booking-form.active-form {
    display: block;
    animation: fadeIn var(--ease-slow);
}

.booking-form h2 {
    color: var(--text-dark);
    margin-bottom: var(--sp-2xl);
    text-align: center;
    font-size: var(--fs-2xl);
    font-weight: 600;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: var(--sp-md);
    margin-bottom: var(--sp-lg);
}

.form-group {
    flex: 1;
    margin-bottom: var(--sp-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--sp-sm);
    color: var(--text-medium);
    font-weight: 500;
    font-size: var(--fs-md);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--sp-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--fs-lg);
    background: var(--bg-tertiary);
    transition: border-color var(--ease-base), box-shadow var(--ease-base);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-focus);
    outline: none;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-sm);
    padding: var(--sp-md) var(--sp-2xl);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--fs-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--ease-base);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 8px var(--primary-shadow);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px var(--primary-shadow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-block {
    width: 100%;
}

/* Legacy submit buttons */
.submit-button,
.search-button,
.account-button,
button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-sm);
    padding: var(--sp-md) var(--sp-2xl);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--fs-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--ease-base);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 8px var(--primary-shadow);
    width: 100%;
    margin-top: var(--sp-2xl);
}

.submit-button:hover,
.search-button:hover,
.account-button:hover,
button[type="submit"]:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* ========================================
   OFFERS SECTION
   ======================================== */
.offers-section {
    padding: var(--sp-lg) var(--sp-md);
    background: var(--bg-secondary);
    overflow-x: hidden;
    scroll-margin-top: 90px;
}

.offers-section-title {
    text-align: center;
    margin-bottom: var(--sp-lg);
    font-size: var(--fs-2xl);
    color: var(--text-dark);
    font-weight: 600;
}

/* Filter Tabs */
.filters-wrapper {
    position: relative;
    overflow: hidden;
    width: 100%;
    margin: 0 auto var(--sp-lg);
}

.filters-wrapper::before,
.filters-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    width: 40px;
    height: 100%;
    pointer-events: none;
    z-index: var(--z-dropdown);
}

.filters-wrapper::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-secondary) 15%, transparent);
}

.filters-wrapper::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-secondary) 15%, transparent);
}

.offer-filters {
    display: flex;
    overflow-x: auto;
    padding: var(--sp-sm);
    gap: var(--sp-sm);
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.offer-filters::-webkit-scrollbar {
    display: none;
}

.offer-filter {
    padding: var(--sp-sm) var(--sp-lg);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-light);
    font-size: var(--fs-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--ease-base);
    flex-shrink: 0;
}

.offer-filter:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.offer-filter.active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Offers Grid */
.offers-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-md);
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--sp-sm);
}

.offer-box {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--ease-base);
    border: 1px solid var(--border-light);
    position: relative;
}

.offer-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.offer-image {
    position: relative;
    height: 120px;
    overflow: hidden;
}

.offer-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--ease-slow);
}

.offer-box:hover .offer-image img {
    transform: scale(1.05);
}

.offer-tag {
    position: absolute;
    top: var(--sp-sm);
    right: var(--sp-sm);
    background: #ff5722;
    color: #fff;
    padding: var(--sp-xs) var(--sp-sm);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: var(--fs-xs);
    z-index: var(--z-dropdown);
}

.offer-content {
    padding: var(--sp-md);
}

.offer-content h3 {
    margin: 0 0 var(--sp-xs);
    color: var(--text-dark);
    font-size: var(--fs-base);
    font-weight: 600;
    line-height: 1.3;
}

.offer-content p {
    color: var(--text-light);
    margin-bottom: var(--sp-sm);
    font-size: var(--fs-xs);
    line-height: 1.4;
}

.offer-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #4285f4;
    color: #fff;
    padding: var(--sp-sm) var(--sp-lg);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: var(--fs-sm);
    transition: all var(--ease-base);
    border: none;
    cursor: pointer;
}

.offer-button:hover {
    background: #3367d6;
    transform: translateY(-1px);
}

.offer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--sp-md);
}

.price-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.original-price {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 0.9em;
    opacity: 0.7;
}

/* Favorite Button */
.favorite-button {
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--ease-base);
    color: var(--text-muted);
    font-size: var(--fs-lg);
}

.favorite-button:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.1);
}

.favorite-button.is-favorite {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ========================================
   OFFER DETAILS OVERLAY
   ======================================== */
.offer-details-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: var(--z-overlay);
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.offer-details-overlay.show {
    display: flex;
}

/* ========================================
   VIRTUAL SCROLL
   ======================================== */
.scroll-trigger-up,
.scroll-trigger-down {
    height: 1px;
    width: 100%;
    pointer-events: none;
    visibility: hidden;
}

.offer-page {
    display: contents;
}

.offers-container .scroll-trigger-up,
.offers-container .scroll-trigger-down {
    grid-column: 1 / -1;
}

/* ========================================
   SEARCH BAR (mobile, in-page)
   ======================================== */
.search-container-show {
    display: flex;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: 50px;
    position: relative;
    transition: all var(--ease-slow);
    padding: 12px 24px;
    box-shadow: var(--shadow-md);
    cursor: pointer;
}

.search-container-show:hover {
    border-color: var(--accent);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.search-input-show {
    flex: 1;
    padding: 0;
    border: none;
    outline: none;
    font-size: 1rem;
    background: transparent;
    color: var(--text-dark);
    cursor: pointer;
}

.search-input-show::placeholder {
    color: var(--text-muted);
}

/* ========================================
   FOOTER
   ======================================== */
.site-footer {
    background: var(--bg-primary);
    padding: var(--sp-2xl) var(--sp-lg);
    text-align: center;
    border-top: 1px solid var(--border-light);
    margin-bottom: 70px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-copyright {
    color: var(--text-muted);
    font-size: var(--fs-sm);
    margin-bottom: var(--sp-sm);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--sp-xl);
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-light);
    font-size: var(--fs-sm);
    transition: color var(--ease-base);
}

.footer-links a:hover {
    color: var(--primary);
}

/* ========================================
   RESPONSIVE: TABLETS (min-width: 600px)
   ======================================== */
@media (min-width: 600px) {
    .offers-container {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--sp-lg);
        padding: var(--sp-lg);
    }

    .services-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .service-text {
        font-size: var(--fs-xs);
    }

    .form-row {
        flex-direction: row;
        gap: var(--sp-lg);
    }

    .offer-content h3 {
        font-size: var(--fs-lg);
    }

    .offer-content p {
        font-size: var(--fs-sm);
    }
}

/* ========================================
   RESPONSIVE: DESKTOP (min-width: 769px)
   ======================================== */
@media (min-width: 769px) {
    .search-container-show {
        display: none;
    }

    .offers-container {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

    .offer-image {
        height: 140px;
    }

    .offer-content {
        padding: var(--sp-lg);
    }
}

/* ========================================
   RESPONSIVE: LARGE DESKTOP (min-width: 992px)
   ======================================== */
@media (min-width: 992px) {
    .services-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: var(--sp-md);
    }

    .service-text {
        font-size: var(--fs-base);
    }

    .service-icon {
        font-size: var(--fs-3xl);
    }
}

/* ========================================
   RESPONSIVE: EXTRA SMALL (max-width: 320px)
   ======================================== */
@media (max-width: 320px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .main-bottom-nav .bottom-nav-item i {
        font-size: var(--fs-sm);
    }

    .main-bottom-nav .bottom-nav-item span {
        font-size: 9px;
    }
}

/* ========================================
   PRINT
   ======================================== */
@media print {
    .bottom-nav,
    .offer-filters,
    .main-header,
    .sidebar,
    .sidebar-overlay,
    .search-overlay {
        display: none !important;
    }

    body {
        padding-bottom: 0;
        background: #fff;
    }
}

/* ========================================
   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;
    }
}

/* ========================================
   PERFORMANCE HINTS
   ======================================== */
.offer-image img,
.service-item,
.offer-box {
    will-change: transform;
}
