/* ==========================================================================
   Forge Renewables - Premium Styles & Mobile/Tablet Responsiveness Overrides
   Theme Palette: Primary Green (#135F17), Accent Tint (#EAF2EB)
   ========================================================================== */

/* === Root Variables === */
:root {
    --primary-green: #135F17;
    --primary-green-rgb: 19, 95, 23;
    --accent-tint: #EAF2EB;
    --dark-charcoal: #121212;
    --premium-transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* === Global Enhancements === */
html {
    scroll-behavior: smooth;
}

/* --- Premium Webkit Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #0f0f0f;
}
::-webkit-scrollbar-thumb {
    background: var(--primary-green);
    border-radius: 4px;
    border: 2px solid #0f0f0f;
}
::-webkit-scrollbar-thumb:hover {
    background: #1d8a23;
}

/* --- Smooth Cursor & Selection --- */
::selection {
    background: rgba(19, 95, 23, 0.25);
    color: #000000;
}

/* === Typography Responsive Scale === */
@media (max-width: 991px) {
    h1, .h1 {
        font-size: 2.4rem !important;
        line-height: 1.15 !important;
    }
    h2, .h2 {
        font-size: 2.0rem !important;
        line-height: 1.2 !important;
    }
    h3, .h3 {
        font-size: 1.6rem !important;
    }
}

@media (max-width: 576px) {
    h1, .h1 {
        font-size: 2.0rem !important;
    }
    h2, .h2 {
        font-size: 1.7rem !important;
    }
    h3, .h3 {
        font-size: 1.45rem !important;
    }
    section {
        padding: 50px 0 !important; /* Compact spacing for mobile */
    }
}

/* === Premium Glassmorphic Header === */
header.transparent {
    transition: var(--premium-transition) !important;
}

header.smaller {
    background: rgba(18, 18, 18, 0.85) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
}

header.header-light.smaller {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06) !important;
}

/* Header topbar spacing on tablet/mobile */
@media (max-width: 991px) {
    #topbar {
        display: none !important; /* Hide topbar on mobile/tablets to clean up screen space */
    }
    header {
        position: absolute;
    }
    .de-flex {
        padding: 10px 0;
    }
}

/* Mobile navigation drawer glassmorphism */
@media (max-width: 991px) {
    header.header-mobile #mainmenu {
        background: rgba(18, 18, 18, 0.95) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5) !important;
        border-radius: 0 0 15px 15px;
        padding: 15px 25px !important;
        left: 0 !important;
        width: 100% !important;
    }
    
    header.header-mobile #mainmenu li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    }
    
    header.header-mobile #mainmenu a.menu-item {
        color: #e5e7eb !important;
        font-weight: 500 !important;
        letter-spacing: 0.5px;
    }
    
    header.header-mobile #mainmenu a.menu-item:hover {
        color: #4ade80 !important;
    }
    
    header.header-mobile #mainmenu li ul {
        background: rgba(0, 0, 0, 0.2) !important;
        border-left: 2px solid var(--primary-green) !important;
        margin-left: 10px !important;
        padding-left: 10px !important;
    }
}

/* === Home Swiper Slider Responsive Typography === */
@media (max-width: 991px) {
    .sw-caption h1.slider-title {
        font-size: 2.6rem !important;
        margin-bottom: 12px !important;
    }
    .sw-caption p.slider-teaser {
        font-size: 1.1rem !important;
        margin-bottom: 20px !important;
    }
}

@media (max-width: 767px) {
    .sw-caption h1.slider-title {
        font-size: 2.0rem !important;
    }
    .sw-caption p.slider-teaser {
        font-size: 0.95rem !important;
    }
    /* Shift content upward so it's not cut off by mobile UI elements */
    .sw-caption {
        padding-bottom: 40px !important;
    }
}

/* === Premium Image Wrappers & Layout Fixes (Resolves Overflows) === */
.premium-img-wrapper, .founder-img-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 400px;
    margin-top: 15px;
    margin-bottom: 25px;
}

.premium-outline, .founder-outline {
    position: absolute;
    border: 2px solid var(--primary-green);
    top: 20px;
    left: -20px;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    z-index: 0;
    transition: var(--premium-transition);
    pointer-events: none;
}

/* Reverse alignment version */
.premium-outline-reverse {
    position: absolute;
    border: 2px solid var(--primary-green);
    top: 20px;
    right: -20px;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    z-index: 0;
    transition: var(--premium-transition);
    pointer-events: none;
}

.premium-img, .founder-img {
    position: relative;
    z-index: 1;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #ffffff;
    width: 100%;
    transition: var(--premium-transition);
}

