:root {
    --primary: #dd9933;
    --primary-light: #f3c178;
    --primary-dark: #b87b20;
    --secondary: #485da1;
    --dark: #1b1b1b;
    --light-gray: #f4f4f4;
    --white: #ffffff;
    --shadow: 0 10px 30px rgba(0,0,0,0.08);
    --berber-red: #ba4a4a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Paprika', sans-serif; line-height: 1.8; color: #555; background: var(--white); overflow-x: hidden; }
h1, h2, h3, h4, .font-merienda { font-family: 'Merienda', cursive; color: var(--dark); }
a { text-decoration: none; transition: 0.3s; }
ul { list-style: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 80px 20px; }
.text-center { text-align: center; }
.section-header { margin-bottom: 50px; text-align: center; }
.section-header h2 { font-size: 2.5rem; margin-bottom: 15px; position: relative; display: inline-block; }
.section-header h2::after { content: ''; width: 60%; height: 3px; background: var(--primary); position: absolute; bottom: -10px; left: 20%; }
.btn { display: inline-block; padding: 16px 35px; background: var(--primary); color: var(--white); border-radius: 50px; font-weight: 600; border: none; cursor: pointer; }
.btn:hover { background: var(--dark); transform: translateY(-3px); }

/* --- HEADER & NAV FIXES (UPDATED) --- */
header { 
    background: var(--white); 
    height: 80px; /* FIXED HEIGHT */
    padding: 0; /* REMOVE PADDING to allow links to fill height */
    position: sticky; 
    top: 0; 
    z-index: 9999; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); 
    display: flex;
    align-items: center;
}

.nav-flex { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    max-width: 1200px; 
    width: 100%;
    margin: 0 auto; 
    padding: 0 20px; 
    height: 100%; /* Fill header height */
}

.logo img { height: 50px; vertical-align: middle; }

.main-nav { height: 100%; }

.main-nav ul { 
    display: flex; 
    gap: 5px; /* Reduced gap, using padding on links instead */
    position: relative; 
    align-items: center; 
    height: 100%; 
    margin: 0;
}

.main-nav li {
    height: 100%;
    display: flex;
    align-items: center;
}

/* Top Level Links */
.main-nav > ul > li > a { 
    color: var(--dark); 
    font-weight: 600; 
    font-size: 0.9rem; 
    text-transform: uppercase; 
    height: 100%; /* Link fills the header height */
    display: flex;
    align-items: center;
    padding: 0 15px; /* Clickable area is larger */
    position: relative;
}

.main-nav > ul > li > a:hover { color: var(--primary); background-color: rgba(0,0,0,0.02); }

.has-dropdown { position: relative; }

/* Dropdown Menu */
.dropdown { 
    display: none; 
    position: absolute; 
    top: 100%; /* Aligns perfectly with bottom of header */
    left: 0; 
    background: #fff; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.15); 
    border-radius: 0 0 8px 8px; 
    border-top: 3px solid var(--primary);
    min-width: 220px; 
    flex-direction: column;
    padding: 10px 0;
    z-index: 10000;
    max-height: calc(100vh - 90px); /* Scroll if screen is too short */
    overflow-y: auto;
}

.main-nav ul li:hover > .dropdown { display: flex; animation: fadeIn 0.2s ease-in-out; }

.dropdown li { 
    padding: 0; 
    width: 100%; 
    height: auto; /* Reset height for dropdown items */
    display: block;
}

.dropdown a { 
    display: block; 
    padding: 12px 20px; 
    height: auto; /* Reset height for dropdown links */
    text-transform: none; 
    font-size: 0.95rem; 
    color: #555;
    transition: 0.2s;
    white-space: nowrap; 
}

.dropdown a:hover { background: #f9f9f9; color: var(--primary); padding-left: 25px; }

.hamburger { display: none; background: transparent; border: none; cursor: pointer; padding: 10px; }
.hamburger span { display: block; width: 26px; height: 3px; background: var(--dark); margin: 5px 0; border-radius: 3px; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- HERO & CONTENT --- */
.hero { 
    height: 85vh; 
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.3)), url('morocco_tours.webp');
    background-size: cover; 
    background-position: center;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    text-align: center; 
    color: var(--white);
}
.hero-content h1 { font-size: 3.5rem; color: var(--white); margin-bottom: 20px; text-shadow: 2px 2px 10px rgba(0,0,0,0.5); }
.hero-content p { font-size: 1.3rem; max-width: 800px; margin-bottom: 30px; }

