/*
 * Washarevend Step 15 — Round 2
 * Replace your existing:
 * assets/css/global-effects.css
 *
 * This is a full replacement: it includes Round 1 + Round 2 refinements.
 */

/* =========================================================
   1. GLOBAL SAFETY
   ========================================================= */

html {
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
}

html,
body {
    width: 100%;
    max-width: 100%;
}

body {
    overflow-x: hidden;
}

body.wv-menu-open {
    overflow: hidden;
}

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
}

img {
    height: auto;
}

main,
section,
article,
div,
nav,
header,
footer {
    min-width: 0;
}

input,
select,
textarea,
button {
    font: inherit;
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

#washarevend-single-product {
    overflow: hidden;
}


/* =========================================================
   2. FIRST-SESSION LOADING SCREEN
   ========================================================= */

.wv-loading-screen {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(
            circle at 50% 45%,
            rgba(16, 185, 129, .13),
            transparent 34%
        ),
        #08111f;
    opacity: 1;
    transition:
        opacity .45s ease,
        visibility .45s ease;
}

html.wv-loading-first {
    overflow: hidden;
}

html.wv-loading-first .wv-loading-screen {
    display: flex;
}

.wv-loading-screen.is-leaving {
    opacity: 0;
    visibility: hidden;
}

.wv-loading-inner {
    width: min(340px, calc(100vw - 48px));
    text-align: center;
}

.wv-loading-logo {
    display: block;
    width: auto;
    height: 54px;
    margin: 0 auto 18px;
    object-fit: contain;
    animation: wvLoaderLogo 1.6s ease-in-out infinite;
}

.wv-loading-brand {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 1px;
    margin-bottom: 22px;
    color: #fff;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 28px;
    letter-spacing: .01em;
}

.wv-loading-brand strong {
    color: #10B981;
    font-weight: 700;
}

.wv-loading-brand span {
    font-weight: 600;
}

.wv-loading-track {
    position: relative;
    width: 180px;
    height: 2px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
}

.wv-loading-progress {
    position: absolute;
    inset: 0 auto 0 0;
    width: 45%;
    border-radius: inherit;
    background: #10B981;
    box-shadow: 0 0 16px rgba(16, 185, 129, .8);
    animation: wvLoaderProgress 1s ease-in-out infinite;
}

@keyframes wvLoaderLogo {
    0%,
    100% {
        transform: translateY(0) scale(1);
        opacity: .8;
    }

    50% {
        transform: translateY(-4px) scale(1.03);
        opacity: 1;
    }
}

@keyframes wvLoaderProgress {
    0% {
        left: -45%;
    }

    100% {
        left: 100%;
    }
}


/* =========================================================
   3. PAGE TRANSITION
   ========================================================= */

body > main,
body main:first-of-type {
    animation: wvPageEnter .42s ease both;
}

body.wv-page-leaving main {
    opacity: 0 !important;
    transform: translateY(-12px) !important;
    transition:
        opacity .18s ease,
        transform .18s ease !important;
}

@keyframes wvPageEnter {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================================
   4. CUSTOM CURSOR
   ========================================================= */

.wv-cursor-dot,
.wv-cursor-ring {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2147482990;
    pointer-events: none;
    border-radius: 999px;
    transform: translate3d(-100px, -100px, 0);
    will-change: transform;
}

@media (hover: hover) and (pointer: fine) and (min-width: 1024px) {

    body.wv-custom-cursor,
    body.wv-custom-cursor a,
    body.wv-custom-cursor button,
    body.wv-custom-cursor input,
    body.wv-custom-cursor select,
    body.wv-custom-cursor textarea,
    body.wv-custom-cursor [role="button"] {
        cursor: none !important;
    }

    body.wv-custom-cursor #wpadminbar,
    body.wv-custom-cursor #wpadminbar * {
        cursor: auto !important;
    }

    .wv-cursor-dot,
    .wv-cursor-ring {
        display: block;
    }

    .wv-cursor-dot {
        width: 7px;
        height: 7px;
        background: #10B981;
        box-shadow: 0 0 12px rgba(16, 185, 129, .8);
    }

    .wv-cursor-ring {
        width: 34px;
        height: 34px;
        margin-top: -13.5px;
        margin-left: -13.5px;
        border: 1px solid rgba(16, 185, 129, .7);
        background: rgba(16, 185, 129, .035);
        transition:
            width .18s ease,
            height .18s ease,
            margin .18s ease,
            border-color .18s ease,
            background-color .18s ease,
            opacity .18s ease;
    }

    body.wv-cursor-hover .wv-cursor-ring {
        width: 52px;
        height: 52px;
        margin-top: -22.5px;
        margin-left: -22.5px;
        border-color: #10B981;
        background: rgba(16, 185, 129, .09);
    }

    body.wv-cursor-down .wv-cursor-ring {
        width: 28px;
        height: 28px;
        margin-top: -10.5px;
        margin-left: -10.5px;
    }

    body.wv-cursor-hidden .wv-cursor-dot,
    body.wv-cursor-hidden .wv-cursor-ring {
        opacity: 0;
    }
}


/* =========================================================
   5. HEADER / ADMIN BAR / STICKY FILTERS
   ========================================================= */

body.admin-bar #site-header {
    top: 32px;
}

body.admin-bar #projects-filter-bar,
body.admin-bar #products-filter-bar,
body.admin-bar #news-filter-bar {
    top: 112px;
}

#mobile-menu {
    max-height: calc(100dvh - 80px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

body.admin-bar #mobile-menu {
    max-height: calc(100dvh - 112px);
}


/* =========================================================
   6. ROUND 2 — HEADER LOGO + MOBILE DRAWER POLISH
   ========================================================= */

