/* Styles for product banner thumbnails */
.product-banner .product-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* keep items on single row */
    overflow: hidden;
}

.product-banner .product-thumb-small {
    flex: 0 0 auto;
    text-align: center;
}

.product-banner .product-thumb-small img {
    width: 80px !important;
    height: 80px !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    display: block;
    margin: 0 auto;
}

/* Spacing: apply left margin to all but the first thumbnail using :not(:first-child) */
/* .product-banner .product-thumb-small:not(:first-child) {
    margin-right: 12px;
} */

/* Ensure last child has no extra right margin if any styling adds it */
.product-banner .product-thumb-small:last-child {
    margin-right: 0;
}


@media (max-width: 578px) {
    /* <= 578px: hide 3rd and smaller thumbs */
    .product-banner .product-thumb-small:nth-child(n+4) {
        display: none;
    }
}

@media (max-width: 400px) {
    /* <= 400px: show only 1 */
    .product-banner .product-thumb-small:nth-child(n+4) {
        display: none;
    }

    .product-banner .product-thumb-small img {
        width: 56px !important;
        height: 56px !important;
    }
}

@media (max-width: 340px) {
    /* <= 400px: show only 1 */
    .product-banner .product-thumb-small:nth-child(n+3) {
        display: none;
    }

    .product-banner .product-thumb-small img {
        width: 56px !important;
        height: 56px !important;
    }
}

/* ==========================================================================
   Responsive CSS for SooriCollection
   ========================================================================== */

/* Base styles (Mobile First) */
body {
    font-size: 12px;
    line-height: 1.6;
}

/* Container adjustments */
.container {
    padding-left: 15px;
    padding-right: 15px;
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
}

/* Blog-specific layout */
.blog-container {
    max-width: 1300px !important;
}

.blog-wrapper {
    align-items: flex-start;
}

.blog-top-slider .slider-inner {
    scroll-behavior: smooth;
}

.blog-top-slider .slider-item img {
    object-fit: cover;
    height: 260px;
}

.featured-card img, .post-item img {
    object-fit: cover;
}

/* Mobile categories button styling match green */
.bg-green-500 {
    background-color: var(--green-500);
}

/* Place desktop dropdown next to header */
.blog-header-row {
    gap: 16px;
}

.blog-dropdown {
    position: relative;
}

.blog-dropdown .card {
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 30;
}

@media (max-width: 400px) {
    .blog-header-row {
        flex-direction: column;
        align-items: stretch;
    }

    .blog-dropdown {
        order: -1;
    }

    .blog-dropdown .card {
        position: static;
        margin-top: 8px;
    }
}

/* Section carousel item spacing */
.section-posts-carousel .post-slide {
    padding: 8px;
}

.section-posts-carousel .post-slide .card img {
    object-fit: cover;
}

/* Mobile categories menu */
#mobile-cats-menu a {
    text-decoration: none;
}

/* Hide desktop sidebar on small screens */
@media (max-width: 768px) {
    .categories-sidebar {
        display: none;
    }

    /* Keep the latest posts widget visible on small screens */
    .categories-sidebar .sidebar-latest-posts,
    .sidebar-latest-posts,
    .p-3.sidebar-latest-posts {
        display: block !important;
    }
}

/* Cart page styles */
.variation-card {
    transition: all 0.2s ease;
    position: relative;
    /* margin-bottom: 15px; */
    /* padding: 10px; */
}

.variation-card img {
    max-width: 100%; /* Ensure images don't overflow */
    height: auto;
}

.variation-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.variation-card.selected {
    border-color: #000;
}

.variation-card .badge {
    color: #212529;
    font-weight: normal;
    text-align: right;
    padding: 6px 10px;
    margin-bottom: 5px;
    border-radius: 4px;
}

.variation-card .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.custom-variation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

