/* Barani Enterprises - global layout polish
   Purpose: consistent section rhythm, no orphan grid rows / blank tracks,
   balanced card widths and aligned card content across every page. */

:root { --sec-pad-y: 3.5rem; --sec-pad-x: 1.5rem; --wrap: 1200px; }

html { scroll-behavior: smooth; }
body { overflow-x: hidden; }

/* ---------- Section rhythm ---------- */
section { padding-top: var(--sec-pad-y) !important; padding-bottom: var(--sec-pad-y) !important; }
section[id] { scroll-margin-top: 90px; }
section > .container,
section > div { margin-left: auto; margin-right: auto; }
section:last-of-type { padding-bottom: var(--sec-pad-y) !important; }

/* Heroes keep a slightly larger top rhythm but never a fixed viewport height */
.hero, .phero, .hero-service { min-height: auto !important; padding-top: 3.75rem !important; padding-bottom: 3rem !important; }

/* Kill stray large vertical margins that create blank bands */
h1, h2, h3 { margin-top: 0; }
h2 { margin-bottom: 0.75rem; }
p:last-child { margin-bottom: 0; }
.section-header, .sec-head, .shead { margin-bottom: 2.25rem !important; }

/* ---------- Grids -> centered wrapping flex (removes orphan blank tracks) ---------- */
.card-grid, .service-grid, .branch-grid, .why-grid, .cat-grid,
.steps, .tgrid, .services-grid, .locations-grid, .features-grid,
.gallery-grid, .flex-grid, .footer-content {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    max-width: var(--wrap);
    margin-left: auto;
    margin-right: auto;
}

.card-grid > *      { flex: 1 1 260px; max-width: 340px; }
.service-grid > *   { flex: 1 1 300px; max-width: 380px; }
.branch-grid > *    { flex: 1 1 210px; max-width: 300px; }
.why-grid > *       { flex: 1 1 290px; max-width: 360px; }
.cat-grid > *       { flex: 1 1 300px; max-width: 380px; }
.steps > *          { flex: 1 1 230px; max-width: 300px; }
.tgrid > *          { flex: 1 1 300px; max-width: 360px; }
.services-grid > *  { flex: 1 1 300px; max-width: 380px; }
.locations-grid > * { flex: 1 1 300px; max-width: 380px; }
.features-grid > *  { flex: 1 1 320px; max-width: 400px; }
.gallery-grid > *   { flex: 1 1 420px; max-width: 620px; }
.flex-grid > *      { flex: 1 1 280px; max-width: 380px; }

/* Inline auto-fit grids inside content blocks */
section div[style*="auto-fit"], section div[style*="auto-fill"] {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}
section div[style*="auto-fit"] > *, section div[style*="auto-fill"] > * {
    flex: 1 1 260px;
    max-width: 380px;
}

/* Cards: even heights, content aligned to top, actions pinned to bottom */
.card-grid > *, .service-grid > *, .why-grid > *, .cat-grid > *,
.services-grid > *, .locations-grid > *, .features-grid > * {
    display: flex;
    flex-direction: column;
}
.card-grid > * > :last-child,
.locations-grid > * > :last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */
.footer-content { align-items: flex-start; gap: 2rem !important; text-align: left; justify-content: space-between; max-width: 1200px; }
.footer-content > * { flex: 1 1 200px; max-width: 300px; }
footer { padding-top: 3rem !important; padding-bottom: 1.5rem !important; }

/* ---------- FAQ ---------- */
.faq-list { max-width: 900px; margin: 0 auto; }
.faq-list > * + * { margin-top: 0.75rem; }

/* ---------- Media / chips ---------- */
img, iframe, video { max-width: 100%; }
.chips, .chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
    :root { --sec-pad-y: 3rem; }
    .gallery-grid > * { flex: 1 1 320px; max-width: 520px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
    :root { --sec-pad-y: 2.5rem; --sec-pad-x: 1.1rem; }
    section { padding-left: var(--sec-pad-x) !important; padding-right: var(--sec-pad-x) !important; }
    .hero, .phero, .hero-service { padding: 2.75rem 1.1rem 2.25rem !important; }
    h1 { font-size: clamp(1.6rem, 7vw, 2.1rem) !important; line-height: 1.2 !important; }
    h2 { font-size: clamp(1.35rem, 5.6vw, 1.7rem) !important; line-height: 1.25 !important; }
    h3 { font-size: 1.1rem !important; }
    p, li { font-size: 0.95rem; line-height: 1.6; }
    .card-grid, .service-grid, .branch-grid, .why-grid, .cat-grid,
    .steps, .tgrid, .services-grid, .locations-grid, .features-grid,
    .gallery-grid, .flex-grid, .footer-content { gap: 1rem !important; }
    .card-grid > *, .service-grid > *, .branch-grid > *, .why-grid > *,
    .cat-grid > *, .steps > *, .tgrid > *, .services-grid > *,
    .locations-grid > *, .features-grid > *, .gallery-grid > *,
    .flex-grid > *, .footer-content > *,
    section div[style*="auto-fit"] > *, section div[style*="auto-fill"] > * {
        flex: 1 1 100%;
        max-width: 100%;
    }
    .footer-content { text-align: center; }
    .footer-content > * { max-width: 100%; }
    .section-header, .sec-head, .shead { margin-bottom: 1.5rem !important; }
    /* keep floating buttons clear of content */
    body { padding-bottom: 0; }
}

