/* ==========================================================================
   VISIBILITY, CONTRAST & RESPONSIVE LAYOUT FIXES
   Studio Legale Zorzi - avvocatozorzi.it
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. MOBILE HEADER & NAVIGATION SYSTEM
   -------------------------------------------------------------------------- */

/* Top bar on mobile */
.ast-header-break-point #ast-mobile-header,
#ast-mobile-header {
    width: 100% !important;
    position: relative !important;
    z-index: 9999 !important;
}

.ast-header-break-point #ast-mobile-header .ast-primary-header-bar,
.ast-mobile-header-wrap .ast-primary-header-bar {
    background-color: #1a1a1a !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 13px 20px !important;
    min-height: 70px !important;
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Ensure mobile header row stretches full width with logo left, hamburger right */
#ast-mobile-header .ast-builder-grid-row,
.ast-mobile-header-wrap .ast-builder-grid-row {
    width: 100% !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

#ast-mobile-header .site-header-primary-section-left,
.ast-mobile-header-wrap .site-header-primary-section-left {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex: 0 1 auto !important;
}

#ast-mobile-header .site-header-primary-section-right,
.ast-mobile-header-wrap .site-header-primary-section-right {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    margin-left: auto !important;
    flex: 0 0 auto !important;
}

#ast-mobile-header .site-header-primary-section-right .ast-button-wrap,
.ast-mobile-header-wrap .site-header-primary-section-right .ast-button-wrap {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
}

/* Mobile Logo sizing */
.ast-mobile-header-wrap .site-branding img.custom-logo {
    max-height: 44px !important;
    width: auto !important;
    display: block !important;
}

/* Hamburger toggle button */
.ast-mobile-header-wrap .ast-button-wrap .menu-toggle,
.ast-header-break-point .menu-toggle.main-header-menu-toggle,
.menu-toggle.main-header-menu-toggle {
    background-color: #b1976b !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 0 !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
    transition: all 0.2s ease !important;
}

.ast-mobile-header-wrap .ast-button-wrap .menu-toggle:hover,
.ast-mobile-header-wrap .ast-button-wrap .menu-toggle:focus,
.ast-mobile-header-wrap .ast-button-wrap .menu-toggle.toggled,
.ast-mobile-header-wrap .ast-button-wrap .menu-toggle.toggle-on {
    background-color: #91784f !important;
    color: #ffffff !important;
}

.ast-mobile-header-wrap .menu-toggle .ast-mobile-svg {
    fill: #ffffff !important;
    color: #ffffff !important;
    width: 22px !important;
    height: 22px !important;
}

/* Switch hamburger to close icon when toggled */
.menu-toggle.toggled .ast-menu-svg,
.menu-toggle.toggle-on .ast-menu-svg {
    display: none !important;
}

.menu-toggle.toggled .ast-close-svg,
.menu-toggle.toggle-on .ast-close-svg {
    display: block !important;
}

/* Mobile dropdown panel container */
.ast-mobile-header-content,
.ast-mobile-header-wrap .ast-mobile-header-content,
.ast-header-break-point .ast-mobile-header-content {
    background-color: #1a1a1a !important;
    background: #1a1a1a !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-bottom: 3px solid #b1976b !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6) !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* Override Astra's default #f9f9f9 light background on mobile menu containers */
.ast-mobile-header-content .ast-builder-menu-1,
.ast-mobile-header-content .ast-main-header-bar-alignment,
.ast-mobile-header-content .main-header-bar-navigation,
.ast-mobile-header-content .main-navigation,
.ast-mobile-header-content .main-header-menu,
.ast-mobile-header-content ul#ast-hf-menu-1-mobile,
.ast-header-break-point .ast-mobile-header-content .main-header-menu,
.ast-header-break-point .ast-mobile-header-wrap .main-header-menu,
.ast-header-break-point .main-header-menu {
    background-color: #1a1a1a !important;
    background: #1a1a1a !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

/* Mobile menu items (li) */
.ast-mobile-header-content .main-header-menu .menu-item,
.ast-header-break-point .ast-mobile-header-content .main-header-menu .menu-item {
    background-color: #1a1a1a !important;
    background: #1a1a1a !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    display: block !important;
    list-style: none !important;
}

/* Mobile menu links (a) - Maximum Contrast & Legibility */
.ast-mobile-header-content .main-header-menu .menu-item .menu-link,
.ast-header-break-point .ast-mobile-header-content .main-header-menu .menu-item .menu-link,
.ast-header-break-point .ast-mobile-header-wrap .main-header-menu .menu-link,
#ast-hf-menu-1-mobile .menu-link {
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    line-height: 1.5 !important;
    letter-spacing: 0.3px !important;
    padding: 15px 24px !important;
    display: block !important;
    width: 100% !important;
    text-decoration: none !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    background-color: transparent !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease !important;
}

/* Active / Current page link in mobile menu */
.ast-mobile-header-content .main-header-menu .menu-item.current-menu-item > .menu-link,
.ast-header-break-point .ast-mobile-header-content .main-header-menu .menu-item.current-menu-item > .menu-link,
#ast-hf-menu-1-mobile .menu-item.current-menu-item > .menu-link {
    color: #b1976b !important;
    font-weight: 700 !important;
    background-color: rgba(177, 151, 107, 0.15) !important;
    border-left: 4px solid #b1976b !important;
    padding-left: 20px !important;
}

/* Hover & Focus states in mobile menu */
.ast-mobile-header-content .main-header-menu .menu-item:hover > .menu-link,
.ast-mobile-header-content .main-header-menu .menu-item .menu-link:focus,
.ast-header-break-point .ast-mobile-header-content .main-header-menu .menu-item:hover > .menu-link,
#ast-hf-menu-1-mobile .menu-link:hover,
#ast-hf-menu-1-mobile .menu-link:focus {
    color: #b1976b !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
    padding-left: 28px !important;
}

/* Mobile CTA button inside the dropdown */
.ast-mobile-menu-cta {
    padding: 16px 20px 24px 20px !important;
    background-color: #1a1a1a !important;
}

.ast-mobile-menu-cta a {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    background-color: #b1976b !important;
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    padding: 13px 20px !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(177, 151, 107, 0.3) !important;
    transition: all 0.2s ease !important;
}

.ast-mobile-menu-cta a:hover,
.ast-mobile-menu-cta a:focus {
    background-color: #91784f !important;
    color: #ffffff !important;
}


/* --------------------------------------------------------------------------
   2. DESKTOP & TABLET HEADER FIXES
   -------------------------------------------------------------------------- */

/* Hide duplicate raw text link inside button wrapper on desktop */
.ast-builder-button-wrap > a.menu-link {
    display: none !important;
}

/* Desktop header navigation links hover */
.main-header-menu .menu-item:hover > .menu-link,
.main-header-menu .menu-item.focus > .menu-link,
.main-header-menu .current-menu-item > .menu-link {
    color: #b1976b !important;
}

/* Desktop CTA button */
.main-header-bar .ast-custom-button-link,
.main-header-bar .ast-button {
    background-color: #b1976b !important;
    border-color: #b1976b !important;
    color: #ffffff !important;
    transition: all 0.2s ease !important;
}

.main-header-bar .ast-custom-button-link:hover,
.main-header-bar .ast-button:hover {
    background-color: #91784f !important;
    border-color: #91784f !important;
    color: #ffffff !important;
}

/* Tablet responsiveness for desktop header (769px - 1024px) */
@media (max-width: 1024px) {
    .ast-primary-header-bar .site-primary-header-wrap {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    .main-header-menu .menu-link {
        padding: 0 10px !important;
        font-size: 14px !important;
    }
    .ast-header-button-1 .ast-custom-button {
        padding: 8px 14px !important;
        font-size: 12px !important;
    }
}


/* --------------------------------------------------------------------------
   3. FOOTER CONTRAST & HOVER SYSTEM
   -------------------------------------------------------------------------- */

.site-footer {
    background-color: #1a1a1a !important;
    color: #cbd5e1 !important;
}

.site-footer p,
.site-footer span,
.site-footer .widget,
.site-footer .footer-widget-area {
    color: #cbd5e1 !important;
}

/* Links in Footer (Phone, Email, Privacy Policy, Cookie Policy) */
.site-footer a,
.site-footer a:link,
.site-footer a:visited,
.site-primary-footer-wrap a,
.site-below-footer-wrap a,
.footer-widget-area a,
.ast-footer-copyright a {
    color: #b1976b !important;
    text-decoration: none !important;
    transition: color 0.2s ease, text-decoration 0.2s ease !important;
}

/* Hover: high-contrast white with underline */
.site-footer a:hover,
.site-footer a:focus,
.site-primary-footer-wrap a:hover,
.site-primary-footer-wrap a:focus,
.site-below-footer-wrap a:hover,
.site-below-footer-wrap a:focus,
.footer-widget-area a:hover,
.footer-widget-area a:focus,
.ast-footer-copyright a:hover,
.ast-footer-copyright a:focus {
    color: #ffffff !important;
    text-decoration: underline !important;
}

.ast-footer-copyright,
.ast-footer-copyright.site-footer-focus-item {
    color: #94a3b8 !important;
}


/* --------------------------------------------------------------------------
   4. BUTTONS CONTRAST
   -------------------------------------------------------------------------- */

.elementor-button {
    transition: all 0.25s ease !important;
}

.elementor-button:hover,
.elementor-button:focus {
    background-color: #91784f !important;
    border-color: #91784f !important;
    color: #ffffff !important;
}


/* --------------------------------------------------------------------------
   5. FORM INPUTS & HONEYPOT FIXES (Contatti & Preventivo)
   -------------------------------------------------------------------------- */

/* Hide WPForms anti-spam honeypot fields completely */
div[id*="-field_4-container"],
.wpforms-field[data-field-id="4"],
.wpforms-field-hp {
    position: absolute !important;
    overflow: hidden !important;
    display: inline !important;
    height: 1px !important;
    width: 1px !important;
    z-index: -1000 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Form inputs & textareas */
.wpforms-form input[type=text],
.wpforms-form input[type=email],
.wpforms-form input[type=tel],
.wpforms-form textarea,
.wpforms-form select {
    color: #1a1a1a !important;
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
    padding: 12px 16px !important;
    border-radius: 4px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

/* Clear, legible placeholder color */
.wpforms-form ::placeholder {
    color: #64748b !important;
    opacity: 1 !important;
}

/* Input Focus Ring */
.wpforms-form input[type=text]:focus,
.wpforms-form input[type=email]:focus,
.wpforms-form input[type=tel]:focus,
.wpforms-form textarea:focus,
.wpforms-form select:focus {
    border-color: #b1976b !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(177, 151, 107, 0.25) !important;
}

/* GDPR label readability */
.wpforms-field-gdpr-checkbox .wpforms-field-label-inline {
    color: #334155 !important;
    font-size: 13.5px !important;
    line-height: 1.4 !important;
}

/* Submit button */
.wpforms-form button.wpforms-submit {
    background-color: #b1976b !important;
    border: 1px solid #b1976b !important;
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    padding: 14px 32px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.wpforms-form button.wpforms-submit:hover,
.wpforms-form button.wpforms-submit:focus {
    background-color: #91784f !important;
    border-color: #91784f !important;
    color: #ffffff !important;
}

/* Web3Forms submission status message */
#form-result {
    margin-top: 16px;
    padding: 14px 20px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 15px;
    line-height: 1.4;
}


/* --------------------------------------------------------------------------
   6. AREE LEGALI - DIRITTO CONDOMINIALE BOX FIX
   -------------------------------------------------------------------------- */

/* Border and hover effect for Diritto condominiale box (3f56c59b) */
.elementor-1336 .elementor-element.elementor-element-3f56c59b > .elementor-element-populated,
.elementor-element.elementor-element-3f56c59b > .elementor-element-populated {
    border-style: solid !important;
    border-width: 0px 1px 1px 0px !important;
    border-color: #eaeaea !important;
    transition: background 0.3s, border 0.3s, border-radius 0.3s, box-shadow 0.3s !important;
}

.elementor-1336 .elementor-element.elementor-element-3f56c59b:hover > .elementor-element-populated,
.elementor-element.elementor-element-3f56c59b:hover > .elementor-element-populated {
    background-color: #ffffff !important;
}

/* Equal height and flex alignment in Row 3 */
.elementor-element-376b2035 .elementor-container {
    display: flex !important;
    align-items: stretch !important;
}

.elementor-element-55b623dc,
.elementor-element-3f56c59b {
    display: flex !important;
}

.elementor-element-55b623dc > .elementor-widget-wrap,
.elementor-element-3f56c59b > .elementor-widget-wrap {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
}

/* Tablet (2 columns of 50%) */
@media (max-width: 1024px) and (min-width: 768px) {
    .elementor-1336 .elementor-element.elementor-element-3f56c59b,
    .elementor-element.elementor-element-3f56c59b {
        width: 50% !important;
    }
    .elementor-element-376b2035 .elementor-element-50859558,
    .elementor-element-376b2035 .elementor-element-555b940b {
        display: none !important;
    }
}

/* Mobile (1 column of 100%) */
@media (max-width: 767px) {
    .elementor-1336 .elementor-element.elementor-element-3f56c59b,
    .elementor-element.elementor-element-3f56c59b {
        width: 100% !important;
    }
    .elementor-element-376b2035 .elementor-element-50859558,
    .elementor-element-376b2035 .elementor-element-555b940b {
        display: none !important;
    }
}


/* --------------------------------------------------------------------------
   7. GLOBAL HIGHLIGHT & SELECTION
   -------------------------------------------------------------------------- */

::selection {
    background-color: #b1976b;
    color: #ffffff;
}