/*
 * The original logo.png has a very large transparent canvas.
 * Round 2 includes a tightly cropped logo-header.png.
 * After you change header.php to that file, these dimensions
 * produce a much more legible logo without changing the navbar height.
 */
#site-header .wv-header-logo {
    display: block;
    width: auto;
    height: 42px;
    max-width: 200px;
    object-fit: contain;
}


/* Mobile/tablet */
@media (max-width: 1023px) {

    html {
        scroll-padding-top: 88px;
    }

    #site-header > div:first-child {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    #site-header .wv-header-logo {
        width: auto !important;
        height: 40px !important;
        max-width: 180px !important;
    }

    /*
     * Make the drawer feel like an intentional mobile navigation
     * rather than a floating block ending mid-screen.
     */
    #mobile-menu {
        top: 80px;
        height: calc(100dvh - 80px);
        max-height: none;
        padding:
            10px
            0
            max(20px, env(safe-area-inset-bottom));
        background: #050505;
        box-shadow: 0 20px 48px rgba(0, 0, 0, .35);
    }

    body.admin-bar #mobile-menu {
        height: calc(100dvh - 112px);
        max-height: none;
    }

    #mobile-menu nav {
        display: flex;
        gap: 0 !important;
        padding: 8px 24px 28px !important;
    }

    #mobile-menu nav a {
        display: flex;
        align-items: center;
        min-height: 60px;
        padding: 12px 0;
        font-size: 16px;
        line-height: 1.35;
        border-bottom: 1px solid rgba(255, 255, 255, .08);
    }

    /*
     * Contact remains visually important on mobile,
     * but does not become an oversized full-width block.
     */
    #mobile-menu nav a:last-child {
        width: fit-content;
        min-height: 0;
        margin-top: 22px;
        padding: 12px 22px;
        border: 0;
        border-radius: 999px;
        background: #10B981;
        color: #06111d !important;
        font-weight: 700;
    }

    #washarevend-about section.min-h-\[60vh\],
    #washarevend-quality section.min-h-\[60vh\],
    #washarevend-solutions section.min-h-\[60vh\],
    #washarevend-projects section.min-h-\[60vh\],
    #washarevend-products section.min-h-\[60vh\],
    #washarevend-news section.min-h-\[60vh\],
    #washarevend-contact section.min-h-\[60vh\] {
        min-height: 48vh !important;
    }
}


@media (max-width: 782px) {

    body.admin-bar #site-header {
        top: 46px;
    }

    body.admin-bar #projects-filter-bar,
    body.admin-bar #products-filter-bar,
    body.admin-bar #news-filter-bar {
        top: 126px;
    }

    body.admin-bar #mobile-menu {
        height: calc(100dvh - 126px);
        max-height: none;
    }
}


@media (max-width: 767px) {

    html {
        scroll-padding-top: 84px;
    }

    h1,
    h2,
    h3,
    h4,
    p,
    a,
    li,
    span {
        overflow-wrap: anywhere;
    }

    #washarevend-home h1 {
        font-size: clamp(2.5rem, 12vw, 4rem) !important;
        line-height: 1.03 !important;
    }

    #washarevend-about h1,
    #washarevend-quality h1,
    #washarevend-solutions h1,
    #washarevend-projects h1,
    #washarevend-products h1,
    #washarevend-news h1,
    #washarevend-contact h1,
    #washarevend-single-product h1,
    #washarevend-single-news h1 {
        font-size: clamp(2.25rem, 10vw, 3.5rem) !important;
        line-height: 1.08 !important;
    }

    #washarevend-home section.h-screen {
        min-height: calc(100svh - 80px);
        height: auto !important;
        padding-top: 72px;
        padding-bottom: 84px;
    }

    #washarevend-home section,
    #washarevend-about section,
    #washarevend-quality section,
    #washarevend-solutions section,
    #washarevend-projects section,
    #washarevend-products section,
    #washarevend-news section,
    #washarevend-contact section,
    #washarevend-single-product section,
    #washarevend-single-news section {
        scroll-margin-top: 84px;
    }

    #projects-filter-bar,
    #products-filter-bar,
    #news-filter-bar {
        top: 80px;
    }

    #projects-filter-bar > div,
    #products-filter-bar > div,
    #news-filter-bar > div {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    .projects-filter-button,
    .products-filter-button,
    .news-filter-button {
        flex: 0 0 auto;
        min-height: 40px;
    }

    #washarevend-single-product .single-product-image img {
        min-height: 0 !important;
        max-height: 520px;
        object-fit: contain !important;
        background: #fff;
    }

    footer a,
    footer p,
    footer span {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    input,
    select,
    textarea {
        font-size: 16px !important;
    }

    a[class*="rounded-full"],
    button[class*="rounded-full"] {
        max-width: 100%;
    }
}


@media (max-width: 479px) {

    #site-header > div:first-child {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    #site-header .wv-header-logo {
        height: 36px !important;
        max-width: 160px !important;
    }

    #mobile-menu-button {
        font-size: 25px !important;
    }

    #mobile-menu nav {
        padding-left: 22px !important;
        padding-right: 22px !important;
    }

    #mobile-menu nav a {
        min-height: 56px;
    }

    .shadow-card,
    .shadow-card-hover {
        max-width: 100%;
    }

    #washarevend-single-product h1,
    #washarevend-single-news h1 {
        font-size: clamp(2rem, 10vw, 2.75rem) !important;
    }
}


/* =========================================================
   7. ACCESSIBILITY / REDUCED MOTION
   ========================================================= */

:focus-visible {
    outline: 2px solid #10B981;
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }

    .wv-cursor-dot,
    .wv-cursor-ring {
        display: none !important;
    }

    body {
        cursor: auto !important;
    }
}
