/**
 * Path: assets/css/estimator-base.css
 * Description: Core variables, reset, and layout styles.
 */

/* --- Theme Variables --- */
:root {
    --fep-gold: #AC9653;
    --fep-gold-light: #f4f1ea;
    --fep-gold-medium: #e8e0cc;
    --fep-gold-hover: #96834d;
    --fep-dark-grey: #4E4E4E;
    --fep-medium-grey: #767676;
    --fep-light-grey: #EAEAEA;
    --fep-white: #FFFFFF;
    --fep-font-main: 'Montserrat', sans-serif;
    --fep-font-serif: 'EB Garamond', serif;
    --radius-main: 3px;
    /* Z-Index Hierarchy - Fixed for Mobile Overlap */
    --fep-z-floating-bar: 9998;
    --fep-z-overlay: 100000;
    --fep-z-modal: 100001;
    --fep-z-tooltip: 100002;
}

/* --- Base --- */
.fep-wrapper {
    font-family: var(--fep-font-main);
    color: var(--fep-dark-grey);
}

/* --- GLOBAL TOOLTIP STYLES (Added V2.2.8) --- */
/* Ensure the parent element (icon wrapper) is relative for absolute positioning of tooltip */
[data-fep-tooltip] {
    position: relative;
    cursor: pointer;
    display: inline-flex; /* Ensure it behaves like an icon */
    align-items: center;
    justify-content: center;
}

/* The Tooltip Bubble */
[data-fep-tooltip]::after {
    content: attr(data-fep-tooltip);
    position: absolute;
    bottom: 125%; /* Closer to the icon */
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
    white-space: normal;
    width: max-content;
    max-width: 250px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: var(--fep-z-tooltip); /* Use Variable */
    pointer-events: none;
    text-align: left; /* Aligned to left for better readability */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    font-weight: 400;
    text-transform: none;
}

/* The Triangle Arrow */
[data-fep-tooltip]::before {
    content: '';
    position: absolute;
    bottom: 115%; /* Matches bubble bottom */
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: var(--fep-z-tooltip); /* Use Variable */
    pointer-events: none;
}

/* Hover & Active States */
[data-fep-tooltip]:hover::after,
[data-fep-tooltip].fep-tooltip-visible::after,
[data-fep-tooltip]:hover::before,
[data-fep-tooltip].fep-tooltip-visible::before {
    opacity: 1;
    visibility: visible;
}

/* --- RESPONSIVE TOOLTIP POSITIONING (Added via JS) --- */
/* Left Aligned (for items on left edge) */
[data-fep-tooltip].pos-left::after {
    left: 0;
    transform: translateX(0);
}
[data-fep-tooltip].pos-left::before {
    left: 5px; /* Arrow stays near icon */
    transform: translateX(0);
}

/* Right Aligned (for items on right edge) */
[data-fep-tooltip].pos-right::after {
    left: auto;
    right: 0;
    transform: translateX(0);
}
[data-fep-tooltip].pos-right::before {
    left: auto;
    right: 5px; /* Arrow stays near icon */
    transform: translateX(0);
}

/* Fix for mobile horizontal scroll - restrict max-width to viewport minus padding */
@media (max-width: 768px) {
    /* Aggressively reset positioning on mobile to prevent overflow */
    [data-fep-tooltip]::after {
        position: fixed !important;
        left: 50% !important;
        top: 50% !important;
        bottom: auto !important;
        right: auto !important;
        transform: translate(-50%, -50%) !important;
        
        width: 85vw !important;
        max-width: 300px !important;
        white-space: normal !important;
        
        background-color: rgba(51, 51, 51, 0.95) !important;
        padding: 15px !important;
        border-radius: 6px !important;
        box-shadow: 0 10px 25px rgba(0,0,0,0.3) !important;
        z-index: 2147483647 !important; /* Max z-index to stay on top */
        
        text-align: center !important;
        word-wrap: break-word !important;
    }
    
    /* Hide the arrow on mobile since it's now a modal-like popup */
    [data-fep-tooltip]::before {
        display: none !important;
    }
    
    /* Ensure pos-left/right don't override this */
    [data-fep-tooltip].pos-left::after,
    [data-fep-tooltip].pos-right::after {
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
    }
}

