/*
Theme Name:   Chawkbazar child theme
Description:  ChawkBazar is a highly intuitive WooCommerce theme that will handle all your online business needs. It comes with unique & responsive design. With a lots of customization options and extensible codebase making it perfect WooCommerce theme for your next online shop. Looking for a WooCommerce theme? Look no further! Start selling anything and everything today.
Author:       RedQTeam
Author URL:   http://redq.io
Template:     chawkbazar
Version:      1.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  chawkbazar-child
*/

/* Write here your own personal stylesheet */

/* Product Card Image Size Fix */
.chawkbazar-custom-search-products-grid-thumbnail {
    height: auto !important;
    aspect-ratio: 696/896;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    display: block;
}

.chawkbazar-custom-search-products-grid-thumbnail img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure slider images maintain same aspect ratio */
.chawkbazar-product-card-slider .swiper-slide {
    height: 0;
    padding-bottom: calc(896 / 696 * 100%);
    position: relative;
}

.chawkbazar-product-card-slider .swiper-slide img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product card image width fix for shop page */
.chawkbazar-chlorine-product-thumbnails,
.chawkbazar-product-grid-thumbnail {
    width: 100% !important;
    display: block;
    overflow: hidden;
}

.chawkbazar-chlorine-product-thumbnails img,
.chawkbazar-product-grid-thumbnail img {
    width: 100% !important;
    height: auto !important;
    display: block;
    object-fit: cover;
    margin: 0 !important;
    padding: 0 !important;
}

/* Additional fix for product card containers */
.chawkbazar-chlorine-product-card {
    width: 100%;
}

.chawkbazar-chlorine-product-card a {
    display: block;
    width: 100%;
}

/* ===== LOGO IMPROVEMENTS ===== */

/* Header logo wrapper improvements */
.chawkbazar-header-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 15px 0;
    max-width: 100%;
    min-height: 70px;
}

/* Site branding container */
.site-branding {
    flex: 0 0 auto;
    max-width: 250px;
    margin-right: 30px;
    display: flex;
    align-items: center;
    min-height: 55px;
}

/* Site branding center alignment for mobile */
.site-branding-center {
    justify-content: center;
    margin-right: 0;
}

/* Site title styling */
.site-branding .site-title {
    margin: 0 !important;
    padding: 0;
    line-height: 1;
    font-size: 0; /* Hide text when logo is present */
}

/* Custom logo improvements */
.site-branding .custom-logo-link {
    display: inline-block;
    line-height: 0;
    max-width: 100%;
    height: auto;
    transition: all 0.3s ease;
    vertical-align: middle;
}

.site-branding .custom-logo-link:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

/* Logo image sizing and positioning */
.site-branding .custom-logo {
    max-height: 50px !important;
    width: auto !important;
    height: auto !important;
    max-width: 220px;
    object-fit: contain;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
}

/* Site title when no logo is set */
.site-branding .site-title a {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    text-decoration: none;
    line-height: 1.2;
    transition: color 0.3s ease;
}

.site-branding .site-title a:hover {
    color: #007cba;
    text-decoration: none;
}

/* Site description styling */
.site-branding .site-description {
    margin: 5px 0 0 0;
    font-size: 14px;
    color: #666;
    font-style: italic;
    line-height: 1.3;
}

/* Header specific adjustments */
.site-header .site-branding {
    z-index: 100;
    position: relative;
}

