/*
Theme Name: Mercury Child
Theme URI: https://mercurytheme.com/
Description: Child theme for Mercury theme
Author: Space-Themes.com
Author URI: https://space-themes.com/
Template: mercury
Version: 3.9
*/
/* Import parent theme styles (fixed broken reference) */
@import url("../mercury/css/animate531b.css");
@import url("../mercury/css/owl.carousel.min531b.css");
@import url("../mercury/css/mediaa560.css");

/* Baseline Fixes */
html {
    -webkit-text-size-adjust: 100%;
}
*, *:before, *:after {
    box-sizing: border-box;
}
img, video {
    max-width: 100%;
    height: auto;
}
iframe {
    max-width: 100%;
}
/* Fix overflowing tables on small screens */
.wp-block-table, table {
    width: 100%;
    border-collapse: collapse;
}
.wp-block-table.is-responsive, .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Header Spacing Fix */
.space-header-height.relative {
    padding-top: 0 !important;
}

/* Logo Styling */
.space-header-logo-ins a {
    font-size: 24px !important;
    font-weight: bold !important;
    color: #333 !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    height: 40px !important;
    transition: color 0.3s ease !important;
}

.space-header-logo-ins a:hover {
    color: #d5a963 !important;
}

.space-mobile-menu-header a {
    font-size: 20px !important;
    font-weight: bold !important;
    color: #333 !important;
    text-decoration: none !important;
    display: block !important;
    padding: 10px 0 !important;
    transition: color 0.3s ease !important;
}

.space-mobile-menu-header a:hover {
    color: #d5a963 !important;
}

/* Mobile Menu Fixes */
.space-mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.space-mobile-menu.active {
    opacity: 1;
    visibility: visible;
}

.space-mobile-menu-block {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: #fff;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.space-mobile-menu.active .space-mobile-menu-block {
    transform: translateX(0);
}

.space-mobile-menu-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.space-mobile-menu-list {
    padding: 20px 0;
}

.space-mobile-menu-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.space-mobile-menu-list ul li {
    border-bottom: 1px solid #f5f5f5;
}

.space-mobile-menu-list ul li a {
    display: block;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    transition: background 0.3s ease;
}

.space-mobile-menu-list ul li a:hover {
    background: #f8f9fa;
    color: #d5a963;
}

.space-mobile-menu-list .menu-item-has-children > a {
    position: relative;
}

.space-mobile-menu-list .menu-item-has-children > a:after {
    content: '+';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    font-weight: bold;
}

.space-mobile-menu-list .menu-item-has-children.submenu-open > a:after {
    content: '-';
}

.space-mobile-menu-list .sub-menu {
    display: none;
    background: #f8f9fa;
}

.space-mobile-menu-list .sub-menu li a {
    padding-left: 40px;
}

.space-close-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    z-index: 10000;
}

.space-close-icon:before,
.space-close-icon:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: #333;
    transform: rotate(45deg);
}

.space-close-icon:after {
    transform: rotate(-45deg);
}

/* Mobile Menu Icon */
.space-mobile-menu-icon {
    cursor: pointer;
    padding: 10px;
    display: none;
}

.space-mobile-menu-icon div {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 5px 0;
    transition: 0.3s;
}

.space-mobile-menu-icon:hover div {
    background: #d5a963;
}

/* Desktop Menu Improvements */
@media (min-width: 768px) {
    .space-header-menu ul.main-menu {
        display: flex !important;
        list-style: none;
        margin: 0;
        padding: 0;
        align-items: center;
        justify-content: flex-end;
    }
    
    .space-header-menu ul.main-menu li {
        position: relative;
        margin: 0 15px;
    }
    
    .space-header-menu ul.main-menu li a {
        display: block;
        padding: 20px 0;
        color: #333;
        text-decoration: none;
        font-weight: 500;
        transition: color 0.3s ease;
        border-bottom: 2px solid transparent;
        white-space: nowrap;
    }
    
    .space-header-menu ul.main-menu li a:hover {
        color: #d5a963;
        border-bottom-color: #d5a963;
    }
    
    .space-header-menu ul.main-menu li.current-menu-item a {
        color: #d5a963;
        border-bottom-color: #d5a963;
    }
    
    /* Submenu styles */
    .space-header-menu ul.main-menu li ul.sub-menu {
        position: absolute;
        top: 100%;
        left: 0;
        background: #fff;
        min-width: 200px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
        z-index: 1000;
        border-radius: 4px;
    }
    
    .space-header-menu ul.main-menu li:hover ul.sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .space-header-menu ul.main-menu li ul.sub-menu li {
        margin: 0;
        border-bottom: 1px solid #f5f5f5;
    }
    
    .space-header-menu ul.main-menu li ul.sub-menu li:last-child {
        border-bottom: none;
    }
    
    .space-header-menu ul.main-menu li ul.sub-menu li a {
        padding: 12px 20px;
        border-bottom: none;
        white-space: normal;
    }
    
    .space-header-menu ul.main-menu li ul.sub-menu li a:hover {
        background: #f8f9fa;
    }
    
    /* Hide mobile menu icon on desktop */
    .space-mobile-menu-icon {
        display: none !important;
    }
}

