/* =========================================================
   Tow Services Dubai — Stylesheet
   Mobile-first, responsive, accessible
   Palette: Yellow #FFC107 | Black #111111 | White | #F5F5F5
   ========================================================= */

/* ---------- CSS Variables ---------- */
:root {
    --yellow: #FFC107;
    --yellow-dark: #e0a800;
    --black: #111111;
    --white: #ffffff;
    --gray-bg: #f5f5f5;
    --gray-text: #555555;
    --gray-light: #e5e5e5;
    --whatsapp: #25D366;
    --whatsapp-dark: #1da851;

    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.16);

    --radius: 14px;
    --radius-pill: 50px;

    --container: 1200px;
    --header-h: 70px;

    --transition: 0.3s ease;
    --font: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Reset / Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 20px); /* offset sticky header on anchor jumps */
}

body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    color: var(--black);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

h1, h2, h3 { line-height: 1.2; font-weight: 700; }

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Accessibility: focus states ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--yellow);
    outline-offset: 3px;
    border-radius: 4px;
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 26px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
    white-space: nowrap;
}
.btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(-1px); }

.btn--primary { background: var(--yellow); color: var(--black); }
.btn--primary:hover { background: var(--yellow-dark); }

.btn--dark { background: var(--black); color: var(--white); }
.btn--dark:hover { background: #000; }

.btn--whatsapp { background: var(--whatsapp); color: var(--white); }
.btn--whatsapp:hover { background: var(--whatsapp-dark); }

.btn--sm { padding: 9px 18px; font-size: 0.85rem; }
.btn--lg { padding: 15px 34px; font-size: 1.02rem; }
.btn--block { width: 100%; }

/* =========================================================
   Page Loader
   ========================================================= */
.loader {
    position: fixed;
    inset: 0;
    background: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.loader--hidden { opacity: 0; visibility: hidden; }
.loader__spinner {
    width: 54px;
    height: 54px;
    border: 5px solid rgba(255, 193, 7, 0.25);
    border-top-color: var(--yellow);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   Top Info Bar
   ========================================================= */
.topbar {
    background: var(--black);
    color: #ddd;
    font-size: 0.8rem;
    padding: 7px 0;
}
.topbar__inner {
    display: flex;
    justify-content: center;
    gap: 26px;
    flex-wrap: wrap;
}
.topbar__item i { color: var(--yellow); margin-right: 5px; }

/* =========================================================
   Sticky Header / Navigation
   ========================================================= */
.header {
    position: sticky;
    top: 0;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: box-shadow var(--transition), padding var(--transition);
}
.header--scrolled { box-shadow: var(--shadow-md); }

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
}

/* Logo */
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; }
.logo__icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    background: var(--yellow);
    color: var(--black);
    border-radius: 10px;
    font-size: 1.1rem;
}
.logo__text span { color: var(--yellow); }
.logo--light .logo__text { color: var(--white); }
.logo--light .logo__text span { color: var(--yellow); }

/* Nav menu */
.nav-menu { display: flex; align-items: center; gap: 28px; }
.nav-link {
    position: relative;
    font-weight: 500;
    padding: 6px 0;
    transition: color var(--transition);
}
.nav-link::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    width: 0; height: 3px;
    background: var(--yellow);
    border-radius: 3px;
    transition: width var(--transition);
}
.nav-link:hover,
.nav-link.active { color: var(--yellow-dark); }
.nav-link:hover::after,
.nav-link.active::after { width: 100%; }

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}
.hamburger span {
    width: 26px;
    height: 3px;
    background: var(--black);
    border-radius: 3px;
    transition: transform var(--transition), opacity var(--transition);
}
.hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* =========================================================
   Hero Section
   ========================================================= */