@media (min-width: 600px) {
    .custom-variation-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* Product grid adjustments */
.shop-product-wrap .col-md-4 {
    margin-bottom: 15px;
}

.product-thumb img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Cart responsive */
.cart-main-wrapper .col {
    margin-bottom: 20px;
}

.cart-main-wrapper .d-flex {
    flex-direction: column;
    align-items: stretch !important;
}

/* Product detail responsive */
.product-details-inner .row {
    flex-direction: column;
}

.product-large-slider {
    margin-bottom: 20px;
}

/* Navigation responsive */
.main-menu-area {
    display: none;
}

.mobile-menu-toggle {
    display: block;
}

/* Header responsive */
.header-main-area .logo img {
    max-height: 50px;
}

/* ==========================================================================
   Tablet Styles (768px and up)
   ========================================================================== */
@media (min-width: 768px) {
    /* body {
        font-size: 12px;
    } */
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Product grid for tablets */
    /* .shop-product-wrap .col-md-4 {
        flex: 0 0 50%;
        max-width: 50%;
    } */
    /* Featured products carousel */
    .product-carousel-4_2 .slick-slide {
        padding: 0 10px;
    }

    /* Cart improvements */
    .cart-main-wrapper .d-flex {
        flex-direction: row;
        align-items: center;
        align-self: center;
    }

    .cart-main-wrapper .col-4 {
        flex: 0 0 25%;
        max-width: 25%;
    }

    .cart-main-wrapper .col-8 {
        flex: 0 0 75%;
        max-width: 75%;
    }

    /* Product detail */
    .product-details-inner .row {
        flex-direction: row;
    }

    .product-details-inner .col-lg-5 {
        flex: 0 0 45%;
        max-width: 45%;
    }

    .product-details-inner .col-lg-7 {
        flex: 0 0 55%;
        max-width: 55%;
    }

    /* Header */
    .header-main-area .logo img {
        max-height: 60px;
    }

    /* Navigation */
    .main-menu-area {
        display: block;
    }

    .mobile-menu-toggle {
        display: none;
    }
}

/* ==========================================================================
   Desktop Styles (992px and up)
   ========================================================================== */
@media (min-width: 992px) {
    body {
        font-size: .8rem;
    }

    .price-box2 {
        padding-top: 1rem !important;
    }

    .container {
        max-width: 1140px;
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Product grid for desktop */
    .shop-product-wrap .col-md-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }

    /* Featured products */
    .product-carousel-4_2 .slick-slide {
        padding: 0 15px;
    }

    /* Product items hover effects */
    .product-item:hover .cart-hover {
        opacity: 1;
        visibility: visible;
    }

    .cart-hover {
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .product-thumb:hover .sec-img {
        opacity: 1;
    }

    .sec-img {
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    /* Cart layout */
    .cart-main-wrapper .row-cols-md-2 > * {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* Product detail */
    .product-details-inner .col-lg-5 {
        flex: 0 0 41.666667%;
        max-width: 41.666667%;
    }

    .product-details-inner .col-lg-7 {
        flex: 0 0 58.333333%;
        max-width: 58.333333%;
    }

    /* Header */
    .header-main-area .logo img {
        max-height: 70px;
    }

    /* Button hover effects */
    /* .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        transition: all 0.3s ease;
    } */
}

/* ==========================================================================
   Small devices (landscape phones, 576px and up)
   ========================================================================== */
@media (min-width: 576px) {
    /* Cart page adjustments */
    /* .variation-card {
        padding: 15px; /* Adjust padding for small screens */
    .variation-card .row {
        display: flex;
        align-items: center;
    }
}

/* ==========================================================================
   Medium devices (tablets, 768px and up)
   ========================================================================== */

/* ==========================================================================
   Large Desktop Styles (1200px and up)
   ========================================================================== */
@media (min-width: 1200px) {
    /* Product grid improvements */
    .shop-product-wrap {
        margin-bottom: -40px;
    }

    .shop-product-wrap .col-md-4 {
        margin-bottom: 40px;
    }


    /* Product carousel */
    .product-carousel-4_2 .slick-slide {
        padding: 0 20px;
    }

    /* Product grid improvements */
    .shop-product-wrap .col-lg-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }

    /* Cart page adjustments */
    /* .variation-card {
        padding: 20px;
    } */
}

/* ==========================================================================
   Mobile Specific Styles (max-width: 767px)
   ========================================================================== */
@media (max-width: 768px) {
    /* Hide secondary images on mobile */
    .sec-img {
        display: none !important;
    }

    /* Stack cart items vertically */
    .cart-main-wrapper .d-flex {
        flex-direction: column;
        /* text-align: center; */
    }

    .cart-main-wrapper .col-4,
    .cart-main-wrapper .col-8 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 15px;
    }

    /* Product detail mobile */
    .product-details-inner .col-lg-5,
    .product-details-inner .col-lg-7 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Mobile navigation */
    .header-main-area .row {
        align-items: center;
    }

    /* Smaller text on mobile */
    .product-name a {
        font-size: 14px;
    }

    .price-box {
        font-size: 13px;
    }

    /* Product images */
    .product-thumb {
        margin-bottom: 15px;
    }

    /* Cart hover always visible on mobile */
    .cart-hover {
        opacity: 1 !important;
        visibility: visible !important;
        position: static;
        margin-top: 10px;
    }

    /* Responsive typography */
    .section-title .title {
        font-size: 24px;
    }

    .section-title .sub-title {
        font-size: 14px;
    }

    .cart-main-wrapper .d-flex {
        flex-direction: row;
        align-items: center;
    }
}

@media (max-width: 991px) {
    .cart-summary-price {
        flex-direction: column;
        align-items: flex-start !important;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .cart-hover,
    .product-badge,
    .btn,
    .header-main-area,
    .footer-area {
        display: none !important;
    }

    .product-thumb img {
        max-width: 200px;
    }

    body {
        font-size: 12px;
        color: #000;
    }
}

/* ==========================================================================
   High DPI / Retina Display Styles
   ========================================================================== */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .product-thumb img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ==========================================================================
   Dark Mode Support (if needed in future)
   ========================================================================== */
@media (prefers-color-scheme: dark) {
    /* Will be implemented if dark mode is requested */
}

/* ===== Cart specific tweaks ===== */
.quantity-input {
    max-width: 60px;
    width: 60px;
    min-width: 45px;
}

/* Position the cart summary (section X) on the left on desktops and move it below on <992px */
@media (min-width: 991px) {
    #cart-summary-wrapper {
        position: sticky;
        top: 100px; /* keeps it visible while scrolling */
    }
}

/* Ensure fixed image size */
.variation-card img {
    width: 120px !important;
    height: 120px !important;
    object-fit: cover;
}

.quantity-controls {
    flex-direction: row;
    height: fit-content;
    align-items: center !important;
}

@media (max-width: 575px) {
    .product-details-inner .product-details-des {
        padding-right: 0;
    }

    .pro-details-cart-wrap {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        -webkit-box-align: start;
        -ms-flex-align: start;
        align-items: flex-start;
    }

    .pro-details-cart-wrap .pro-details-cart {
        margin-top: 15px;
    }
}

@media (max-width: 768px) {
    .product-large-slider {
        margin: 0 auto;
    }

    .product-large-slider .pro-large-img {
        height: 250px;
        width: 100%;
    }

    .product-large-slider .pro-large-img img {
        display: block;
        margin: 0 auto;
        height: 100%;
        width: auto;
        max-width: 100%;
        object-fit: contain;
    }

    /* Disable zoom on mobile */
    .img-zoom-result {
        display: none !important;
    }

    .img-zoom-lens {
        display: none !important;
    }
}

@media (max-width: 390px) {
    .variation-card .row.align-items-center {
        flex-direction: column;
        text-align: center;
    }

    .variation-card .col-auto {
        margin-bottom: 15px;
    }

    .variation-card .row.align-items-center .col {
        width: 100%;
        text-align: right;
    }

    .variation-card .cart-item-image {
        width: 90px !important;
        height: 90px !important;
    }
}

@media (max-width: 991px) {
    .cart-main-wrapper .col-lg-8 {
        padding-bottom: 50px;
    }

    .mobile-logo {
        max-width: 100px;
    }
}

/* Hide bottom nav on cart and product detail pages on small devices */
@media (max-width: 768px) {
    .bottom-nav.hide-on-mobile-small {
        display: none !important;
    }
}

/* Center search results on very small screens */
@media (max-width: 500px) {
    .mobile-search-container.expanded #search-results {
        position: fixed !important;
        top: 44% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 90vw !important;
        max-height: 70vh !important;
        z-index: 2000 !important;
        display: none !important;
    }

    .mobile-search-container.expanded.has-results #search-results {
        display: block !important;
    }
}