/* ---------- Navigation ---------- */
nav { gap: 1rem; }
.nav-links { gap: 1rem !important; flex-wrap: nowrap; }
.nav-links a { white-space: nowrap; font-size: 0.88rem !important; }
@media (max-width: 1150px) {
    .nav-links { display: none !important; }
    #menuBtn { display: block !important; }
}
.mobile-menu a { padding: 0.7rem 0 !important; }

/* ---------- Hero balance ---------- */
.hero-content, .hero > .container { align-items: center; }
.hero { padding-bottom: 2.5rem !important; }
.hero-stats { margin-bottom: 0 !important; }

/* ---------- Mobile overflow guards ---------- */
@media (max-width: 768px) {
    .hero-content, .contact-container, .hero > div { max-width: 100%; }
    .hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 0.6rem !important; }
    .hero-stats > * { min-width: 0; padding: 0.75rem 0.4rem !important; }
    .stat-number { font-size: 1.5rem !important; }
    .hero-stats .stat-label, .hero-stats > * > :last-child { font-size: 0.68rem !important; letter-spacing: 0.5px; line-height: 1.3; }
    .hero-text h1 { font-size: clamp(1.6rem, 7vw, 2.1rem) !important; }
    section > *, .hero-content > * { min-width: 0; }
    [style*="grid-template-columns:repeat(2,1fr)"], [style*="grid-template-columns: repeat(2, 1fr)"] { grid-template-columns: 1fr !important; }
    .btn-group, .hero-buttons { flex-wrap: wrap; justify-content: center; }
}

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 0.6rem 0.9rem; vertical-align: middle; }
table th:last-child, table td:last-child { text-align: right; white-space: nowrap; }
.table-wrap, .table-scroll { overflow-x: auto; }
@media (max-width: 640px) {
    table th, table td { padding: 0.5rem 0.55rem; font-size: 0.85rem; }
}

