/* Add here all your CSS customizations */

/* CRITICAL FIX: Ensure all images are visible and don't disappear */
img {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Header images must always be visible */
#header img,
.header img,
.logo img,
.cart-icon img,
.navbar img {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
}

/* Product images fix */
.product-image img,
.product img,
.shop img {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Cart icon specific fix */
.header-nav-features-cart img,
.cart-info img {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Header active link styling */
.nav-pills > .active > .dropdown-item {
    color: #ffffff !important;
    background-color: #28a745 !important;
}

.nav-pills > .active > .dropdown-item:hover {
    color: #ffffff !important;
    background-color: #218838 !important;
}

/* Minimal slider improvements using Porto classes */
@media (max-width: 767.98px) {
    /* Adjust slider height for mobile using Porto responsive approach */
    .slider-container {
        height: 400px !important;
    }
}

@media (max-width: 575.98px) {
    /* Extra small screens */
    .slider-container {
        height: 350px !important;
    }
}

/* Product variant styling */
.variant-choice {
    margin: 0 0.5rem 0.5rem 0;
}

.variant-choice.active {
    background-color: #28a745;
    border-color: #28a745;
    color: #ffffff;
}

.variant-choice small {
    font-size: 0.75rem;
}

/* Shop grid refinements */
.main.shop .product-thumb-info-image.ratio-box {
    position: relative;
    display: block;
    width: 100%;
    padding-top: 75%;
    background: #f8f9fa;
    overflow: hidden;
    border-radius: 0.25rem;
}

.main.shop .product-thumb-info-image.ratio-box > img.ratio-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge-featured {
    display: inline-block;
    background: #ffc107;
    color: #3a2f0b;
    font-weight: 600;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    text-transform: uppercase;
}

.main.shop .product-thumb-info-image .badge-featured {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(255, 193, 7, 0.4);
}

.single-product-badge {
    margin-left: 0.75rem;
}

.main.shop .add-to-cart-product {
    display: none !important;
}

.main.shop .product .product-thumb-info {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.main.shop .product-thumb-info-content {
    display: flex;
    flex-direction: column;
    margin-top: 0.5rem;
}

.main.shop .product-thumb-info-content .price,
.main.shop .product-thumb-info-content .rfq-text {
    font-weight: 600;
}

.main.shop .product-thumb-info-content .rfq-text {
    color: #0d6efd;
}

.main.shop .product-cta {
    margin-top: auto;
}

.main.shop .product-cta .btn {
    width: 100%;
}

/* Checkout presentation */
.checkout-page .card.sticky-top {
    position: sticky !important;
    top: 20px;
}

.checkout-page .order-items img {
    border-radius: 8px;
}

.checkout-page .form-check-input:checked {
    background-color: #007bff;
    border-color: #007bff;
}

.checkout-page .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.checkout-page .btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.checkout-page .btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.checkout-page #placeOrderBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.main.shop .product-thumb-info-content .badge {
    display: inline-block;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    background: rgba(0, 0, 0, 0.08);
    color: #5c5c5c;
    padding: 0.25rem 0.4rem;
    border-radius: 999px;
}

.main.shop .product-thumb-info .btn {
    font-size: 0.75rem;
    padding: 0.45rem 0.75rem;
    border-radius: 50px;
}

.main.shop .product-thumb-info .btn.btn-primary {
    background: #1e73be;
    border-color: #1e73be;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.main.shop .product-thumb-info .btn.btn-primary:hover {
    background: #155a93;
    border-color: #155a93;
    transform: translateY(-1px);
}

.main.shop .product-thumb-info .btn.btn-outline-primary {
    border-color: #1e73be;
    color: #1e73be;
}

.main.shop .product-thumb-info .btn.btn-outline-primary:hover {
    background: #1e73be;
    color: #fff;
}

/* Remove global gap before footer */
#footer {
    margin-top: 0;
}

/* Header tier layout */
#header .header-tier {
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
#header .header-tier:last-of-type {
    border-bottom: none;
}
#header .header-tier-top {
    background: #f8fafc;
    font-size: 0.85rem;
}
#header .header-tier-middle,
#header .header-tier-bottom {
    background: #ffffff;
}
#header .header-tier-inner {
    width: 100%;
}
#header .header-tier-top .header-nav-top .nav-link {
    padding: 0.2rem 0.65rem;
}
#header .header-nav-features .header-nav-feature + .header-nav-feature {
    margin-left: 0.75rem;
}
#header .header-extra-info {
    gap: 1.5rem;
    padding-left: 0;
    margin-bottom: 0;
}
#header .header-extra-info li {
    list-style: none;
}
#header .header-extra-info label {
    margin-bottom: 0.1rem;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
}
@media (max-width: 575.98px) {
    #header .header-tier {
        padding: 0.65rem 0;
    }
    #header .header-extra-info {
        gap: 0.75rem;
    }
}