/* Sidebar hover: slightly gray background for sidebar items */
.blog-left-sidebar .list-unstyled li.p-2 a,
.sidebar-latest-posts .latest-item,
.sidebar-top-viewed .latest-item {
    transition: background-color 0.15s ease, color 0.15s ease;
}

.blog-left-sidebar .list-unstyled li.p-2 a:hover,
.blog-left-sidebar .list-unstyled li.p-1 a:hover,
.sidebar-latest-posts .latest-item:hover,
.sidebar-top-viewed .latest-item:hover {
    background-color: #f5f5f5;
    border-radius: 4px;
    text-decoration: none;
}

.blog-left-sidebar .list-unstyled li.p-2 a,
.blog-left-sidebar .list-unstyled li.p-1 a{
    display: block;
    padding: 0.4rem 0.5rem;
}

/* Post hero/banner */
.post-hero {
    width: 100%;
    height: 420px;
    background-size: cover;
    background-position: center center;
    border-radius: 8px;
}

/* Responsive adjustments to match homepage hero behavior */
@media (max-width: 1200px) {
    .post-hero {
        height: 380px;
    }
}

@media (max-width: 992px) {
    .post-hero {
        height: 320px;
    }
}

@media (max-width: 768px) {
    .post-hero {
        height: 220px;
    }
}