/* ---------- Sticky mobile action bar ---------- */
.mbar { display: none; }
@media (max-width: 768px) {
    .mbar {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 10000;
        background: #0A0E27; border-top: 1px solid rgba(255,255,255,.12);
        box-shadow: 0 -6px 20px rgba(0,0,0,.25);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .mbar a {
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 2px; padding: .65rem .25rem; min-height: 56px;
        color: #fff; text-decoration: none; font-weight: 700; font-size: .8rem;
        border-right: 1px solid rgba(255,255,255,.12);
    }
    .mbar a:last-child { border-right: 0; }
    .mbar a span { font-size: 1.15rem; line-height: 1; }
    .mbar-wa { background: #25D366; color: #062e17 !important; }
    body { padding-bottom: 62px !important; }
    /* floating stack must clear the bar */
    .float-stack { bottom: 74px !important; }
    /* mobile simplicity: no motion */
    [data-reveal] { opacity: 1 !important; transform: none !important; }
    * { animation: none !important; transition-duration: .15s !important; }
}

/* ---------- Product price & availability block ---------- */
.enq-sec { background: linear-gradient(135deg,#0A0E27 0%,#1D3557 100%); padding: 2.5rem 1.5rem; }
.enq-in { max-width: 1000px; margin: 0 auto; }
.enq-in h2 { color: #fff; font-size: 2rem; margin-bottom: 1.25rem; }
.enq-facts { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0 0 1rem; }
.enq-facts > div { flex: 1 1 220px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: 12px; padding: .85rem 1rem; }
.enq-facts dt { color: #FFD700; font-size: .72rem; letter-spacing: 1px; text-transform: uppercase; font-weight: 700; margin-bottom: .25rem; }
.enq-facts dd { color: #fff; margin: 0; font-size: .98rem; font-weight: 600; }
.enq-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.25rem; }
.enq-chip { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); color: #fff; font-size: .82rem; font-weight: 700; padding: .3rem .7rem; border-radius: 999px; }
.enq-btns { display: flex; flex-wrap: wrap; gap: .7rem; }
.enq-wa, .enq-bulk, .enq-call { text-decoration: none; font-weight: 800; padding: .95rem 1.5rem; border-radius: 10px; font-size: 1rem; }
.enq-wa { background: #25D366; color: #062e17; }
.enq-bulk { background: #fff; color: #0A0E27; }
.enq-call { background: transparent; border: 2px solid #fff; color: #fff; }
@media (max-width: 640px) {
    .enq-in h2 { font-size: 1.5rem; }
    .enq-wa, .enq-bulk, .enq-call { flex: 1 1 100%; text-align: center; }
}

/* ---------- Icon system (SVG sprite, replaces emoji) ---------- */
.ic {
    width: 1em; height: 1em;
    fill: none; stroke: currentColor;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    vertical-align: -0.14em; flex: 0 0 auto;
}
.ic-brand { fill: currentColor; stroke: none; }
.contact-icon .ic, .service-icon .ic, .feature-icon .ic { width: 1em; height: 1em; }
a .ic, button .ic, li .ic, p .ic, strong .ic { margin-right: 0.28em; }
.mbar a .ic { margin-right: 0; width: 1.2rem; height: 1.2rem; }

/* ---------- Navigation: grouped dropdown ---------- */
.nav-links { align-items: center; }
.nav-links > li { position: relative; list-style: none; }
.nav-sub-toggle {
    display: inline-flex; align-items: center; gap: 0.3rem;
    background: none; border: 0; cursor: pointer; padding: 0;
    font: inherit; font-size: 0.88rem; font-weight: 600;
    color: inherit; letter-spacing: inherit;
}
.nav-links > li.has-sub.active > .nav-sub-toggle,
.nav-links a.active { color: var(--primary); }
.ic-chev { width: 0.85em; height: 0.85em; transition: transform 0.2s ease; margin: 0; }
.nav-links > li.open .ic-chev { transform: rotate(180deg); }
.nav-sub {
    position: absolute; top: calc(100% + 0.85rem); left: -0.85rem;
    min-width: 230px; margin: 0; padding: 0.4rem;
    list-style: none; background: #fff;
    border: 1px solid rgba(10, 14, 39, 0.08); border-radius: 12px;
    box-shadow: 0 18px 40px -18px rgba(10, 14, 39, 0.45);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    z-index: 1200;
}
.nav-links > li.has-sub:hover .nav-sub,
.nav-links > li.has-sub:focus-within .nav-sub,
.nav-links > li.has-sub.open .nav-sub {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-sub::before { content: ""; position: absolute; top: -0.85rem; left: 0; right: 0; height: 0.85rem; }
.nav-sub a {
    display: block; padding: 0.6rem 0.75rem; border-radius: 8px;
    font-size: 0.9rem !important; color: var(--secondary); text-decoration: none;
}
.nav-sub a:hover, .nav-sub a:focus-visible { background: #F1FAEE; color: var(--primary); }
.nav-sub a::after { display: none !important; }

/* Mobile menu groups */
.mobile-menu .mm-head {
    margin: 0.9rem 0 0.1rem; font-size: 0.7rem; font-weight: 800;
    letter-spacing: 1.2px; text-transform: uppercase; color: #8892a6;
}
.mobile-menu .mm-head:first-child { margin-top: 0.2rem; }
.mobile-menu a.active { color: var(--primary); }

/* ---------- Hero legibility on the blue gradient ---------- */
.hero .stat-card { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.34); }
.hero .stat-number { color: #FFD700; }
.hero .stat-label { color: rgba(255, 255, 255, 0.95); font-weight: 600; }
.hero .hero-seg { color: #FFD700; }
.hero.hero-solo .hero-content { grid-template-columns: 1fr !important; max-width: 860px; }
.hero.hero-solo .hero-text p { color: rgba(255, 255, 255, 0.95); }

/* ---------- One floating CTA only (mobile bar covers small screens) ---------- */
@media (max-width: 768px) {
    .float-stack { display: none !important; }
}

/* ---------- Internal link strip ---------- */
.ilinks { background: #F1FAEE; }
.ilinks-in { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--sec-pad-x); }
.ilinks-in h2 { font-size: 1.15rem; letter-spacing: 0.5px; text-transform: uppercase; color: var(--secondary); }
.ilinks-in ul { display: flex; flex-wrap: wrap; gap: 0.6rem; list-style: none; margin: 0; padding: 0; }
.ilinks-in li { margin: 0; }
.ilinks-in a {
    display: inline-block; background: #fff; border: 1px solid rgba(29, 53, 87, 0.18);
    border-radius: 999px; padding: 0.5rem 1rem; font-size: 0.9rem; font-weight: 600;
    color: var(--secondary); text-decoration: none;
}
.ilinks-in a:hover { border-color: var(--primary); color: var(--primary); }

/* Internal link strip must stay legible on dark-themed product pages too */
section.ilinks { background: #F1FAEE !important; }
section.ilinks .ilinks-in h2 { color: #1D3557 !important; }
section.ilinks .ilinks-in a { color: #1D3557 !important; background: #fff !important; }
section.ilinks .ilinks-in a:hover { color: #E63946 !important; }