/* ============================================
   HEADER USER DROPDOWN FIX - ALL DROPDOWNS
   ============================================ */
/* Fix for ALL header dropdowns (user menu, cart, search) */
#header .header-nav-features-dropdown,
#header .dropdown-menu {
    z-index: 10000 !important;
    position: absolute !important;
}

#header .nav-item.dropdown,
#header .header-nav-feature {
    position: relative;
    z-index: 1001;
}

#header .dropdown-menu.show,
#header .header-nav-features-dropdown {
    z-index: 10000 !important;
}

/* Ensure header body has lower z-index than dropdowns */
#header .header-body {
    position: relative;
    z-index: 100;
}

/* Main navigation should be below dropdowns */
#header .header-nav-main {
    position: relative;
    z-index: 50;
}

/* Top header features area needs proper stacking */
#header .header-nav-top {
    position: relative;
    z-index: 1001;
}

#header .header-row {
    position: relative;
    z-index: auto;
}

/* ============================================
   PHONE FIELD FLAG OVERFLOW FIX
   ============================================ */
.iti {
    width: 100%;
    position: relative;
    display: block;
}

.iti__flag-container {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
}

.iti__selected-flag {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    align-items: center;
}

/* Prevent phone input from expanding vertically */
.iti input[type="tel"],
.iti input.form-control {
    height: calc(1.5em + 0.75rem + 2px) !important;
    min-height: calc(1.5em + 0.75rem + 2px) !important;
    max-height: calc(1.5em + 0.75rem + 2px) !important;
    padding-left: 52px !important;
}

/* Form group should not expand with validation */
.form-group {
    position: relative;
    overflow: visible;
}