.intro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.intro-text strong { color: var(--primary-dark); }

.features { background: var(--light-gray); display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; padding: 40px 0; }
.feature-card { background: var(--white); padding: 40px; border-radius: 20px; text-align: center; box-shadow: var(--shadow); }
.feature-card i { font-size: 2.5rem; color: var(--secondary); margin-bottom: 20px; display: block; }

.tour-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 30px; }
.tour-card { position: relative; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); background: var(--white); transition: 0.4s; }
.tour-card:hover { transform: translateY(-10px); }
.tour-img { height: 280px; background-size: cover; background-position: center; }
.tour-badge { position: absolute; top: 20px; right: 20px; background: var(--primary); color: var(--white); padding: 5px 15px; border-radius: 50px; font-weight: bold; font-size: 0.8rem; }
.tour-body { padding: 25px; }
.tour-body h3 { margin-bottom: 10px; font-size: 1.4rem; }

.best-tours-wrapper { background: #fdfdfd; padding: 100px 0; }
.best-tours-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.best-tour-item { 
    display: block; 
    background: #fff; 
    border-radius: 24px; 
    overflow: hidden; 
    box-shadow: 0 12px 24px rgba(0,0,0,0.06); 
    transition: 0.3s;
    border: 1px solid #eee;
}
.best-tour-item:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(221, 153, 51, 0.1); }
.best-tour-img { width: 100%; height: 260px; background-size: cover; background-position: center; position: relative; }
.best-tour-content { padding: 24px; }