.hero {
    position: relative;
    min-height: calc(100vh - var(--header-h));
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--white);
    background: url('https://images.unsplash.com/photo-1562920618-5e3d5c8f7c5c?auto=format&fit=crop&w=1600&q=80') center/cover no-repeat fixed;
    padding: 80px 0;
}
.hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(17,17,17,0.82) 0%, rgba(17,17,17,0.72) 100%);
}
.hero__content { position: relative; max-width: 820px; }

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid var(--yellow);
    color: var(--yellow);
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 22px;
}
.hero__title {
    font-size: clamp(2rem, 6vw, 3.6rem);
    font-weight: 800;
    margin-bottom: 20px;
}
.hero__subtitle {
    font-size: clamp(1rem, 2.2vw, 1.2rem);
    font-weight: 300;
    max-width: 680px;
    margin: 0 auto 34px;
    color: #eee;
}
.hero__buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 50px;
}
.hero__stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}
.hero__stats li { display: flex; flex-direction: column; }
.hero__stats strong { font-size: 2rem; color: var(--yellow); font-weight: 700; }
.hero__stats span { font-size: 0.85rem; color: #ddd; }

.hero__scroll {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--yellow);
    font-size: 1.3rem;
    animation: bounce 1.8s infinite;
    z-index: 2;
}
@keyframes bounce {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, 10px); }
}

/* =========================================================
   Generic Section Styles
   ========================================================= */
.section { padding: 90px 0; }
.section--alt { background: var(--gray-bg); }
.section--dark { background: var(--black); color: var(--white); }

.section__head {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 55px;
}
.section__head h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); margin-bottom: 14px; }
.section__head p { color: var(--gray-text); }

.eyebrow {
    display: inline-block;
    color: var(--yellow-dark);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 10px;
}
.eyebrow--light { color: var(--yellow); }
.section--dark .section__head h2 { color: var(--white); }

/* =========================================================
   About Section
   ========================================================= */
.about__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 50px;
    align-items: center;
}
.about__image { position: relative; }
.about__image img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    object-fit: cover;
}
.about__badge {
    position: absolute;
    bottom: -20px;
    left: 20px;
    background: var(--white);
    color: var(--black);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}
.about__badge i { color: var(--yellow-dark); font-size: 1.7rem; }
.about__badge strong { display: block; font-size: 0.95rem; }
.about__badge span { font-size: 0.8rem; color: var(--gray-text); }

.about__text h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin-bottom: 18px; }
.about__text p { color: var(--gray-text); margin-bottom: 22px; }
.about__list { margin-bottom: 28px; display: grid; gap: 12px; }
.about__list li { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.about__list i { color: var(--yellow-dark); font-size: 1.1rem; }

/* =========================================================
   Services — Cards
   ========================================================= */
.services__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 26px;
}
.card {
    background: var(--white);
    padding: 34px 28px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-light);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    position: relative;
    overflow: hidden;
}
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 4px;
    background: var(--yellow);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition);
}
.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--yellow);
}
.card:hover::before { transform: scaleX(1); }
.card__icon {
    display: grid;
    place-items: center;
    width: 66px;
    height: 66px;
    background: rgba(255, 193, 7, 0.15);
    color: var(--yellow-dark);
    font-size: 1.7rem;
    border-radius: 16px;
    margin-bottom: 20px;
    transition: background var(--transition), color var(--transition), transform var(--transition);
}
.card:hover .card__icon {
    background: var(--yellow);
    color: var(--black);
    transform: rotate(-6deg) scale(1.05);
}
.card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.card p { color: var(--gray-text); font-size: 0.95rem; }

/* =========================================================
   Why Choose Us — Feature boxes
   ========================================================= */
.why__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.feature {
    background: var(--white);
    text-align: center;
    padding: 30px 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-light);
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.feature i {
    font-size: 2rem;
    color: var(--yellow-dark);
    margin-bottom: 14px;
    transition: transform var(--transition);
}
.feature h3 { font-size: 1rem; font-weight: 600; }
.feature:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    background: var(--black);
}
.feature:hover h3 { color: var(--white); }
.feature:hover i { color: var(--yellow); transform: scale(1.15); }

