/* Mobile Responsive Styles for BlusMoon */

/* Tablet and smaller */
@media (max-width: 991px) {

    /* Shop Page Sidebar Stacking */
    .main-content.has-sidebar {
        flex: 0 0 100%;
        max-width: 100%;
        padding-right: 0;
        order: 1;
    }

    .sidebar {
        flex: 0 0 100%;
        max-width: 100%;
        order: 2;
        /* Sidebar below content */
        margin-top: 40px;
        padding-left: 0;
    }

    /* Product Detail Page Stacking */
    .single-thumb-vertical .contain-left {
        width: 100% !important;
        float: none !important;
        padding-right: 0 !important;
        margin-bottom: 30px;
    }

    .single-thumb-vertical .entry-summary {
        width: 100% !important;
        float: none !important;
        padding-left: 0 !important;
        clear: both;
    }

    /* Home Page Banners */
    .blusmoon-banner.style-01 {
        margin-bottom: 20px;
    }
}

/* Mobile Devices */
@media (max-width: 767px) {

    /* General Container */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Typography */
    h1,
    .page-title {
        font-size: 28px !important;
    }

    h2 {
        font-size: 24px !important;
    }

    h3 {
        font-size: 20px !important;
    }

    .product_title {
        font-size: 22px !important;
    }

    /* Hero Banner Font Adjustments */
    .banner-wrapper h1,
    .slider-content h1,
    .slide-info h1,
    .hero-title {
        font-size: 22px !important;
        line-height: 1.3 !important;
        padding: 10px 0 !important;
    }

    .banner-wrapper h5,
    .slider-content h5,
    .slide-info h5,
    .hero-subtitle {
        font-size: 18px !important;
        line-height: 1.4 !important;
        padding: 10px 0 !important;
    }

    .banner-wrapper h2,
    .slider-content h2,
    .slide-info h2,
    .hero-description {
        font-size: 15px !important;
        line-height: 1.5 !important;
        font-weight: 400 !important;
    }

    /* Offer Banner Font Adjustments */
    .blusmoon-banner h3,
    .blusmoon-banner .banner-title,
    .blusmoon-banner .banner-label,
    .offer-title {
        font-size: 20px !important;
        line-height: 1.3 !important;
    }

    .blusmoon-banner h6,
    .blusmoon-banner .banner-subtitle,
    .offer-subtitle {
        font-size: 18px !important;
        line-height: 1.4 !important;
    }

    .blusmoon-banner .banner-desc,
    .blusmoon-banner .subtitle,
    .blusmoon-banner p,
    .offer-description {
        font-size: 14px !important;
        line-height: 1.5 !important;
    }

    /* Countdown Section (Republic Day Sale) */
    .section-countdown {
        padding: 40px 15px !important;
        margin-top: 20px !important;
        margin-bottom: 20px !important;
    }

    .section-countdown h2 {
        font-size: 24px !important;
        letter-spacing: 1px !important;
    }

    .section-countdown h3 {
        font-size: 18px !important;
        margin-bottom: 15px !important;
    }

    .section-countdown p {
        font-size: 14px !important;
        margin-bottom: 25px !important;
    }

    /* Countdown blocks */
    .blusmoon-countdown {
        gap: 10px !important;
        margin-bottom: 25px !important;
    }

    .countdown-section {
        padding: 10px !important;
        min-width: 60px !important;
    }

    .countdown-amount {
        font-size: 22px !important;
    }

    .countdown-period {
        font-size: 10px !important;
    }

    /* Product Detail Countdown */
    .blusmoon-countdown-wrapper {
        margin-bottom: 25px !important;
        justify-content: flex-start !important;
    }

    .blusmoon-countdown-isolated .countdown-section {
        width: 50px !important;
        height: 50px !important;
        margin-right: 12px !important;
    }

    .blusmoon-countdown-isolated .countdown-amount {
        font-size: 18px !important;
    }

    .blusmoon-countdown-isolated .countdown-period {
        font-size: 8px !important;
    }

    /* Call to Action Buttons */
    .shop-now,
    .btn-shop-now,
    .banner-wrapper .button,
    .slider-content .button,
    .slide-info .button,
    .blusmoon-banner .button,
    .section-countdown .button {
        font-size: 14px !important;
        padding: 12px 24px !important;
        min-height: 44px !important;
        border-radius: 25px !important;
    }

    /* Homepage Product Name Adjustment */
    .product-name.product_title a {
        font-size: 13px !important;
        height: auto !important;
        min-height: 32px !important;
    }

    .product-info.equal-elem {
        height: auto !important;
        min-height: 80px !important;
    }

    /* Tab Links */
    .tab-link li a span {
        font-size: 13px !important;
    }

    /* Newsletter Section */
    .blusmoon-newsletter .title {
        font-size: 22px !important;
    }

    .blusmoon-newsletter .subtitle {
        font-size: 16px !important;
    }

    .blusmoon-newsletter .desc {
        font-size: 14px !important;
    }

    /* Product Detail */
    .blusmoon-product-gallery__image img {
        width: 100%;
        height: auto;
        border-radius: 8px;
    }

    .single-thumb-vertical .entry-summary {
        padding-top: 15px !important;
    }

    .product_title {
        font-size: 24px !important;
        line-height: 1.2 !important;
        margin-bottom: 10px !important;
        font-weight: 700 !important;
    }

    #main-product-price {
        font-size: 26px !important;
        margin-bottom: 20px !important;
        color: #d4145a !important;
        font-weight: 700 !important;
    }

    #main-product-price del {
        font-size: 18px !important;
        font-weight: 400 !important;
        margin-left: 10px;
    }

    .blusmoon-product-details__short-description {
        font-size: 15px !important;
        line-height: 1.6 !important;
        color: #555 !important;
        margin-bottom: 25px !important;
    }

    /* Variation Labels */
    .variations label {
        font-size: 14px !important;
        font-weight: 600 !important;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: #333;
    }

    /* Variation Swatches/Selects */
    .variations td.label {
        display: block;
        padding-bottom: 5px;
        text-align: left;
    }

    .variations td.value {
        display: block;
        padding-bottom: 15px;
    }

    /* Tabs */
    .blusmoon-tabs .tabs {
        display: block;
        border-bottom: none;
    }

    .blusmoon-tabs .tabs li {
        display: block;
        float: none;
        margin: 0 0 5px 0;
        width: 100%;
    }

    .blusmoon-tabs .tabs li a {
        display: block;
        padding: 12px 15px;
        background: #f8f8f8;
        border: 1px solid #eee;
        border-radius: 4px;
    }

    .blusmoon-tabs .tabs li.active a {
        background: #fff;
        border-color: #333;
    }

    /* Shop Page */
    .shop-control {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    /* Product Grid on Mobile */
    .products .product-item,
    .product-list-grid .product-item {
        max-width: 50%;
        flex: 0 0 50%;
    }

    /* For very small screens, maybe 1 column? */
    @media (max-width: 480px) {

        .products .product-item,
        .product-list-grid .product-item {
            /* max-width: 100%; */
            flex: 0 0 100%;
        }
    }

    /* Prevent page-level horizontal overflow */
    html,
    body {
        overflow-x: hidden;
        max-width: 100%;
    }

    /* Cart/Wishlist Tables - Card-based layout for mobile */
    table.shop_table_responsive {
        border: 0;
    }

    table.shop_table_responsive thead {
        display: none;
    }

    table.shop_table_responsive tbody,
    table.shop_table_responsive tr,
    table.shop_table_responsive td {
        display: block;
        width: 100%;
    }

    table.shop_table_responsive tr {
        margin-bottom: 20px;
        border: 1px solid #e5e5e5;
        border-radius: 8px;
        padding: 15px;
        background: #fff;
        position: relative;
    }

    table.shop_table_responsive td {
        text-align: left !important;
        padding: 10px 0 !important;
        border: none !important;
        position: relative;
    }

    /* Show labels using data-title attribute */
    table.shop_table_responsive td:before {
        content: attr(data-title);
        font-weight: 600;
        display: block;
        margin-bottom: 5px;
        color: #333;
        font-size: 12px;
        text-transform: uppercase;
    }

    /* Remove button - position in top right */
    table.shop_table_responsive td.product-remove {
        position: absolute;
        top: 10px;
        right: 10px;
        padding: 0 !important;
    }

    table.shop_table_responsive td.product-remove:before {
        display: none;
    }

    table.shop_table_responsive td.product-remove .remove {
        font-size: 24px;
        color: #999;
        text-decoration: none;
        line-height: 1;
        padding: 5px 10px;
    }

    /* Product thumbnail */
    table.shop_table_responsive td.product-thumbnail {
        text-align: center !important;
        padding: 15px 0 !important;
    }

    table.shop_table_responsive td.product-thumbnail:before {
        display: none;
    }

    table.shop_table_responsive td.product-thumbnail img {
        max-width: 120px;
        height: auto;
        margin: 0 auto;
    }

    /* Product name */
    table.shop_table_responsive td.product-name {
        padding-top: 5px !important;
    }

    table.shop_table_responsive td.product-name:before {
        display: none;
    }

    table.shop_table_responsive td.product-name a {
        font-size: 16px;
        font-weight: 600;
        color: #333;
    }

    /* Variation details */
    table.shop_table_responsive .variation-details {
        margin-top: 8px;
        font-size: 13px !important;
    }

    /* Price, Quantity, Total - display in a row */
    table.shop_table_responsive td.product-price,
    table.shop_table_responsive td.product-quantity,
    table.shop_table_responsive td.product-subtotal {
        display: inline-block;
        width: 33.33%;
        vertical-align: top;
        padding: 15px 5px 5px !important;
    }

    table.shop_table_responsive td.product-price:before,
    table.shop_table_responsive td.product-quantity:before,
    table.shop_table_responsive td.product-subtotal:before {
        font-size: 11px;
    }

    /* Quantity controls - make touch-friendly */
    table.shop_table_responsive .quantity {
        margin: 0;
    }

    table.shop_table_responsive .quantity .qty-label {
        display: none;
    }

    table.shop_table_responsive .quantity .control {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 5px;
    }

    table.shop_table_responsive .quantity .control a {
        min-width: 32px;
        min-height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
    }

    table.shop_table_responsive .quantity .control input {
        max-width: 50px;
        text-align: center;
        padding: 5px;
        font-size: 14px;
    }

    /* Cart totals section */
    .cart-collaterals {
        margin-top: 30px;
    }

    .cart_totals {
        width: 100% !important;
        margin: 0 !important;
    }

    .cart_totals h2 {
        font-size: 20px !important;
        margin-bottom: 20px;
    }

    .cart_totals table.shop_table {
        width: 100%;
    }

    .cart_totals table.shop_table th,
    .cart_totals table.shop_table td {
        padding: 12px 10px !important;
        font-size: 14px;
    }

    .cart_totals .blusmoon-proceed-to-checkout {
        margin-top: 20px;
    }

    .cart_totals .checkout-button {
        width: 100%;
        padding: 15px 20px;
        font-size: 16px;
        text-align: center;
    }

    /* Footer Mobile Menu padding */
    body {
        padding-bottom: 60px;
        /* Space for sticky footer */
    }

    /* Mobile Footer Improvements - 2 Column Layout */
    .section-025 .row {
        display: flex;
        flex-wrap: wrap;
    }

    .section-025 .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
        padding: 0 10px;
    }

    .section-025 .col-lg-3 {
        flex: 0 0 50%;
        max-width: 50%;
        padding: 0 10px;
        margin-bottom: 20px;
    }

    /* Footer links - more compact */
    .blusmoon-listitem .listitem-list li {
        margin-bottom: 8px;
    }

    .blusmoon-listitem .listitem-list li a {
        font-size: 14px;
        line-height: 1.4;
    }

    .blusmoon-listitem .title {
        font-size: 16px !important;
        margin-bottom: 15px;
    }

    /* Footer description - hide on mobile to save space */
    .section-025 .footer-desc {
        font-size: 13px;
        line-height: 1.5;
        margin-bottom: 15px;
    }

    /* Copyright section - stack vertically */
    .section-016 .row {
        text-align: center;
    }

    .section-016 .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 15px;
    }

    .section-016 .payment {
        justify-content: center !important;
    }

    .section-016 .payment>div {
        justify-content: center !important;
        flex-wrap: wrap;
    }

    /* Hero Banner Height Reduction on Mobile */
    .banner-wrapper.has_background {
        min-height: 200px !important;
        height: 200px !important;
    }

    .banner-wrapper.has_background img {
        height: 200px !important;
        object-fit: cover;
    }

    .banner-wrapper-inner {
        padding: 30px 0 !important;
    }

    .page-title {
        font-size: 24px !important;
        margin-bottom: 10px !important;
    }

    .breadcrumb-trail {
        font-size: 13px;
    }

    /* Product Title Wrapping - Allow 2 lines */
    .product-name.product_title a {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: normal !important;
        line-height: 1.3 !important;
        height: auto !important;
        min-height: 36px;
    }

    .product-info.equal-elem {
        height: auto !important;
        min-height: 100px;
    }

    /* Filter Button - Full width and more prominent */
    .mobile-filter-toggle {
        width: 100%;
        text-align: center;
        padding: 12px 20px !important;
        font-size: 15px;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    /* Reduce spacing between sections */
    .section-001,
    .section-009 {
        padding: 30px 0 !important;
    }

    .section-025 {
        padding: 30px 0 20px !important;
    }

    .section-016 {
        padding: 20px 0 !important;
    }

    /* Newsletter section - more compact */
    .blusmoon-newsletter .newsletter-info {
        margin-bottom: 20px;
    }

    .blusmoon-newsletter .title {
        font-size: 22px !important;
    }

    .blusmoon-newsletter .subtitle {
        font-size: 16px !important;
    }

    /* Very small screens - hide thumbnail */
    @media (max-width: 480px) {
        table.shop_table_responsive td.product-thumbnail {
            display: none;
        }

        table.shop_table_responsive td.product-price,
        table.shop_table_responsive td.product-quantity,
        table.shop_table_responsive td.product-subtotal {
            width: 100%;
            display: block;
            padding: 10px 0 !important;
        }

        /* Single column footer on very small screens */
        .section-025 .col-md-6,
        .section-025 .col-lg-3 {
            flex: 0 0 100%;
            max-width: 100%;
        }
    }
}