.special-tag {
    position: absolute;
    top: 30px;
    left: 30px;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: #fff;
    z-index: 10;
}
.tag-popular { background: #ba4a4a; box-shadow: 0 4px 15px rgba(186, 74, 74, 0.4); }
.tag-budget { background: #4692e7; box-shadow: 0 4px 15px rgba(70, 146, 231, 0.4); }

.tour-meta { display: flex; gap: 20px; margin-bottom: 15px; font-size: 0.85rem; font-weight: bold; color: #dd9933; text-transform: uppercase; }
.best-tour-content h3 { font-size: 1.8rem; margin-bottom: 20px; line-height: 1.3; }
.best-tour-content p { font-size: 1rem; color: #666; margin-bottom: 25px; }

.tour-features { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 30px; }
.tour-features li { font-size: 0.9rem; list-style: none; display: flex; align-items: center; gap: 8px; color: #444; }
.tour-features li::before { content: '✔'; color: #dd9933; font-weight: bold; }

.booking-steps { display: flex; justify-content: space-around; flex-wrap: wrap; gap: 20px; margin-top: 40px; }
.step { flex: 1; min-width: 250px; text-align: center; position: relative; padding: 20px; }
.step-num { width: 60px; height: 60px; background: var(--secondary); color: var(--white); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; font-size: 1.5rem; font-weight: bold; box-shadow: 0 5px 15px rgba(72, 93, 161, 0.4); }

.testimonial-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.chat-bubble { background: var(--primary); color: var(--white); padding: 30px; border-radius: 25px; border-bottom-left-radius: 0; position: relative; margin-bottom: 20px; }
.chat-bubble::after { content: ''; position: absolute; bottom: -20px; left: 0; border-width: 20px 20px 0 0; border-style: solid; border-color: var(--primary) transparent; }
.author { font-weight: bold; color: var(--dark); display: block; margin-top: 10px; }
.rating { color: #ffe400; margin-bottom: 10px; }

footer { background: var(--dark); color: #aaa; padding: 80px 20px 20px; }
.footer-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 50px; }
.footer-col h4 { color: var(--white); margin-bottom: 25px; border-left: 3px solid var(--primary); padding-left: 15px; }
.footer-col ul li { margin-bottom: 12px; }
.footer-col a { color: #aaa; font-size: 0.9rem; }
.footer-col a:hover { color: var(--primary); }

@media (max-width: 992px) {
    .intro-grid { grid-template-columns: 1fr; }
    .best-tour-item { flex-direction: column !important; }
    .best-tour-img { width: 100%; height: 250px; }
    .hero-content h1 { font-size: 2.2rem; }
    .hamburger { display: block; }
    
    /* MOBILE NAV FIX (Resets the desktop specific heights) */
    header { height: auto; padding: 15px 0; }
    .nav-flex { height: auto; }
    .main-nav { 
        position: absolute; 
        top: 100%; 
        left: 0; 
        width: 100%;
        background: #fff; 
        box-shadow: 0 10px 20px rgba(0,0,0,0.1); 
        display: none; 
        max-height: 80vh;
        overflow-y: auto;
        height: auto; 
    }
    .main-nav.active { display: block; }
    .main-nav ul { flex-direction: column; gap: 0; padding: 0; width: 100%; align-items: flex-start; height: auto; }
    .main-nav li { width: 100%; border-bottom: 1px solid #eee; height: auto; display: block; }
    .main-nav > ul > li > a { display: block; padding: 15px 20px; height: auto; }

    /* MOBILE DROPDOWN FIX */
    .has-dropdown { flex-direction: column; align-items: flex-start; height: auto; }
    .dropdown {
        position: static;
        box-shadow: none;
        border-top: none;
        border-left: 4px solid var(--primary);
        background: #f9f9f9;
        width: 100%;
        padding: 0;
        display: none; 
        max-height: none; /* No scroll inside accordion */
    }
    .main-nav ul li:hover > .dropdown { display: flex; } 
    
    .best-tours-list { grid-template-columns: repeat(2, 1fr); }
    .best-tour-img { height: 220px; }
    .best-tour-content { padding: 20px; }
}
@media (max-width: 640px) {
    .best-tours-list { grid-template-columns: 1fr; }
    .best-tour-img { height: 200px; }
}

/* City Slider */
.city-slider-wrapper {
    overflow: hidden;
    position: relative;
    width: 100%;
    margin: 0;
    padding: 20px 0;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.city-slider-track {
    display: flex;
    gap: 20px;
    width: max-content;
    animation: scroll 30s linear infinite;
    cursor: grab;
}
.city-slider-track:active { cursor: grabbing; }
/* Pause on hover so users can click */
.city-slider-track:hover { animation-play-state: paused; }

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } /* Move half width since we duplicated content */
}

.city-btn {
    flex-shrink: 0;
    display: inline-block;
    padding: 12px 30px;
    background: var(--white);
    color: var(--dark);
    border: 1px solid #eee;
    border-radius: 50px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: 0.3s;
    user-select: none;
    -webkit-user-drag: none;
}
.city-btn:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(221, 153, 51, 0.3);
}

/* Admin Styles */
.admin-header { background:#f7f7f7; padding:15px; border-bottom:1px solid #eee; }
.admin-nav { display:flex; gap:12px; }
.table { width:100%; border-collapse: collapse; }
.table th, .table td { border-bottom:1px solid #eee; padding:10px; text-align:left; }
.card { background:#fff; border:1px solid #eee; border-radius:12px; box-shadow: var(--shadow); padding:20px; }

.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.admin-form-full { grid-column: span 2; }
.admin-input-group { margin-bottom: 15px; }
.admin-input-group label { display: block; margin-bottom: 8px; font-weight: bold; color: var(--dark); }
.admin-input-group input, .admin-input-group textarea { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 8px; font-family: inherit; }
.admin-input-group input:focus, .admin-input-group textarea:focus { border-color: var(--primary); outline: none; }
.admin-actions { margin-top: 20px; text-align: right; }
.admin-card-header { background: var(--light-gray); padding: 15px 20px; border-bottom: 1px solid #eee; border-radius: 12px 12px 0 0; margin: -20px -20px 20px -20px; font-weight: bold; font-size: 1.2rem; color: var(--primary-dark); }