/* ============================================================
   GLOBAL.CSS — EcoBuild Studio
   Shared styles used across ALL pages:
   Section helpers, Preloader, Scroll Progress, Back-to-top,
   WhatsApp Float, Flash Message, Footer, Scroll Reveal
   ============================================================ */

/* ===================== SECTION HELPERS ===================== */
.section-py { padding-block: var(--section-py); }
.bg-alt      { background-color: var(--clr-bg-alt); }

/* Section Tag — small uppercase label above headings */
.section-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    text-transform: uppercase;
    letter-spacing: var(--ls-widest);
    color: var(--clr-primary);
    margin-bottom: var(--space-sm);
}
.section-tag::before,
.section-tag::after {
    content: '';
    display: inline-block;
    width: 24px;
    height: 1.5px;
    background: var(--clr-primary);
    flex-shrink: 0;
}

/* Section Title */
.section-title {
    font-family: var(--ff-heading);
    font-size: var(--fs-h2);
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    color: var(--clr-text);
    margin-bottom: var(--space-md);
}

/* Section Header wrapper */
.section-header {
    margin-bottom: var(--space-2xl);
}
.section-header.text-center .section-tag,
.section-header.text-center .section-title {
    display: block;
    text-align: center;
}
.section-header.text-center .section-tag {
    justify-content: center;
}

/* Page Banner (inner pages hero) */
.page-banner {
    position: relative;
    min-height: clamp(220px, 28vh, 380px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--clr-primary-dark);
    background-size: cover;
    background-position: center;
    padding-top: calc(var(--header-height) + var(--space-xl));
    padding-bottom: var(--space-xl);
    overflow: hidden;
}
.page-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(10, 40, 20, 0.72);
    z-index: 1;
}
.page-banner__content {
    position: relative;
    z-index: 2;
}
.page-banner__title {
    font-family: var(--ff-heading);
    font-size: clamp(2rem, 3vw + 1rem, 3.5rem);
    font-weight: var(--fw-bold);
    color: var(--clr-white);
    margin-bottom: var(--space-sm);
    line-height: var(--lh-tight);
}
.page-banner__subtitle {
    font-size: var(--fs-lg);
    color: rgba(255,255,255,0.75);
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-xs);
    justify-content: center;
    font-size: var(--fs-sm);
    margin-top: var(--space-sm);
}
.breadcrumb__item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    color: rgba(255,255,255,0.6);
}
.breadcrumb__item a {
    color: rgba(255,255,255,0.6);
    transition: color var(--dur-fast) ease;
}
.breadcrumb__item a:hover { color: var(--clr-white); }
.breadcrumb__item.active {
    color: var(--clr-white);
    font-weight: var(--fw-medium);
}
.breadcrumb__sep {
    color: rgba(255,255,255,0.3);
    font-size: 0.7em;
}

/* ===================== PRELOADER ===================== */
.preloader {
    position: fixed;
    inset: 0;
    background: var(--clr-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
.preloader.loaded,
.preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.preloader__spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--clr-border);
    border-top-color: var(--clr-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== SCROLL PROGRESS BAR ===================== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--clr-primary), var(--clr-secondary));
    z-index: calc(var(--z-sticky) + 10);
    transition: width 0.1s linear;
    pointer-events: none;
}