/* Responsive logo adjustments */
@media (max-width: 768px) {
    .site-branding .custom-logo {
        max-height: 40px !important;
        max-width: 180px;
    }
    
    .site-branding .site-title a {
        font-size: 24px;
    }
    
    .chawkbazar-header-logo-wrapper {
        padding: 12px 0;
        min-height: 60px;
    }
    
    .site-branding {
        margin-right: 20px;
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .site-branding .custom-logo {
        max-height: 35px !important;
        max-width: 160px;
    }
    
    .site-branding .site-title a {
        font-size: 20px;
    }
    
    .site-branding-center .chawkbazar-header-logo-wrapper {
        justify-content: center;
    }
}

/* Sticky header logo adjustments */
.site-header-fixed.scrolled .site-branding .custom-logo {
    max-height: 50px !important;
    transition: all 0.3s ease;
}

/* Denver header layout specific adjustments */
.header-denver .site-branding {
    flex-shrink: 0;
}

/* Rio header layout specific adjustments */
.header-rio .site-branding .custom-logo {
    max-height: 55px !important;
}

/* Center logo layout specific adjustments */
.header-center_logo .site-branding {
    text-align: center;
    margin: 0 auto;
    max-width: 300px;
}

.header-center_logo .chawkbazar-header-logo-wrapper {
    justify-content: center;
}

/* Logo loading optimization */
.site-branding .custom-logo {
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .site-branding .custom-logo {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ===== ADVANCED POSITIONING IMPROVEMENTS ===== */

/* Header container improvements */
.site-header {
    position: relative;
    z-index: 999;
}

/* Main header wrapper positioning */
.site-header .container,
.site-header .container-fluid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    min-height: 90px;
}

/* Header navigation alignment */
.site-header .main-navigation,
.site-header .primary-navigation {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
    margin-left: auto;
}

/* Header actions (cart, search, etc.) alignment */
.site-header .header-actions,
.site-header .chawkbazar-header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}

/* Logo positioning within header */
.site-branding {
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

/* Better logo centering */
.site-branding .site-title {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* Custom logo link positioning */
.site-branding .custom-logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border-radius: 4px;
}

/* Logo wrapper centering */
.chawkbazar-header-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
}

/* Header layout specific positioning adjustments */

/* Denver layout - left aligned logo */
.header-denver .site-branding {
    margin-right: auto;
    padding-left: 0;
}

.header-denver .chawkbazar-header-logo-wrapper {
    justify-content: flex-start;
}

/* Rio layout - compact positioning */
.header-rio .site-branding {
    margin-right: 25px;
}

.header-rio .chawkbazar-header-logo-wrapper {
    padding: 15px 0;
    min-height: 70px;
}

/* Center logo layout - perfect centering */
.header-center_logo .site-branding {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    z-index: 15;
}

.header-center_logo .chawkbazar-header-logo-wrapper {
    justify-content: center;
    width: auto;
}

/* Navigation spacing when center logo is used */
.header-center_logo .main-navigation {
    justify-content: space-between;
    width: 100%;
}

/* Sticky header positioning improvements */
.site-header-fixed {
    transition: all 0.3s ease;
}

.site-header-fixed.scrolled {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    background-color: rgba(255,255,255,0.98);
    backdrop-filter: blur(10px);
}

.site-header-fixed.scrolled .container,
.site-header-fixed.scrolled .container-fluid {
    min-height: 70px;
    padding: 10px 20px;
}

.site-header-fixed.scrolled .chawkbazar-header-logo-wrapper {
    padding: 10px 0;
    min-height: 50px;
}

/* Mobile positioning improvements */
@media (max-width: 1024px) {
    .site-header .container,
    .site-header .container-fluid {
        padding: 12px 15px;
        min-height: 80px;
    }
    
    .header-center_logo .site-branding {
        position: relative;
        left: auto;
        transform: none;
        text-align: center;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .site-header .container,
    .site-header .container-fluid {
        padding: 10px 15px;
        min-height: 70px;
        flex-wrap: wrap;
    }
    
    .chawkbazar-header-logo-wrapper {
        padding: 12px 0;
        min-height: 60px;
    }
    
    .site-branding {
        margin-right: 20px;
        max-width: 220px;
    }
    
    /* Mobile center alignment option */
    .site-branding-center {
        margin: 0 auto;
        text-align: center;
    }
    
    .site-branding-center .chawkbazar-header-logo-wrapper {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .site-header .container,
    .site-header .container-fluid {
        min-height: 60px;
        padding: 8px 10px;
    }
    
    .chawkbazar-header-logo-wrapper {
        padding: 8px 0;
        min-height: 50px;
    }
    
    .site-branding {
        margin-right: 15px;
        max-width: 200px;
    }
}

/* Header background and spacing improvements */
.site-header {
    border-bottom: 1px solid #f0f0f0;
    background-color: #fff;
}

/* Logo hover effects with better positioning */
.site-branding .custom-logo-link:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

/* RTL support for logo positioning */
.rtl .site-branding {
    margin-right: 0;
    margin-left: 40px;
}

.rtl .header-denver .chawkbazar-header-logo-wrapper {
    justify-content: flex-end;
}

.rtl .header-center_logo .site-branding {
    right: 50%;
    left: auto;
    transform: translateX(50%);
}