/* Icon Styling (The 'i' circle) */
.fep-tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #4e4e4e; /* Requested color */
    margin-left: 3px; /* Closer to text */
    vertical-align: text-top; /* Aligned top-left relative to text line */
    width: 12px; /* Requested width */
    height: 12px; /* Requested height */
    position: relative;
    top: 1px; /* Visual adjustment for text alignment */
}

/* SVG Size Enforcement */
.fep-tooltip-icon svg, 
.fep-tooltip-icon svg.e-font-icon-svg {
    width: 12px !important;
    height: 12px !important;
    fill: currentColor;
    transition: color 0.2s;
    display: block;
}

.fep-tooltip-icon:hover {
    color: var(--fep-gold, #AC9653); /* Optional hover effect */
}

/* --- Progress Bar (Mockup Style) --- */
.progress-bar-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
    margin-bottom: 40px;
    padding: 10px 0;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    position: relative; /* Context for fixed tooltips if needed */
}

.progress-bar-container a {
    text-decoration: none;
    color: inherit;
}

.progress-step {
    display: flex;
    align-items: center;
    opacity: 0.5;
    transition: opacity 0.3s;
    font-size: 13px;
    font-weight: 500;
    position: relative; /* For tooltip positioning */
}

.progress-step.active, 
.progress-step.completed { 
    opacity: 1; 
}

.progress-step.active { 
    font-weight: 700; 
    color: var(--fep-dark-grey); 
}

.step-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--fep-light-grey);
    color: var(--fep-dark-grey);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    transition: all 0.3s;
}

.progress-step.active .step-icon {
    background-color: var(--fep-dark-grey);
    color: var(--fep-white);
    border: none;
}

.progress-step.completed .step-icon {
    background-color: var(--fep-gold);
    color: var(--fep-white);
    border: none;
}

.step-label {
    font-family: var(--fep-font-main);
    white-space: nowrap;
}

.progress-divider {
    height: 1px;
    width: 20px;
    background-color: #ddd;
    margin: 0 5px;
    flex-grow: 0;
}

/* --- Tooltip Override for Progress Bar (Show Below) --- */
.progress-bar-container [data-fep-tooltip]::after {
    bottom: auto;
    top: 100%;
    margin-top: 10px; /* Space from element */
    transform: translateX(-50%);
}

.progress-bar-container [data-fep-tooltip]::before {
    bottom: auto;
    top: 90%; 
    border-top-color: transparent;
    border-bottom-color: #333;
}

.progress-bar-container [data-fep-tooltip]:hover::after,
.progress-bar-container [data-fep-tooltip].fep-tooltip-visible::after {
    transform: translateX(-50%);
    top: 120%; /* Push it down a bit more to avoid overlap */
}

/* --- Mobile Styling Updates --- */
@media (max-width: 768px) {
    .progress-bar-container {
        gap: 5px;
        justify-content: center;
        padding-bottom: 20px; /* Extra space for tooltips below */
    }
    
    .step-label {
        display: none; /* Hide labels on mobile */
    }
    
    .progress-divider {
        display: block; /* Restore dividers */
        width: 15px;
        margin: 0 2px;
    }
    
    .progress-step {
        flex-direction: row; /* Keep horizontal icon flow */
        padding: 5px;
        position: static; /* Force relative to container on mobile */
    }
    
    .step-icon {
        width: 32px; /* Larger icons */
        height: 32px;
        font-size: 14px;
        margin-right: 0;
    }

    /* Override Progress Bar Tooltips specifically for mobile */
    .progress-bar-container [data-fep-tooltip]::after {
        width: auto !important;
        max-width: 90vw !important; /* Allow almost full width */
        min-width: 200px;
        
        /* Force Center on Screen */
        left: 50% !important;
        right: auto !important;
        transform: translate(-50%, 0) !important;
        
        /* Ensure top spacing */
        top: 100% !important;
        margin-top: 15px !important;
        
        /* Ensure it stays within bounds of the parent container if relative, or screen if static */
        position: absolute; 
    }
    
    /* Adjust arrow for mobile progress bar */
    .progress-bar-container [data-fep-tooltip]::before {
        /* Hide arrow on mobile progress bar as positioning is centered on screen not icon */
        display: none; 
    }
}

/* --- Page Layouts --- */
.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.edit-link {
    color: var(--fep-gold);
    font-size: 13px;
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
}

