/* ==========================================================================
   TORQ SHOPWARE EMBED - WordPress Style Isolation
   ========================================================================== */

/* Apply Shopware fonts to entire WordPress body */
body,
body * {
    font-family: helvetica-lt-pro, sans-serif !important;
}

/* ==========================================================================
   STICKY HEADER — position:fixed wrapper
   ========================================================================== */

/*
 * We wrap all header elements (top-bar, header-main, alert-banner, nav-main)
 * in a single div.tse-sticky-header with position:fixed. This is more reliable
 * than position:sticky because GeneratePress sets overflow:hidden on several
 * ancestor elements which silently breaks sticky positioning.
 *
 * The WeingartzTheme StickyHeader plugin is DISABLED (data attr stripped in JS)
 * because its .sticky class toggling conflicts with the fixed wrapper.
 */
.tse-sticky-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 10000 !important;
    background: #fff;
    width: 100%;
}

/* Body padding to account for fixed header height (set by JS) */
body.tse-sticky-active {
    padding-top: var(--tse-header-height, 200px) !important;
}

/* Ensure WordPress content doesn't overlap the fixed header */
body.tse-sticky-active .site-content,
body.tse-sticky-active .entry-content,
body.tse-sticky-active main,
body.tse-sticky-active #main,
body.tse-sticky-active .wp-site-blocks {
    position: relative;
    z-index: 1;
}

/* Loading skeleton to prevent FOUC */
.tse-header-placeholder,
.tse-footer-placeholder {
    opacity: 0;
    visibility: hidden;
    height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease-in;
}