/* Validation feedback positioning */
.invalid-feedback,
.valid-feedback,
.text-danger,
.text-success {
    display: block;
    position: relative;
    z-index: 0;
    margin-top: 0.25rem !important;
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Ensure validation doesn't affect input height */
.form-control.is-invalid,
.form-control.is-valid,
.was-validated .form-control:invalid,
.was-validated .form-control:valid {
    height: calc(1.5em + 0.75rem + 2px) !important;
    padding-right: calc(1.5em + 0.75rem);
    background-position: right calc(0.375em + 0.1875rem) center;
}

/* Phone field specific - prevent height expansion */
.iti input[type="tel"].is-invalid,
.iti input[type="tel"].is-valid,
.was-validated .iti input[type="tel"]:invalid,
.was-validated .iti input[type="tel"]:valid {
    height: calc(1.5em + 0.75rem + 2px) !important;
    min-height: calc(1.5em + 0.75rem + 2px) !important;
    max-height: calc(1.5em + 0.75rem + 2px) !important;
}

/* Keep country dropdown properly positioned */
.iti__country-list {
    position: absolute;
    z-index: 9999;
    max-height: 200px;
    overflow-y: auto;
}

/* Form row spacing */
.form-row {
    margin-bottom: 1rem;
}

.form-row .form-group {
    margin-bottom: 0;
}

/* ============================================
   MOBILE RESPONSIVE IMPROVEMENTS
   ============================================ */

/* Header mobile improvements */
@media (max-width: 991.98px) {
    /* Top bar text sizing for tablets */
    .site-header-top .nav-link {
        font-size: 0.8rem;
        padding: 0.35rem 0.5rem;
    }
    
    /* Adjust logo sizing */
    .site-header-mid .logo img,
    .site-header-middle .brand-logo img {
        max-height: 50px;
    }
}

@media (max-width: 767.98px) {
    /* Mobile header adjustments */
    .site-header-top {
        padding: 0.5rem 0;
    }
    
    .site-header-top .nav-link {
        font-size: 0.75rem;
        padding: 0.25rem 0.4rem;
    }
    
    /* Hide separators on small screens */
    .site-header-top .sep {
        display: none;
    }
    
    /* Logo sizing for mobile - PREVENT OVERFLOW */
    .site-header-mid .logo img,
    .site-header-middle .brand-logo img {
        max-height: 45px !important;
        height: auto !important;
        max-width: 90vw !important;
        width: auto !important;
        object-fit: contain !important;
    }
    
    /* Cart icon sizing */
    .header-nav-features-cart .header-nav-features-number {
        font-size: 0.65rem;
        width: 16px;
        height: 16px;
        line-height: 16px;
    }
    
    /* Navbar brand when stuck */
    .nav-brand-when-stuck .nav-logo {
        max-height: 35px;
        max-width: 150px;
        width: auto;
        height: auto;
        object-fit: contain;
    }
    
    /* Center logo on mobile - stack layout */
    .site-header-middle .row {
        flex-direction: column;
        align-items: center !important;
        text-align: center !important;
    }
    
    .site-header-middle .col-auto {
        width: 100%;
        text-align: center !important;
        margin-bottom: 0.75rem;
        padding: 0 15px;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
    
    .site-header-middle .brand-logo {
        justify-content: center !important;
        text-align: center !important;
        max-width: 100%;
        overflow: hidden;
        display: flex !important;
        align-items: center !important;
        margin: 0 auto !important;
    }
    
    .site-header-middle .col {
        width: 100%;
    }
    
    .site-header-middle .search-50 {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 575.98px) {
    /* Extra small screens */
    .site-header-top .nav {
        font-size: 0.7rem;
    }
    
    /* Stack nav items vertically if needed */
    .site-header-top .nav-item {
        margin: 0 0.15rem;
    }
    
    /* Logo smaller on tiny screens - MAINTAIN ASPECT RATIO */
    .site-header-mid .logo img,
    .site-header-middle .brand-logo img {
        max-height: 35px !important;
        height: auto !important;
        max-width: 85vw !important;
        width: auto !important;
        object-fit: contain !important;
    }
    
    /* Adjust search bar */
    .site-header-mid .header-search-form input,
    .site-header-middle .search-50 input {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }
}

@media (max-width: 400px) {
    /* Very small mobile devices */
    .site-header-top .nav-link {
        font-size: 0.7rem;
        padding: 0.2rem 0.3rem;
    }
    
    .site-header-mid .logo img,
    .site-header-middle .brand-logo img {
        max-height: 30px !important;
        height: auto !important;
        max-width: 80vw !important;
        width: auto !important;
        object-fit: contain !important;
    }
}

/* Footer mobile improvements */
@media (max-width: 991.98px) {
    /* Footer columns stacking */
    #footer .footer-top .col-lg-3,
    #footer .footer-top .col-lg-6 {
        margin-bottom: 2rem;
    }
}

@media (max-width: 767.98px) {
    /* Footer spacing and typography */
    #footer .footer-heading {
        font-size: 1rem;
    }
    
    #footer .footer-top {
        padding: 2rem 0;
    }
    
    /* Social icons sizing */
    #footer .footer-social .social-link {
        font-size: 0.9rem;
        width: 32px;
        height: 32px;
        line-height: 32px;
    }
    
    /* Footer links spacing */
    #footer .footer-links li {
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 575.98px) {
    /* Footer logo sizing */
    #footer .footer-top img {
        max-width: 60px !important;
    }
    
    /* Footer text sizing */
    #footer .footer-top p,
    #footer .footer-links a {
        font-size: 0.9rem;
    }
    
    /* Footer heading stack */
    #footer .footer-heading-stack h5 {
        font-size: 0.9rem;
        margin-bottom: 0.75rem !important;
    }
    
    /* Social icons smaller */
    #footer .footer-social .social-link {
        font-size: 0.85rem;
        width: 28px;
        height: 28px;
        line-height: 28px;
        margin-right: 0.25rem;
    }
    
    /* Copyright text */
    #footer .footer-copyright p {
        font-size: 0.8rem;
    }
}