h1.main-title {
    font-family: var(--fep-font-serif);
    font-weight: 400;
    /* Updated font size variable per user request */
    font-size: var(--e-global-typography-61ffc65-font-size, 30px) !important; 
    color: var(--fep-dark-grey);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

h1.main-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background-color: var(--fep-gold);
    margin: 10px auto 0;
}

p.intro-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--fep-dark-grey);
    font-weight: 400;
    max-width: 800px;
    margin: 0 auto 15px;
}

/* --- Button Styling for Widget Shortcodes --- */
.quote-button-widget,
.quote-button-widget-new {
    background-color: var(--fep-gold) !important;
    color: white !important;
    border: 1px solid var(--fep-gold) !important;
    padding: 12px 30px !important;
    font-size: 15px !important;
    font-family: var(--fep-font-serif) !important;
    border-radius: var(--radius-main) !important;
    cursor: pointer !important;
    text-align: center !important;
    display: inline-block !important;
    text-decoration: none !important;
    transition: background-color 0.2s !important;
    text-transform: capitalize !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
}

.quote-button-widget:hover,
.quote-button-widget-new:hover {
    background-color: var(--fep-gold-hover) !important;
    color: white !important;
}

/* Containers for Plot Buttons */
.quote-container-widget,
.quote-container-widget-new {
    text-align: center;
    width: 100%;
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* Checkbox Group for Existing Plot */
.checkbox-group-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
}

.headstone-removal-title {
    font-weight: 600;
    color: var(--fep-dark-grey);
    font-size: 14px;
}

/* --- FOOTER NOTES ACCORDION (Updated V2.3.0) --- */
.static-footer-notes {
    margin-top: 20px !important; /* UPDATED: 20px padding top as requested */
    border-top: 1px solid #eee; 
    padding-top: 20px !important; /* Also applied to padding for spacing */
}

.fep-notes-accordion {
    background: #f9f9f9; 
    border-radius: 3px; 
    overflow: hidden;
}

.fep-notes-accordion-btn {
    width: 100%; 
    text-align: left; 
    padding: 15px; 
    border: none; 
    background: none; 
    cursor: pointer; 
    font-weight: 600; 
    color: #444; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}

.fep-notes-content {
    display: none; 
    padding: 15px; 
    border-top: 1px solid #eee; 
    font-size: 12px; 
    color: #666; 
    line-height: 1.6;
}

.fep-notes-content p {
    margin-bottom: 8px;
}

.fep-notes-content.open {
    display: block;
}

/* --- PRINT STYLES (Updated for Clean Layout) --- */
@media print {
    /* 1. Aggressively Hide Everything via Visibility */
    body {
        visibility: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        height: auto !important;
    }
    
    /* 2. Remove layout elements from flow to minimize blank pages */
    header, footer, .site-header, .site-footer, #wpadminbar, 
    .elementor-location-header, .elementor-location-footer {
        display: none !important;
    }

    /* 3. Make only the Quote Container Visible */
    #wuden-saved-quote-page,
    #wuden-saved-quote-page * {
        visibility: visible !important;
    }

    /* 4. Position Quote Container at Absolute Top */
    #wuden-saved-quote-page {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0px 20px !important; /* Side padding for print */
        background: #fff !important;
        z-index: 99999 !important;
    }

    /* 5. Force Print Header Display */
    .fep-print-header {
        display: block !important;
        margin-top: 0 !important;
        padding-top: 20px !important; /* Top spacing */
    }

    /* 6. Hide Interactive Elements */
    .wsq-edit-actions {
        display: none !important;
    }
    .wsq-accordion-header::after {
        display: none !important;
    }
    details {
        border: none !important;
    }
    
    /* 7. Ensure content flow */
    .wsq-accordion-content {
        display: block !important;
        height: auto !important;
        opacity: 1 !important;
    }

    /* 8. Typography Adjustments */
    body, html {
        font-size: 11pt; /* Slightly smaller for print */
        color: #000;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    a {
        text-decoration: none;
        color: #000;
    }
    
    .wsq-item {
        border-bottom: 1px solid #ccc;
        page-break-inside: avoid;
    }
    
    /* 9. Set Page Margins to minimal */
    @page {
        margin: 1cm;
        size: auto; 
    }
}