.tse-loading .tse-header-placeholder {
    opacity: 1;
    visibility: visible;
    height: auto;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.tse-header-placeholder {
    min-height: 150px;
}

.tse-footer-placeholder {
    min-height: 200px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* CRITICAL: Hide injected content by default */
body:not(.tse-ready) .header-main,
body:not(.tse-ready) .footer-main,
body:not(.tse-ready) .top-bar,
body:not(.tse-ready) .alert-banner,
body:not(.tse-ready) .nav-main {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Show with transition when ready */
body.tse-ready .header-main,
body.tse-ready .footer-main,
body.tse-ready .top-bar,
body.tse-ready .alert-banner,
body.tse-ready .nav-main {
    opacity: 1 !important;
    visibility: visible !important;
    transition: opacity 0.3s ease-in !important;
}

/* ==========================================================================
   FIX WORDPRESS STYLES - targeted fixes only
   ========================================================================== */

/* Force .main-navigation background transparent so .nav-main green shows */
.nav-main .main-navigation,
header.header-main .main-navigation {
    background: transparent !important;
    background-color: transparent !important;
}

/* Top bar should be white, not grey */
.top-bar {
    background: #fff !important;
    background-color: #fff !important;
}

/* Top bar link colors - GP sets them to white */
.top-bar a,
.top-bar a:visited {
    color: #4a4a4a !important;
}

/* Top bar link hover - show underline */
.top-bar a:hover {
    text-decoration: underline !important;
    background: transparent !important;
    background-color: transparent !important;
}

/* My Account dropdown - remove GP green background on hover */
.top-bar .account-menu-btn:hover,
.top-bar .dropdown-toggle:hover,
.top-bar button:hover {
    background: transparent !important;
    background-color: transparent !important;
    text-decoration: underline !important;
    color: #4a4a4a !important;
}

/* Prevent uppercase text-transform on account menu */
.top-bar .account-menu-btn,
.top-bar button,
.account-menu-btn {
    text-transform: none !important;
    font-weight: normal !important;
}

/* Reset font sizes to use Shopware's Bootstrap variables */
.top-bar,
.top-bar * {
    font-size: var(--bs-body-font-size) !important;
}

header.header-main,
header.header-main * {
    font-size: var(--bs-body-font-size) !important;
}

/* Navigation - don't override, let Shopware styles apply */
.nav-main .main-navigation-link,
.nav-main .main-navigation-link-text {
    font-size: inherit !important;
}

/* WordPress mark/ins highlight */
.top-bar mark,
.top-bar ins,
.alert-banner mark,
.alert-banner ins,
header.header-main mark,
header.header-main ins,
.nav-main mark,
.nav-main ins,
footer.footer-main mark,
footer.footer-main ins {
    background: none !important;
    background-color: transparent !important;
    color: inherit !important;
}

/* WordPress link underlines - remove ONLY text-decoration */
.top-bar a,
.alert-banner a,
header.header-main a,
.nav-main a,
footer.footer-main a {
    text-decoration: none !important;
}

/* Footer font sizes - reset to Shopware's sizing */
footer.footer-main {
    font-size: 1rem !important;
}

/* Don't override specific Bootstrap font-size utilities */
footer.footer-main .fs-1 { font-size: 2.5rem !important; }
footer.footer-main .fs-2 { font-size: 2rem !important; }
footer.footer-main .fs-3 { font-size: 1.75rem !important; }
footer.footer-main .fs-4 { font-size: 1.5rem !important; }
footer.footer-main .fs-5 { font-size: 1.25rem !important; }
footer.footer-main .fs-6 { font-size: 1rem !important; }

footer.footer-main h1,
footer.footer-main h2,
footer.footer-main h3,
footer.footer-main h4,
footer.footer-main h5,
footer.footer-main .footer-headline {
    font-size: 1.25rem !important;
}

/* Newsletter section heading */
footer.footer-main .bg-primary h2,
footer.footer-main h2.text-white {
    font-size: 1.75rem !important;
    font-weight: 700 !important;
}

/* Footer section headings (Contact Us, Closest Store, etc.) */
footer.footer-main h2.fs-4,
footer.footer-main .footer-column h2 {
    font-weight: 700 !important;
}

/* WordPress list bullets - remove ONLY list-style */
.top-bar ul,
.top-bar ol,
header.header-main ul,
header.header-main ol,
.nav-main ul,
.nav-main ol,
footer.footer-main ul,
footer.footer-main ol {
    list-style: none !important;
}

/* Z-index for proper layering */
header.header-main {
    position: relative;
    z-index: 9999;
    background: #fff;
}

.nav-main {
    position: relative;
    z-index: 9998;
}

/* Navigation flyouts need to appear above other content but below offcanvas */
.navigation-flyouts {
    z-index: 9997 !important;
}

/* Offcanvas z-index */
.offcanvas,
[class*="offcanvas"] {
    z-index: 999999 !important;
}

/* Login button in account menu dropdown - fix to solid dark green */
.account-menu-login-button,
.account-menu .btn-primary,
.account-menu-dropdown .btn-primary,
.top-bar .account-menu-login-button,
.top-bar a.btn-primary,
a.account-menu-login-button {
    background-color: #4a5d23 !important;
    background: #4a5d23 !important;
    border-color: #4a5d23 !important;
    color: #fff !important;
}

.account-menu-login-button:hover,
.account-menu .btn-primary:hover,
.account-menu-dropdown .btn-primary:hover,
.top-bar .account-menu-login-button:hover,
.top-bar a.btn-primary:hover,
a.account-menu-login-button:hover {
    background-color: #3d4e1c !important;
    background: #3d4e1c !important;
    border-color: #3d4e1c !important;
    color: #fff !important;
}

/* Account menu dropdown z-index - must be above navigation */
.account-menu-dropdown,
.dropdown-menu,
.account-menu .dropdown-menu {
    z-index: 99999 !important;
}

.top-bar .dropdown {
    position: relative;
    z-index: 99999 !important;
}

/* Search input border fix */
.header-search-input,
.header-search-form .form-control {
    border: 1px solid #6c757d !important;
    border-radius: 0 !important;
    border-right: none !important;
}

.header-search-btn {
    border: 1px solid #6c757d !important;
    border-left: none !important;
    border-radius: 0 !important;
}

/* Navigation flyouts (dropdown menus) */
.navigation-flyouts {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9997 !important;
    width: 100% !important;
}

.navigation-flyout {
    z-index: 9997 !important;
    display: none;
}

.navigation-flyout.is-open {
    display: block !important;
}

/* Flyout menu content font sizes */
.navigation-flyouts,
.navigation-flyout {
    font-size: 1rem !important;
}

.navigation-flyout-link,
.navigation-flyout a {
    font-size: 1rem !important;
}

/* Ensure nav-main is positioned for flyout context */
.nav-main {
    position: relative !important;
}