/* Search Block Improvements */
.space-header-search-block {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.space-header-search-block.active {
    opacity: 1;
    visibility: visible;
}

.space-header-search-block-ins {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.space-header-search-block input[type="search"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    outline: none;
}

.space-header-search-block input[type="search"]:focus {
    border-color: #d5a963;
}

/* Body scroll lock when mobile menu is open */
body.mobile-menu-open {
    overflow: hidden;
}

/* Responsive improvements */
@media (max-width: 767px) {
    .space-header-logo {
        width: 70% !important;
    }
    
    .space-header-menu {
        width: 30% !important;
    }
    
    .space-header-search {
        right: 50px !important;
    }
    
    .space-mobile-menu-icon {
        display: block !important;
    }
    
    /* Ensure mobile menu is properly positioned */
    .space-mobile-menu {
        display: block !important;
    }
    
    /* Hide desktop menu on mobile */
    .space-header-menu ul.main-menu {
        display: none !important;
    }
    
    /* Mobile logo styling */
    .space-header-logo-ins a {
        font-size: 20px !important;
    }
}

/* Animation improvements */
.space-header-wrap.fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Additional menu improvements */
.space-header-menu {
    position: relative;
}

.space-header-menu ul.main-menu li {
    list-style: none;
}

.space-header-menu ul.main-menu li a {
    text-decoration: none;
}

/* Fix for menu items with special classes */
.space-header-menu ul.main-menu li.best a:before,
.space-header-menu ul.main-menu li.top a:before,
.space-header-menu ul.main-menu li.hot a:before,
.space-header-menu ul.main-menu li.new a:before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
}

.space-header-menu ul.main-menu li.best a:before {
    background: #007c26;
}

.space-header-menu ul.main-menu li.top a:before {
    background: #d5a963;
}

.space-header-menu ul.main-menu li.hot a:before {
    background: #e74c3c;
}

.space-header-menu ul.main-menu li.new a:before {
    background: #3498db;
}

/* Mobile menu improvements */
.space-mobile-menu-list ul li.best a:before,
.space-mobile-menu-list ul li.top a:before,
.space-mobile-menu-list ul li.hot a:before,
.space-mobile-menu-list ul li.new a:before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

.space-mobile-menu-list ul li.best a:before {
    background: #007c26;
}

.space-mobile-menu-list ul li.top a:before {
    background: #d5a963;
}

.space-mobile-menu-list ul li.hot a:before {
    background: #e74c3c;
}

.space-mobile-menu-list ul li.new a:before {
    background: #3498db;
}

/* Global Logo Replacement */
/* Desktop/header logo text link shows the site logo image instead */
.space-header-logo-ins a {
    background-image: url('/log.png') !important;
    background-repeat: no-repeat !important;
    background-position: left center !important;
    background-size: contain !important;
    color: transparent !important; /* keep accessible text but hide visually */
    text-shadow: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    height: 50px !important;
    line-height: 50px !important;
    padding-left: 180px !important; /* space for left-aligned logo */
}

/* Mobile menu header logo */
.space-mobile-menu-header a {
    background-image: url('/log.png') !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: contain !important;
    color: transparent !important;
    text-shadow: none !important;
    display: block !important;
    height: 50px !important;
    line-height: 50px !important;
    width: 200px !important;
    margin: 0 auto !important;
    padding: 0 !important;
}

@media (max-width: 767px) {
    .space-header-logo-ins a {
        height: 40px !important;
        line-height: 40px !important;
        padding-left: 140px !important;
    }
    .space-mobile-menu-header a {
        height: 40px !important;
        line-height: 40px !important;
        width: 160px !important;
    }
}
/* ===== Logo visibility fixes (override background sprites) ===== */
.space-header-logo, .space-header-logo-ins { overflow: visible !important; }

/* Stop using background image; use the <img> instead */
.space-header-logo-ins a,
.space-mobile-menu-header a {
    background: none !important;
    padding-left: 0 !important;
    height: auto !important;
    line-height: normal !important;
}

/* Desktop header logo image */
.space-header-logo-ins img {
    display: inline-block !important;
    height: 70px !important;
    width: auto !important;
    vertical-align: middle !important;
}

/* Mobile header logo image */
@media (max-width: 767px) {
    .space-header-logo-ins img { height: 60px !important; }
}

/* Mobile menu header logo image */
.space-mobile-menu-header img {
    display: inline-block !important;
    height: 60px !important;
    width: auto !important;
    vertical-align: middle !important;
}
