/* GM Starter — Custom Styles */
/* Site de prezentare — FĂRĂ WooCommerce */
/* R_CSS_NATIVE: Folosește EXCLUSIV selectori WP FSE nativi — fără clase inventate */

/* === 1. VARIABILE + RESET === */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

img {
    max-width: 100%;
    height: auto;
}

::selection {
    background-color: var(--wp--preset--color--primary, #2563EB);
    color: #fff;
}

/* === 2. TIPOGRAFIE === */

/* Skip link accesibilitate */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: var(--wp--preset--color--primary, #2563EB);
    color: #fff;
    padding: 10px 20px;
    border-radius: 0 0 8px 8px;
    font-weight: 700;
    text-decoration: none;
    z-index: 10000;
    transition: top 0.2s;
}
.skip-to-content:focus {
    top: 0;
}

:focus-visible {
    outline: 2px solid var(--wp--preset--color--primary, #2563EB);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Butoane WP native — micro-interactions */
.wp-block-button__link {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.wp-block-button__link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}
.wp-block-button__link:active {
    transform: translateY(0);
}

/* Smooth underline pe linkuri (excl. butoane, navigație, logo) */
a:not(.wp-block-button__link):not(.wp-block-navigation-item__content):not(.wp-block-site-logo a):not(.wp-block-site-logo) {
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0% 1px;
    background-position: left bottom;
    background-repeat: no-repeat;
    transition: background-size 0.3s ease;
}
a:not(.wp-block-button__link):not(.wp-block-navigation-item__content):not(.wp-block-site-logo a):not(.wp-block-site-logo):hover {
    background-size: 100% 1px;
}
a:not(.wp-block-button__link):not(.wp-block-navigation-item__content):not(.wp-block-site-logo a):not(.wp-block-site-logo):focus-visible {
    text-decoration: underline;
    background-size: 0%;
}

/* Loading skeleton pentru imagini lazy */
img[loading="lazy"]:not([src]) {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: gm-shimmer 1.5s infinite;
}
@keyframes gm-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* === 3. LAYOUT CORE === */

/* Header sticky — targetează template part nativ WP */
header.wp-block-template-part {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    position: sticky;
    top: 0;
    z-index: 999;
    transition: box-shadow 0.3s;
}
header.wp-block-template-part.scrolled {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
header.wp-block-template-part .wp-block-site-logo img {
    max-height: 55px;
    width: auto;
    transition: max-height 0.3s;
}

/* === 4. NAVIGATION (L28 — selectori WP FSE nativi exclusiv) === */

/* Nav item hover underline (desktop only, nu afectează overlay) */
@media (min-width: 782px) {
    .wp-block-navigation-item a {
        padding: 12px 18px;
        font-weight: 500;
        transition: color 0.2s;
        position: relative;
    }
    .wp-block-navigation-item a::after {
        content: '';
        position: absolute;
        bottom: 4px;
        left: 18px;
        right: 18px;
        height: 2px;
        background: var(--wp--preset--color--primary, #2563EB);
        transform: scaleX(0);
        transition: transform 0.25s ease;
    }
    .wp-block-navigation-item a:hover::after,
    .wp-block-navigation-item.current-menu-item a::after {
        transform: scaleX(1);
    }
    .wp-block-navigation-item a:hover {
        color: var(--wp--preset--color--primary, #2563EB) !important;
    }
}

/* MOBILE (base): container ascuns implicit */
.wp-block-navigation__responsive-container {
    display: none;
}

/* MOBILE: overlay full-screen când meniul e deschis (L25 + L28) */
.wp-block-navigation__responsive-container.is-menu-open {
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 10000 !important;
    overflow-y: auto;
    padding: 20px;
}

/* L25 — aliniere stânga în overlay (suprascrie items-justified-right moștenit) */
.wp-block-navigation.is-menu-open .wp-block-navigation__container,
.wp-block-navigation.is-menu-open .wp-block-navigation__responsive-container-content {
    justify-content: flex-start !important;
    align-items: flex-start !important;
    text-align: left !important;
    flex-direction: column;
    width: 100%;
}
.wp-block-navigation.is-menu-open .wp-block-navigation-item a,
.wp-block-navigation.is-menu-open .wp-block-navigation__responsive-container-content li {
    text-align: left !important;
    width: 100%;
}

/* Scroll blocat pe mobil când meniul e deschis */
html.has-modal-open {
    overflow: hidden;
}

/* DESKTOP (≥782px): overlay NICIODATĂ vizibil — indiferent de clase JS */
@media (min-width: 782px) {
    .wp-block-navigation__responsive-container,
    .wp-block-navigation__responsive-container.is-menu-open {
        display: contents !important; /* override WP core inline */
        position: static !important; /* override WP core inline */
        inset: auto !important; /* override WP core inline */
        background: transparent !important; /* override WP core inline */
    }
    .wp-block-navigation__responsive-container-open {
        display: none !important; /* override WP core inline */
    }
    html.has-modal-open {
        overflow: auto !important; /* override WP core inline */
    }
}

/* === 5. HERO/COVER (L26 — breakpoints obligatorii) === */

/* base (desktop) */
.wp-block-cover h1,
.wp-block-cover h2 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.15;
}

/* tablet */
@media (max-width: 782px) {
    .wp-block-cover h1,
    .wp-block-cover h2 {
        font-size: 1.9rem;
        line-height: 1.2;
    }
    .wp-block-cover {
        min-height: 320px !important;
    }
    /* Touch target minim 44px pe butoanele din hero */
    .wp-block-cover .wp-block-button__link {
        min-height: 44px;
        padding: 12px 24px !important;
    }
}

/* phone */
@media (max-width: 480px) {
    .wp-block-cover h1,
    .wp-block-cover h2 {
        font-size: 1.5rem;
        line-height: 1.2;
    }
    .wp-block-cover {
        min-height: 260px !important;
    }
}

/* === 6. CONTACT FORM 7 (L20, L21) === */

/* Wrapper nativ CF7 (L20 — R_CF7_1: folosește .wpcf7, nu clase custom) */
.wpcf7 {
    max-width: 600px;
    margin: 0 auto;
}

/* Input text/email/tel/textarea — EXCLUDE explicit acceptance, checkbox, radio, submit */
.wpcf7 input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
.wpcf7 textarea,
.wpcf7 select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--wp--preset--color--body-text, #1E293B);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    background: #f9fafb;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.wpcf7 input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):focus,
.wpcf7 textarea:focus,
.wpcf7 select:focus {
    outline: none;
    border-color: var(--wp--preset--color--primary, #2563EB);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: #fff;
}
.wpcf7 textarea {
    min-height: 120px;
    resize: vertical;
}

/* GDPR acceptance — reset complet (L21 — R_CF7_2: exclude acceptance din stilurile input text) */
.wpcf7 .wpcf7-acceptance {
    display: block;
    border: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    width: auto;
}
.wpcf7 .wpcf7-acceptance input[type="checkbox"] {
    width: auto !important;
    height: auto !important;
    appearance: auto !important;
    -webkit-appearance: auto !important;
    border: initial !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    margin-right: 0.5rem;
    vertical-align: middle;
    accent-color: var(--wp--preset--color--primary, #2563EB);
}

.wpcf7 .wpcf7-submit {
    padding: 0.75rem 2rem;
    background: var(--wp--preset--color--primary, #2563EB);
    color: var(--wp--preset--color--background, #fff);
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    min-height: 44px;
    font-weight: 700;
    font-size: 1.05rem;
    width: 100%;
    margin-top: 8px;
    transition: background 0.3s, transform 0.2s;
}
.wpcf7 .wpcf7-submit:hover {
    background: color-mix(in srgb, var(--wp--preset--color--primary, #2563EB) 80%, #000);
    transform: translateY(-1px);
}
.wpcf7 .wpcf7-not-valid-tip {
    color: #EF4444;
    font-size: 0.8rem;
    margin-top: 4px;
}
.wpcf7 .wpcf7-response-output {
    border-radius: 8px !important;
    padding: 12px 16px !important;
}

/* === 7. CONTACT LINKS (tel/mail icons — L22, L23) === */
/* R_CSS_NATIVE: selectori globali pe atribute href — fără clase custom */

a[href^="tel:"]::before,
a[href^="mailto:"]::before {
    content: "";
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-right: 0.4em;
    vertical-align: -0.15em;
    background: currentColor;
    mask-size: contain;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-position: center;
}

a[href^="tel:"]::before {
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6.62 10.79a15.05 15.05 0 006.59 6.59l2.2-2.2a1 1 0 011.05-.24 11.36 11.36 0 003.58.57 1 1 0 011 1V20a1 1 0 01-1 1A17 17 0 013 4a1 1 0 011-1h3.5a1 1 0 011 1 11.36 11.36 0 00.57 3.58 1 1 0 01-.24 1.05l-2.21 2.16z'/></svg>");
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6.62 10.79a15.05 15.05 0 006.59 6.59l2.2-2.2a1 1 0 011.05-.24 11.36 11.36 0 003.58.57 1 1 0 011 1V20a1 1 0 01-1 1A17 17 0 013 4a1 1 0 011-1h3.5a1 1 0 011 1 11.36 11.36 0 00.57 3.58 1 1 0 01-.24 1.05l-2.21 2.16z'/></svg>");
}

a[href^="mailto:"]::before {
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M20 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V6a2 2 0 00-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z'/></svg>");
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M20 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V6a2 2 0 00-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z'/></svg>");
}

/* Excludere: butoanele WhatsApp float NU primesc iconița tel (au SVG propriu) */
.gm-whatsapp-float::before {
    display: none !important;
}

/* === 8. FOOTER (L27) === */

/* Footer template part nativ WP */
footer.wp-block-template-part {
    background: var(--wp--preset--color--secondary, #1E293B);
    color: #94a3b8;
    padding: 64px 0 24px;
}
footer.wp-block-template-part h3,
footer.wp-block-template-part h4 {
    color: #f1f5f9;
    font-size: 1.05rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 12px;
}
footer.wp-block-template-part h3::after,
footer.wp-block-template-part h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 32px;
    height: 2px;
    background: var(--wp--preset--color--primary, #2563EB);
}
footer.wp-block-template-part a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}
footer.wp-block-template-part a:hover {
    color: var(--wp--preset--color--accent, #F59E0B);
}
footer.wp-block-template-part ul {
    list-style: none;
    padding: 0;
}
footer.wp-block-template-part ul li {
    margin-bottom: 8px;
}

/* Footer bottom bar — ultimul grup din footer */
footer.wp-block-template-part .wp-block-group:last-child {
    border-top: 1px solid #334155;
    padding-top: 24px;
    padding-left: 16px;
    padding-right: 16px;
    margin-top: 48px;
    text-align: center;
    font-size: 0.85rem;
    color: #475569;
    overflow: visible; /* R_FOOTER_2: overflow visible obligatoriu */
}
footer.wp-block-template-part .wp-block-group:last-child a {
    color: #94a3b8;
    white-space: nowrap; /* R_FOOTER_2: white-space nowrap pe linkuri politici */
}
footer.wp-block-template-part .wp-block-group:last-child a:hover {
    color: #f1f5f9;
}

/* Social links în footer */
footer.wp-block-template-part .wp-block-group.is-layout-flex a,
footer.wp-block-template-part .wp-block-paragraph a[href*="facebook"],
footer.wp-block-template-part .wp-block-paragraph a[href*="instagram"],
footer.wp-block-template-part .wp-block-paragraph a[href*="linkedin"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    color: #94a3b8;
    transition: all 0.3s;
}
footer.wp-block-template-part .wp-block-group.is-layout-flex a:hover,
footer.wp-block-template-part .wp-block-paragraph a[href*="facebook"]:hover,
footer.wp-block-template-part .wp-block-paragraph a[href*="instagram"]:hover,
footer.wp-block-template-part .wp-block-paragraph a[href*="linkedin"]:hover {
    background: var(--wp--preset--color--primary, #2563EB);
    color: #fff;
    transform: translateY(-2px);
}

/* Footer responsive */
@media (max-width: 768px) {
    footer.wp-block-template-part {
        padding: 40px 1rem 20px;
    }
    footer.wp-block-template-part .wp-block-columns {
        gap: 32px;
    }
    footer.wp-block-template-part .wp-block-column {
        text-align: center;
    }
    footer.wp-block-template-part h3::after,
    footer.wp-block-template-part h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
    /* R_FOOTER_3: rezervă spațiu pentru butoane fixed (WhatsApp + scroll-top) */
    footer.wp-block-template-part .wp-block-group:last-child {
        padding-right: 80px;
    }
    footer.wp-block-template-part .wp-block-group:last-child p {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 8px;
        justify-content: center;
        align-items: center;
    }
}

/* === 9. WHATSAPP/FIXED BUTTONS === */

/* Buton WhatsApp float — clasa gm-* (fără starter-*/flavor-*) */
.gm-whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #25D366;
    color: #fff;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.35);
    z-index: 9999;
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none !important;
    background-image: none !important; /* override smooth underline */
}
.gm-whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
    background: #25D366;
    color: #fff;
}

/* Buton scroll-to-top */
.gm-scroll-top {
    position: fixed;
    bottom: 24px;
    right: 92px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--wp--preset--color--secondary, #1E293B);
    color: #fff;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.gm-scroll-top:hover {
    background: var(--wp--preset--color--primary, #2563EB);
    transform: translateY(-2px);
}
.gm-scroll-top.visible {
    display: flex;
}

/* Mobile: rezervă spațiu pentru butoane fixed */
@media (max-width: 782px) {
    footer.wp-block-template-part .wp-block-group:last-child,
    footer .alignfull:last-child {
        padding-right: 80px;
        flex-wrap: wrap;
    }
}

/* === ANIMAȚII (data attributes în loc de clase inventate) === */

[data-gm-fade] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-gm-fade].visible {
    opacity: 1;
    transform: translateY(0);
}

[data-gm-stagger] {
    transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-gm-stagger].gm-stagger {
    opacity: 0;
    transform: translateY(20px);
}
[data-gm-stagger].gm-stagger.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === RESPONSIVE GLOBAL (L13) === */

@media (max-width: 768px) {
    /* L13 — padding-inline pe toate secțiunile */
    .wp-site-blocks > * {
        padding-inline: 1rem !important;
    }
    footer {
        padding-inline: 1rem !important;
    }
    /* Logo mobil */
    header.wp-block-template-part .wp-block-site-logo img {
        max-height: 40px;
    }
}

/* === REDUCED MOTION === */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    [data-gm-fade] {
        opacity: 1;
        transform: none;
    }
}

/* === PRINT === */

@media print {
    .gm-whatsapp-float,
    .gm-scroll-top {
        display: none !important;
    }
    header.wp-block-template-part {
        position: static;
        box-shadow: none;
    }
}