@media (max-width: 480px) {
    .post-hero {
        height: 160px;
    }
}

/* Ensure CKEditor content takes site styles and images are responsive */
.ck-content.post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem auto;
}

@media (max-width: 768px) {
    .ck-content .image {
        min-width: 70% !important;
        height: auto;
        display: block;
        margin: 1rem auto;
    }
}
@media (max-width: 600px) {
    .ck-content .image {
        width: 100% !important;
        height: auto;
        display: block;
        margin: 1rem auto;
    }
}

.ck-content.post-content table {
    width: 100%;
    border-collapse: collapse;
}

.post-breadcrumb .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0 0 .5rem 0;
}

.post-toc {
    border: 1px solid #e9ecef;
    padding: .75rem;
    border-radius: .5rem;
    background: #edf6ff;
}

.post-toc .toc-title {
    color: #575757;
}

/* make sure anchor links in TOC are readable */
.post-toc .toc-list a {
    color: #575757;
}

/* TOC indentation by heading level */
.post-toc .toc-list li.toc-level-1 {
    padding-right: 0;
}

.post-toc .toc-list li.toc-level-2 {
    padding-right: 0.8rem;
}

.post-toc .toc-list li.toc-level-3 {
    padding-right: 1.6rem;
}

.post-toc .toc-list li a {
    color: #575757;
}

.post-toc .toc-list .toc-index {
    display: inline-block;
    padding-left: 0.5rem;
    text-align: right;
    color: #242424;
    font-weight: 600;
}

/* subtle hover */
.post-toc .toc-list li a:hover {
    text-decoration: underline;
}