/* ===================== BACK TO TOP ===================== */
.back-to-top {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--clr-primary);
    color: var(--clr-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: var(--shadow-lg);
    z-index: var(--z-sticky);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--transition);
    cursor: pointer;
    border: none;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    background: var(--clr-primary-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

/* ===================== WHATSAPP FLOAT ===================== */
.whatsapp-float {
    position: fixed;
    bottom: calc(var(--space-lg) + 62px);
    right: var(--space-lg);
    width: 52px;
    height: 52px;
    border-radius: var(--radius-full);
    background: #25D366;
    color: var(--clr-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 4px 16px rgba(37,211,102,0.4);
    z-index: var(--z-sticky);
    transition: var(--transition);
    text-decoration: none;
}
.whatsapp-float:hover {
    transform: translateY(-3px) scale(1.06);
    box-shadow: 0 8px 24px rgba(37,211,102,0.5);
    color: var(--clr-white);
}

/* ===================== FLASH MESSAGE ===================== */
.flash-message {
    position: fixed;
    top: calc(var(--header-height) + var(--space-md));
    right: var(--space-md);
    z-index: var(--z-toast, 1100);
    min-width: 300px;
    max-width: 480px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    transition: opacity 0.3s ease;
}
.flash-message__content {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
}
.flash-message--success .flash-message__content { background: var(--clr-success); color: #fff; }
.flash-message--error   .flash-message__content { background: var(--clr-error);   color: #fff; }
.flash-message--warning .flash-message__content { background: var(--clr-warning); color: #fff; }
.flash-message--info    .flash-message__content { background: var(--clr-info);    color: #fff; }
.flash-message__close {
    margin-left: auto;
    font-size: 1.2rem;
    cursor: pointer;
    background: none;
    color: inherit;
    border: none;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity var(--dur-fast) ease;
}
.flash-message__close:hover { opacity: 1; }

/* ===================== FOOTER ===================== */
.footer {
    background: #0d1a10;
    color: rgba(255,255,255,0.75);
}

/* --- Newsletter Bar --- */
.footer__newsletter {
    background: var(--clr-primary);
    padding-block: var(--space-xl);
}
.newsletter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xl);
    flex-wrap: wrap;
}
.newsletter__content h3 {
    font-family: var(--ff-heading);
    font-size: var(--fs-h4);
    font-weight: var(--fw-bold);
    color: var(--clr-white);
    margin-bottom: var(--space-2xs);
}
.newsletter__content p {
    font-size: var(--fs-sm);
    color: rgba(255,255,255,0.8);
}
.newsletter__form .form-group {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.3);
    min-width: clamp(260px, 38vw, 460px);
}
.newsletter__input {
    flex: 1;
    padding: 0.75em 1.1em;
    background: rgba(255,255,255,0.15);
    color: var(--clr-white);
    font-size: var(--fs-sm);
    border: none;
    outline: none;
    min-width: 0;
}
.newsletter__input::placeholder { color: rgba(255,255,255,0.55); }
.newsletter__btn {
    border-radius: 0;
    background: rgba(255,255,255,0.2);
    color: var(--clr-white);
    border: none;
    padding: 0.75em 1.4em;
    font-weight: var(--fw-semibold);
    font-size: var(--fs-sm);
    white-space: nowrap;
    cursor: pointer;
    transition: background var(--dur-fast) ease;
}
.newsletter__btn:hover { background: rgba(255,255,255,0.35); }

/* --- Main Footer Body --- */
.footer__main {
    padding-block: var(--space-2xl);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.footer__grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
    gap: var(--space-2xl);
}

/* Brand column */
.footer__logo {
    display: block;
    margin-bottom: var(--space-md);
}
.footer__logo img {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1);
}
.footer__about {
    font-size: var(--fs-sm);
    color: rgba(255,255,255,0.5);
    line-height: var(--lh-relaxed);
    margin-bottom: var(--space-lg);
}
.footer__social {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
}
.social-link {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.6);
    font-size: 1rem;
    transition: var(--transition);
    text-decoration: none;
}
.social-link:hover {
    background: var(--clr-primary);
    border-color: var(--clr-primary);
    color: var(--clr-white);
    transform: translateY(-2px);
}

/* Link columns */
.footer__heading {
    font-family: var(--ff-body);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--clr-white);
    margin-bottom: var(--space-lg);
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
}
.footer__links {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}
.footer__links a {
    font-size: var(--fs-sm);
    color: rgba(255,255,255,0.5);
    display: inline-flex;
    align-items: center;
    transition: color var(--dur-fast) ease, padding-left var(--dur-fast) ease;
}
.footer__links a::before {
    content: '→';
    margin-right: 6px;
    font-size: 0.7em;
    opacity: 0;
    transform: translateX(-4px);
    transition: all var(--dur-fast) ease;
}
.footer__links a:hover {
    color: var(--clr-primary-light);
    padding-left: 4px;
}
.footer__links a:hover::before { opacity: 1; transform: translateX(0); }

/* Contact column */
.footer__contact {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}
.footer__contact li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    font-size: var(--fs-sm);
    color: rgba(255,255,255,0.55);
}
.footer__contact li i {
    color: var(--clr-primary-light);
    margin-top: 2px;
    flex-shrink: 0;
    font-size: 1rem;
    width: 16px;
    text-align: center;
}
.footer__contact a {
    color: rgba(255,255,255,0.55);
    transition: color var(--dur-fast) ease;
}
.footer__contact a:hover { color: var(--clr-primary-light); }
.footer__hours {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid rgba(255,255,255,0.06);
}
.footer__hours h5 {
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: var(--ls-wide);
    margin-bottom: var(--space-xs);
}
.footer__hours p {
    font-size: var(--fs-xs);
    color: rgba(255,255,255,0.45);
    line-height: var(--lh-normal);
}

/* --- Footer Bottom Bar --- */
.footer__bottom {
    padding-block: var(--space-lg);
}
.footer__bottom-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    flex-wrap: wrap;
}
.footer__copyright {
    font-size: var(--fs-xs);
    color: rgba(255,255,255,0.3);
}
.footer__bottom-links {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--fs-xs);
}
.footer__bottom-links a {
    color: rgba(255,255,255,0.35);
    transition: color var(--dur-fast) ease;
}
.footer__bottom-links a:hover { color: rgba(255,255,255,0.7); }
.footer__bottom-links span { color: rgba(255,255,255,0.15); }

/* ===================== SCROLL REVEAL ===================== */
[data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ===================== RESPONSIVE — GLOBAL ===================== */
@media (max-width: 1024px) {
    .footer__grid { grid-template-columns: 1fr 1fr; gap: var(--space-xl); }
    .newsletter { flex-direction: column; align-items: flex-start; gap: var(--space-lg); }
    .newsletter__form .form-group { min-width: min(100%, 460px); }
}

@media (max-width: 768px) {
    .footer__bottom-content { flex-direction: column; text-align: center; }
    .footer__bottom-links { justify-content: center; }
    .back-to-top { width: 42px; height: 42px; }
    .page-banner { min-height: clamp(180px, 24vh, 280px); }
}

@media (max-width: 576px) {
    .footer__grid { grid-template-columns: 1fr; gap: var(--space-xl); }
    .flash-message { min-width: calc(100vw - var(--space-lg) * 2); right: var(--space-sm); }
    .section-header { margin-bottom: var(--space-xl); }
}