.premium-badge, .founder-badge {
    position: absolute;
    z-index: 2;
    background: rgba(18, 18, 18, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 20px !important;
    border-radius: 10px;
    bottom: 20px;
    right: -20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transition: var(--premium-transition);
    text-align: left;
}

.premium-badge-reverse {
    position: absolute;
    z-index: 2;
    background: rgba(18, 18, 18, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 20px !important;
    border-radius: 10px;
    bottom: 20px;
    left: -20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transition: var(--premium-transition);
    text-align: left;
}

/* Hover effects */
.premium-img-wrapper:hover .premium-img,
.founder-img-wrapper:hover .founder-img {
    transform: scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.premium-img-wrapper:hover .premium-outline {
    top: 10px;
    left: -10px;
    border-color: #4ade80;
}
.premium-img-wrapper:hover .premium-outline-reverse {
    top: 10px;
    right: -10px;
    border-color: #4ade80;
}

.premium-img-wrapper:hover .premium-badge,
.founder-img-wrapper:hover .founder-badge {
    transform: translateY(-4px);
    border-color: rgba(19, 95, 23, 0.4);
    box-shadow: 0 15px 35px rgba(19, 95, 23, 0.25);
}

/* Responsive adjustments to completely remove overflow */
@media (max-width: 991px) {
    .premium-outline, .founder-outline {
        top: 12px;
        left: -12px;
    }
    .premium-outline-reverse {
        top: 12px;
        right: -12px;
    }
    .premium-badge, .founder-badge {
        bottom: 15px;
        right: -10px;
        padding: 10px 16px !important;
    }
    .premium-badge-reverse {
        bottom: 15px;
        left: -10px;
        padding: 10px 16px !important;
    }
}

@media (max-width: 576px) {
    /* Stack elements cleanly on mobile to eliminate all overflow possibilities */
    .premium-img-wrapper, .founder-img-wrapper {
        display: block;
        margin: 15px auto 35px auto;
        max-width: 320px;
    }
    
    .premium-outline, .founder-outline {
        top: 8px;
        left: -8px;
    }
    .premium-outline-reverse {
        top: 8px;
        right: -8px;
    }
    
    .premium-badge, .founder-badge,
    .premium-badge-reverse {
        position: relative;
        bottom: auto;
        right: auto;
        left: auto;
        margin: 15px auto 0 auto;
        display: block;
        max-width: 260px;
        text-align: center;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
        transform: none !important;
    }
}

/* === Premium B2B Tabular Styling (Products Page) === */
.table-responsive {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #ffffff;
}

.spec-table {
    margin-bottom: 0 !important;
    border-collapse: separate;
    border-spacing: 0;
}

.spec-table thead th {
    background: var(--primary-green) !important;
    color: #ffffff !important;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.85rem;
    padding: 14px 18px !important;
    border: none !important;
}

.spec-table tbody td {
    padding: 14px 18px !important;
    vertical-align: middle;
    font-size: 0.9rem;
    border-color: rgba(0, 0, 0, 0.06) !important;
    transition: var(--premium-transition);
}

.spec-table tbody tr:nth-of-type(odd) td {
    background-color: rgba(19, 95, 23, 0.015);
}

.spec-table tbody tr:hover td {
    background-color: rgba(19, 95, 23, 0.05) !important;
    color: #000000;
}

.spec-table tbody tr td strong {
    color: #2c3e50;
}

/* === Premium Form Interaction === */
.form-control:focus {
    border-color: var(--primary-green) !important;
    box-shadow: 0 0 0 3px rgba(19, 95, 23, 0.15) !important;
}

.captcha-img img {
    border-radius: 6px;
}

/* Fix mobile spacing for form input fields */
@media (max-width: 576px) {
    .form-underline input[type="text"],
    .form-underline input[type="email"],
    .form-underline textarea {
        padding: 12px 10px !important;
        font-size: 0.95rem;
    }
}

/* === Map Alignment & Premium Shadows === */
.map-container {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: #e5e3df;
}

/* === Navigation Sticky Active Underline Hover Micro-Animations === */
#mainmenu li a.menu-item {
    position: relative;
}

#mainmenu li a.menu-item::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: #4ade80;
    transition: var(--premium-transition);
}

#mainmenu li a.menu-item:hover::after {
    width: 100%;
}

/* === Safety Text-Wrapping Overrides to prevent overflow === */
h1, h2, h3, h4, h5, h6, p, span, li, a, td, th, div, strong {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: normal;
}

/* === Flexbox wrapping inside lists to prevent item overflows === */
.d-flex.align-items-start > div,
.d-flex.align-items-center > div {
    flex: 1 !important;
    min-width: 0 !important;
}

/* === Mobile Product Grid Safety Fix === */
@media (max-width: 576px) {
    .row.g-3 .col-6 {
        width: 100% !important;
        margin-bottom: 5px;
    }
}