/* =========================================================
   Service Area (dark)
   ========================================================= */
.area__inner {
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}
.area__inner h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin-bottom: 16px; }
.area__inner p { color: #cfcfcf; margin-bottom: 30px; }

/* =========================================================
   Contact Section
   ========================================================= */
.contact__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 45px;
}
.contact__list { display: grid; gap: 22px; margin-bottom: 30px; }
.contact__list li { display: flex; align-items: flex-start; gap: 16px; }
.contact__ico {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 50px; height: 50px;
    background: var(--yellow);
    color: var(--black);
    border-radius: 12px;
    font-size: 1.2rem;
}
.contact__list strong { display: block; font-size: 1rem; }
.contact__list span,
.contact__list a { color: var(--gray-text); font-size: 0.95rem; word-break: break-word; }
.contact__list a:hover { color: var(--yellow-dark); }

.contact__buttons { display: flex; flex-wrap: wrap; gap: 12px; }

/* Contact form */
.contact__form {
    background: var(--white);
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-light);
}
.field { margin-bottom: 20px; }
.field label {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 7px;
}
.field input,
.field textarea {
    width: 100%;
    padding: 13px 16px;
    font-family: inherit;
    font-size: 0.95rem;
    border: 1.5px solid var(--gray-light);
    border-radius: 10px;
    background: var(--gray-bg);
    transition: border-color var(--transition), background var(--transition);
    resize: vertical;
}
.field input:focus,
.field textarea:focus {
    border-color: var(--yellow);
    background: var(--white);
    outline: none;
}
.field input.invalid,
.field textarea.invalid { border-color: #e63946; background: #fdf0f1; }
.field__error {
    display: block;
    color: #e63946;
    font-size: 0.8rem;
    margin-top: 5px;
    min-height: 1em;
}
.form__success {
    margin-top: 16px;
    padding: 14px 18px;
    background: rgba(37, 211, 102, 0.12);
    border: 1px solid var(--whatsapp);
    color: var(--whatsapp-dark);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
}
.form__success i { margin-right: 6px; }

/* Map */
.contact__map {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    line-height: 0;
}
.contact__map iframe { display: block; width: 100%; }

/* =========================================================
   Footer
   ========================================================= */
.footer { background: #0d0d0d; color: #bbb; padding-top: 60px; }
.footer__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 36px;
    padding-bottom: 40px;
}
.footer__col h3 {
    color: var(--white);
    font-size: 1.1rem;
    margin-bottom: 18px;
    position: relative;
    padding-bottom: 10px;
}
.footer__col h3::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    width: 40px; height: 3px;
    background: var(--yellow);
    border-radius: 3px;
}
.footer__col > p { font-size: 0.92rem; margin: 16px 0; }
.footer__hours i { color: var(--yellow); margin-right: 6px; }

.footer__links li,
.footer__contact li { margin-bottom: 12px; }
.footer__links a:hover,
.footer__contact a:hover { color: var(--yellow); padding-left: 4px; transition: var(--transition); }
.footer__contact i { color: var(--yellow); margin-right: 8px; width: 16px; }

.footer__social { display: flex; gap: 12px; margin-top: 18px; }
.footer__social a {
    display: grid;
    place-items: center;
    width: 42px; height: 42px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    color: var(--white);
    transition: background var(--transition), transform var(--transition);
}
.footer__social a:hover { background: var(--yellow); color: var(--black); transform: translateY(-3px); }

.footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 22px 0;
    text-align: center;
    font-size: 0.85rem;
}
.footer__credit { margin-top: 6px; font-size: 0.82rem; color: #999; }
.footer__credit a { color: var(--yellow); font-weight: 500; transition: color var(--transition); }
.footer__credit a:hover { color: var(--yellow-dark); text-decoration: underline; }

/* =========================================================
   Floating Buttons (WhatsApp + Call)
   ========================================================= */
.floats {
    position: fixed;
    right: 18px;
    bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 900;
}
.float {
    display: grid;
    place-items: center;
    width: 56px; height: 56px;
    border-radius: 50%;
    color: var(--white);
    font-size: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition);
}
.float:hover { transform: scale(1.1); }
.float--whatsapp { background: var(--whatsapp); animation: pulse 2s infinite; }
.float--call { background: var(--yellow); color: var(--black); }
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
    70% { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* =========================================================
   Back To Top
   ========================================================= */
.back-to-top {
    position: fixed;
    left: 18px;
    bottom: 18px;
    width: 48px; height: 48px;
    background: var(--black);
    color: var(--yellow);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity var(--transition), visibility var(--transition), transform var(--transition), background var(--transition);
    z-index: 900;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--yellow); color: var(--black); }

/* =========================================================
   Scroll Reveal Animations (Intersection Observer)
   ========================================================= */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
    will-change: opacity, transform;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Stagger cards/features slightly for a premium feel */
.services__grid .reveal:nth-child(2),
.why__grid .reveal:nth-child(2) { transition-delay: 0.05s; }
.services__grid .reveal:nth-child(3),
.why__grid .reveal:nth-child(3) { transition-delay: 0.10s; }
.services__grid .reveal:nth-child(4),
.why__grid .reveal:nth-child(4) { transition-delay: 0.15s; }
.services__grid .reveal:nth-child(5),
.why__grid .reveal:nth-child(5) { transition-delay: 0.20s; }
.services__grid .reveal:nth-child(6),
.why__grid .reveal:nth-child(6) { transition-delay: 0.25s; }

/* =========================================================
   RESPONSIVE — Tablet (>=768px)
   ========================================================= */
@media (min-width: 768px) {
    .about__grid { grid-template-columns: 1fr 1fr; }
    .services__grid { grid-template-columns: repeat(2, 1fr); }
    .why__grid { grid-template-columns: repeat(4, 1fr); }
    .contact__grid { grid-template-columns: 1fr 1fr; align-items: start; }
    .footer__grid { grid-template-columns: 2fr 1fr 1.5fr; }
    .hero { background-attachment: fixed; }
}

/* =========================================================
   RESPONSIVE — Desktop (>=992px)
   ========================================================= */
@media (min-width: 992px) {
    .services__grid { grid-template-columns: repeat(3, 1fr); }
}

/* =========================================================
   RESPONSIVE — Mobile Navigation (<768px)
   ========================================================= */
@media (max-width: 767px) {
    .hamburger { display: flex; }

    .nav-menu {
        position: fixed;
        top: var(--header-h);
        right: 0;
        width: min(78%, 320px);
        height: calc(100vh - var(--header-h));
        background: var(--white);
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 30px 26px;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
        transform: translateX(100%);
        transition: transform var(--transition);
        overflow-y: auto;
    }
    .nav-menu.active { transform: translateX(0); }
    .nav-menu li { width: 100%; }
    .nav-link { display: block; padding: 12px 0; width: 100%; border-bottom: 1px solid var(--gray-light); }
    .nav-link::after { display: none; }
    .nav-cta { margin-top: 14px; }
    .nav-cta .btn { width: 100%; }

    /* Disable fixed background on mobile for performance/jank */
    .hero { background-attachment: scroll; }

    .topbar__item--hide { display: none; }
    .hero__stats { gap: 26px; }
    .section { padding: 64px 0; }
    .contact__form { padding: 24px; }
    .floats { right: 14px; bottom: 14px; }
    .float { width: 52px; height: 52px; font-size: 1.35rem; }
}

/* =========================================================
   Very small screens (<=360px)
   ========================================================= */
@media (max-width: 360px) {
    .hero__buttons .btn { width: 100%; }
    .hero__stats strong { font-size: 1.6rem; }
    .contact__buttons .btn { width: 100%; }
}

/* =========================================================
   Reduced Motion — respect user preference
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
    .reveal { opacity: 1; transform: none; }
}