/* Mobile navbar dropdown fixes - SIMPLE DESIGN */
@media (max-width: 991.98px) {
    /* Collapsed navbar - white background */
    .navbar-collapse,
    #siteMainNav,
    #siteMainNav.collapse,
    #siteMainNav.collapsing,
    #siteMainNav.show {
        background-color: #ffffff !important;
    }
    
    .navbar-collapse {
        border-top: 1px solid #ddd;
        margin-top: 10px;
        padding: 0;
    }
    
    /* Simple nav links - ULTRA COMPACT */
    #siteMainNav .navbar-nav .nav-link,
    #siteMainNav .navbar-nav .nav-link strong,
    .navbar-nav .nav-link,
    .navbar-nav .nav-link strong {
        color: #000000 !important;
        background-color: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 4px 15px !important; /* Ultra compact - 4px */
        border-bottom: 1px solid #f0f0f0;
        font-size: 15px !important;
        line-height: 1.2 !important;
        display: block !important;
        text-decoration: none !important;
    }
    
    #siteMainNav .navbar-nav .nav-link:hover {
        color: #1a73e8 !important;
        background-color: #f8f9fa !important;
    }
    
    #siteMainNav .navbar-nav .nav-item.active .nav-link {
        color: #1a73e8 !important;
        background-color: transparent !important;
        font-weight: 600;
    }
    
    /* Dropdown menu - compact and simple with REDUCED spacing */
    #siteMainNav .dropdown-menu {
        background-color: #ffffff;
        border: none;
        border-left: 3px solid #1a73e8;
        margin: 0;
        padding: 0;
        box-shadow: none;
        position: static !important;
        width: 100%;
    }
    
    #siteMainNav .dropdown-menu .dropdown-item {
        color: #495057;
        padding: 3px 15px 3px 25px !important; /* Ultra compact - 3px */
        border: none;
        border-radius: 0;
        font-size: 14px;
        line-height: 1.2 !important;
        margin: 0 !important;
        border-bottom: 1px solid #f5f5f5;
    }
    
    #siteMainNav .dropdown-menu .dropdown-item:hover {
        background-color: #f8f9fa;
        color: #1a73e8;
    }
    
    /* Mega dropdown - simple list */
    #siteMainNav .mega-dropdown {
        background-color: #ffffff;
        border: none;
        box-shadow: none;
        padding: 0;
    }
    
    #siteMainNav .mega-dropdown .mega-grid {
        padding: 0;
    }
    
    #siteMainNav .mega-heading {
        color: #212529;
        font-size: 14px;
        font-weight: 600;
        padding: 4px 15px !important; /* Ultra compact - 4px */
        margin: 0 !important;
        line-height: 1.2 !important;
        background-color: #f8f9fa;
        border-bottom: 1px solid #e0e0e0;
    }
    
    #siteMainNav .mega-heading a {
        color: #212529;
        text-decoration: none;
    }
    
    #siteMainNav .mega-links {
        padding: 0;
        margin: 0;
    }
    
    #siteMainNav .mega-links li {
        padding: 0;
        margin: 0;
        list-style: none;
        border-bottom: 1px solid #f5f5f5; /* Moved border here */
    }
    
    #siteMainNav .mega-links li + li {
        margin-top: 0; /* Remove extra margin */
        padding-top: 0; /* Remove extra padding */
        border-top: none; /* Remove duplicate border */
    }
    
    #siteMainNav .mega-links a {
        color: #495057;
        padding: 3px 15px 3px 25px !important; /* Ultra compact - 3px */
        display: block;
        font-size: 14px;
        line-height: 1.2 !important;
        margin: 0 !important;
        text-decoration: none;
        border-bottom: none; /* Remove duplicate border */
    }
    
    #siteMainNav .mega-links a:hover {
        color: #1a73e8;
        background-color: #f8f9fa;
    }
    
    /* Remove column padding on mobile */
    #siteMainNav .mega-dropdown .col-md-4 {
        padding: 0;
        margin-bottom: 0;
    }
}

/* Top bar mobile fixes - show login/user info */
@media (max-width: 767.98px) {
    /* Make sure login/register/user menu is visible on mobile */
    .site-header-top .nav-item {
        display: inline-block !important;
    }
    
    .site-header-top .nav-item.d-none.d-sm-block {
        display: inline-block !important;
    }
    
    .site-header-top .dropdown-menu {
        position: absolute;
        right: 0;
        left: auto;
        min-width: 200px;
    }
    
    /* Ensure user dropdown is visible */
    .site-header-top .nav-item.dropdown {
        position: relative;
    }
}

@media (max-width: 575.98px) {
    /* Very small screens - compact user info */
    .site-header-top .dropdown-toggle {
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Touch-friendly improvements */
@media (pointer: coarse) and (hover: none) {
    /* Increase touch targets for mobile */
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .header-nav-features-cart,
    .header-nav-features-search-reveal-icon {
        min-width: 44px;
        min-height: 44px;
    }
    
    #footer .footer-social .social-link {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}
