/* ============================================================
   BookEasyWash - Booking UI + Responsive rules
   ============================================================ */

/* ---------------- Booking page layout ---------------- */
.booking-layout {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 32px;
    align-items: flex-start;
}
/* Grid items default to min-width:auto, which lets wide intrinsic content
   (a native date input is the usual culprit) force the whole grid - and the
   page - wider than the viewport on narrow screens. Force them to shrink. */
.booking-layout > * { min-width: 0; }
.booking-steps { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 32px; }
.booking-step { border-bottom: 1px solid var(--border); padding-bottom: 28px; margin-bottom: 28px; }
.booking-step:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.booking-step__title { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.booking-step__title .num {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--plum); color: var(--gold-light);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem; flex-shrink: 0;
}
.booking-step__title h3 { margin: 0; font-size: 1.15rem; }

.service-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px; border: 1.5px solid var(--border); border-radius: var(--radius);
    margin-bottom: 14px; flex-wrap: wrap; gap: 12px;
}
.service-row__info strong { display: block; font-size: 1rem; }
.service-row__info span { font-size: 0.85rem; color: #7a6a70; }
.service-row__price { font-weight: 700; color: var(--gold); font-family: var(--font-body); font-size: 1.1rem; }

.qty-control { display: flex; align-items: center; gap: 0; border: 1.5px solid var(--border); border-radius: 50px; overflow: hidden; }
.qty-control button {
    width: 36px; height: 36px; border: none; background: var(--bg-light); color: var(--plum);
    font-size: 1.1rem; cursor: pointer; font-weight: 700;
}
.qty-control button:disabled { opacity: 0.4; cursor: not-allowed; }
.qty-control input {
    width: 44px; text-align: center; border: none; font-weight: 600; padding: 8px 0;
}

.slots-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 8px; }
.slot-card {
    border: 1.5px solid var(--border); border-radius: var(--radius);
    padding: 12px 10px; text-align: center; cursor: pointer; background: var(--white);
    transition: all 0.15s ease; font-size: 0.85rem;
}
.slot-card strong { display: block; font-size: 0.9rem; margin-bottom: 4px; }
.slot-card .slot-meta { font-size: 0.75rem; color: #7a6a70; }
.slot-card.selected { border-color: var(--plum); background: var(--bg-light); box-shadow: 0 0 0 2px var(--plum) inset; }
.slot-card.full { opacity: 0.45; cursor: not-allowed; background: #f4f4f4; }
.slot-card.full .slot-meta { color: var(--danger); font-weight: 600; }

.saved-address-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.saved-address-card {
    border: 1.5px solid var(--border); border-radius: var(--radius);
    padding: 14px 16px; cursor: pointer; background: var(--white);
    transition: all 0.15s ease;
}
.saved-address-card strong { display: block; color: var(--plum); font-size: 0.92rem; margin-bottom: 4px; }
.saved-address-card p { margin: 0; font-size: 0.8rem; color: #7a6a70; line-height: 1.4; }
.saved-address-card.selected { border-color: var(--plum); background: var(--bg-light); box-shadow: 0 0 0 2px var(--plum) inset; }
.saved-address-card--new { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; border-style: dashed; }
.saved-address-card--new strong { color: var(--gold); }

.order-summary-card {
    background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    padding: 26px; position: sticky; top: 100px;
}
.order-summary-card h3 { margin-bottom: 16px; }
.summary-line { display: flex; justify-content: space-between; padding: 8px 0; font-size: 0.92rem; border-bottom: 1px dashed var(--border); }
.summary-line.total { font-weight: 700; font-size: 1.15rem; color: var(--plum); border-bottom: none; border-top: 2px solid var(--border); margin-top: 8px; padding-top: 14px; }
.summary-line.discount { color: var(--success); }
.first-order-banner {
    background: var(--bg-light); border: 1px dashed var(--gold);
    border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; font-size: 0.85rem; color: var(--plum); font-weight: 600;
}

.mobile-summary-toggle { display: none; }

/* ---------------- Admin table -> card collapse handled in admin.css ---------------- */

/* ============================================================
   Breakpoints
   ============================================================ */
@media (max-width: 991px) {
    .hero__inner { grid-template-columns: 1fr; }
    .hero__media { order: -1; max-width: 420px; margin: 0 auto; }
    .services-grid { grid-template-columns: 1fr; }
    .benefits-grid { grid-template-columns: repeat(2, 1fr); }
    .steps-grid { grid-template-columns: repeat(2, 1fr); }
    .footer__grid { grid-template-columns: 1fr 1fr; }
    .booking-layout { grid-template-columns: 1fr; }
    .order-summary-card { position: static; }
}

/* Header nav collapses to the hamburger drawer earlier than the general
   mobile breakpoint below - with 8+ nav links plus the city switcher and
   Book Pickup button, tablet/small-laptop widths don't have room to keep
   everything on one line without squeezing. */
@media (max-width: 1150px) {
    .main-nav { display: none; }
    .hamburger { display: flex; }
    .btn-book-header { display: none; }
    .site-header__actions .user-icon-link { display: none; }
    .site-header__actions .city-switcher { display: none; }
}

@media (max-width: 767px) {
    /* Scale the whole rem-based type system down a notch - every font-size,
       most spacing and most component sizing in this project is defined in
       rem, so this one rule tightens text sitewide without having to touch
       every individual declaration. */
    html { font-size: 14px; }

    /* Headings that rely on the browser's default h1/h2/h3 size (no explicit
       font-size set anywhere) render quite large on a phone - give the whole
       scale an explicit, calmer size here. More specific rules below (like
       .hero h1) still win over this on their own pages. */
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.05rem; }

    .offer-bar { font-size: 0.74rem; padding: 8px 12px; }
    .section { padding: 36px 0; }
    .section-title { font-size: 1.4rem; }
    .section-subtitle { font-size: 0.88rem; margin-bottom: 24px; }
    .page-header { padding: 28px 0; }
    .page-header h1 { font-size: 1.45rem; }
    .page-header p { font-size: 0.9rem; }

    .hero { padding: 32px 0 40px; }
    .hero__badge { padding: 6px 13px; font-size: 0.7rem; margin-bottom: 14px; }
    .hero h1 { font-size: 1.6rem; margin-bottom: 12px; }
    .hero p.lead { font-size: 0.9rem; margin-bottom: 20px; }
    .hero__ctas { flex-direction: column; gap: 12px; margin-bottom: 24px; }
    .hero__ctas .btn { width: 100%; }
    .trust-row { justify-content: center; gap: 14px 18px; }
    .trust-item { font-size: 0.8rem; }

    .service-card { padding: 20px; }
    .service-card h3 { font-size: 1.1rem; }
    .benefits-grid { grid-template-columns: 1fr; gap: 14px; }
    .benefit-card { padding: 18px; }
    .benefit-card h3 { font-size: 0.98rem; }
    .benefit-card p { font-size: 0.84rem; }
    .steps-grid { grid-template-columns: 1fr; gap: 14px; }
    .step-card p { font-size: 0.84rem; }
    .footer__grid { grid-template-columns: 1fr; text-align: center; gap: 22px; }
    .form-row { grid-template-columns: 1fr; }
    .slots-grid { grid-template-columns: repeat(2, 1fr); }
    .price-highlight { padding: 32px 20px; }
    .price-highlight h2 { font-size: 1.15rem; }
    .price-highlight .big-price { font-size: 2rem; }

    .btn { font-size: 0.86rem; padding: 12px 24px; }
    .btn-lg { padding: 13px 24px; font-size: 0.92rem; }
    .btn-sm { font-size: 0.78rem; padding: 7px 14px; }

    .card { padding: 16px; }
    .card h2 { font-size: 1.15rem; }
    .auth-card { padding: 26px 20px; }
    .auth-card h1 { font-size: 1.3rem; }
    .auth-card__subtitle { font-size: 0.82rem; margin-bottom: 22px; }
    label { font-size: 0.82rem; }

    /* Header account menu + hamburger drawer text - keep this compact and
       consistent, this is the "Sign In / Sign Up" surface on mobile. */
    .mobile-nav__links a { font-size: 1.08rem; padding: 13px 14px; }
    .mobile-nav__header { padding: 16px 18px; }
    .mobile-nav__header .brand__name { font-size: 1.15rem; }
    .mobile-nav__greeting { font-size: 1rem; }
    .user-menu__name { font-size: 0.92rem; }
    .user-menu__dropdown a { font-size: 0.95rem; padding: 10px 12px; }
    .mobile-nav__body { padding: 16px 18px; }

    /* Keep form fields at 16px+ regardless of the root font-size scale above -
       anything smaller triggers iOS Safari's auto-zoom-on-focus, which feels
       broken on exactly the mobile-majority audience this is tuned for. */
    input[type=text], input[type=tel], input[type=email], input[type=number],
    input[type=date], input[type=password], select, textarea,
    .auth-card input[type=text], .auth-card input[type=tel],
    .auth-card input[type=email], .auth-card input[type=password] {
        font-size: 16px;
    }

    .faq-question { padding: 13px 15px; font-size: 0.88rem; }
    .faq-answer { padding: 0 15px; font-size: 0.85rem; }
    .service-card__icon, .step-card__num { width: 42px; height: 42px; font-size: 1rem; }
    .price-highlight .badge-first { padding: 10px 16px; font-size: 0.85rem; }

    .sticky-book-bar {
        display: block;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        background: var(--white);
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
        z-index: 140;
    }
    body { padding-bottom: 78px; }
    .whatsapp-float { bottom: 96px; right: 16px; width: 50px; height: 50px; }
    .booking-steps { padding: 16px; }
    .booking-step { padding-bottom: 20px; margin-bottom: 20px; }
    body.has-mobile-summary { padding-bottom: 150px; }
}

@media (max-width: 430px) {
    html { font-size: 13px; }
    .container { padding: 0 16px; }
    .hero h1 { font-size: 1.5rem; }
    .slots-grid { grid-template-columns: repeat(2, 1fr); }
    .price-highlight { padding: 28px 16px; }
    .auth-card { padding: 22px 16px; }
}

/* Hide desktop book button + sticky bar on pages where not needed */
.no-sticky-book .sticky-book-bar { display: none !important; }
