/* ==========================================================================
   MB BEAUTY STUDIO - RESPONSIVE STYLESHEET
   Targeting Mobile (< 768px) and Tablet (< 992px)
   ========================================================================== */

/* ============================
   GLOBAL & UTILITIES
   ============================ */
@media (max-width: 768px) {
    * {
        box-sizing: border-box;
    }

    html,
    body {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        overflow-x: hidden;
    }

    body {
        font-size: 14px;
    }

    /* Full Width - Edge to Edge */
    .container,
    .container-fluid,
    .container-lg,
    .container-md,
    .container-sm,
    .container-xl,
    .container-xxl {
        padding-left: 15px !important;
        padding-right: 15px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Full Width Rows */
    .row {
        margin-left: -15px !important;
        margin-right: -15px !important;
    }

    .row>* {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* Hero Slider - Full Width No Padding */
    .hero-slider-pink,
    .hero-slider,
    .premium-hero {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Hero Content Padding */
    .hero-content {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    /* Content Sections Padding */
    section:not(.hero-slider-pink):not(.hero-slider):not(.premium-hero) {
        padding: 25px 0 !important;
    }

    /* Add padding inside containers of sections */
    section .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* Typography */
    h1,
    .page-title {
        font-size: 22px !important;
    }

    h2,
    .section-title {
        font-size: 18px !important;
    }

    h3 {
        font-size: 16px !important;
    }

    h4 {
        font-size: 15px !important;
    }

    h5 {
        font-size: 14px !important;
    }

    /* Stack flex containers on mobile */
    .d-flex-mobile-stack {
        flex-direction: column !important;
    }
}

/* ============================
   HEADER & NAVIGATION
   ============================ */
@media (max-width: 991px) {
    .navbar-collapse {
        background: white;
        padding: 20px;
        border-radius: 0 0 15px 15px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 9999;
        max-height: 80vh;
        overflow-y: auto;
    }

    .navbar-toggler {
        border: none;
        padding: 0;
    }

    .navbar-toggler:focus {
        box-shadow: none;
    }

    .search-container {
        margin: 15px 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ============================
   CATALOGUE / PRODUCTS.PHP
   ============================ */
@media (max-width: 768px) {

    /* Filter Sidebar */
    .filter-sidebar {
        display: none;
        /* Often hide sidebar and use a toggle button */
        position: fixed;
        top: 0;
        left: 0;
        width: 80%;
        height: 100%;
        background: white;
        z-index: 10000;
        padding: 20px;
        overflow-y: auto;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .filter-sidebar.active {
        display: block;
    }

    .filter-toggle-btn {
        display: block !important;
        /* Show toggle button */
        width: 100%;
        margin-bottom: 20px;
        background: #f8f9fa;
        border: 1px solid #ddd;
        padding: 10px;
        text-align: center;
        border-radius: 5px;
    }

    /* Product Grid */
    .products-grid,
    .row.products-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr) !important;
        /* 2 Columns standard */
        gap: 15px !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    .products-grid>[class*='col-'] {
        width: 100% !important;
        padding: 0 !important;
    }

    /* Product Card Mobile Optimization */
    .product-card {
        margin-bottom: 0 !important;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .product-card .card-img-top {
        height: 180px !important;
        /* Fixed height for consistency */
        object-fit: cover;
    }

    .product-card .card-body {
        padding: 10px !important;
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .product-card .card-title {
        font-size: 14px !important;
        line-height: 1.3;
        margin-bottom: 5px;
        height: 36px;
        /* 2 lines approx */
        overflow: hidden;
    }

    .product-card .price {
        font-size: 14px !important;
        font-weight: 700;
        color: #e8a2c0;
    }

    /* Reveal "Add to Cart" on Mobile (No Hover) */
    .product-card .add-to-cart-overlay,
    .product-actions {
        opacity: 1 !important;
        transform: translateY(0) !important;
        position: static !important;
        background: none !important;
        padding: 10px 0 0 0 !important;
        display: flex;
        gap: 5px;
    }

    .product-actions .btn {
        padding: 5px 10px !important;
        font-size: 12px !important;
    }
}

@media (max-width: 400px) {

    /* Small Screens - 1 Column if needed or kep 2 tight */
    .products-grid {
        gap: 10px !important;
    }

    .product-card .card-img-top {
        height: 150px !important;
    }
}

/* ============================
   PRODUCT DETAIL PAGE (Overrides)
   ============================ */
@media (max-width: 991px) {
    .product-detail-wrapper {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    /* Ensure gallery is responsive (handled in product-details.css, but safety here) */
    .product-images-gallery {
        flex-direction: column-reverse;
    }

    .gallery-thumbnails {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        justify-content: flex-start;
        height: auto;
        min-height: auto;
        max-height: none;
    }

    .product-info h1.product-title {
        font-size: 24px !important;
        margin-top: 15px;
    }

    .price-wrapper {
        font-size: 20px !important;
        margin: 10px 0;
    }
}

/* ============================
   CART PAGE - Mobile
   ============================ */
@media (max-width: 768px) {
    .cart-wrapper {
        padding: 15px;
    }

    .cart-page-header h1 {
        font-size: 1.5rem !important;
        margin-bottom: 15px;
    }

    /* Cart Item Card */
    .cart-item-row {
        flex-direction: column;
        align-items: flex-start !important;
        padding: 15px !important;
        gap: 12px;
        border: 1px solid #f0f0f0;
        border-radius: 12px;
        margin-bottom: 15px;
        background: #fff;
        position: relative;
    }

    /* Full width columns */
    .cart-item-row>div {
        width: 100% !important;
        padding: 0 !important;
    }

    /* Product Title */
    .cart-item-row .product-title,
    .cart-item-row h5,
    .cart-item-row h6 {
        font-size: 15px !important;
        font-weight: 600;
        line-height: 1.4;
        margin-bottom: 5px;
        padding-right: 35px;
        /* Space for delete */
    }

    /* Price */
    .cart-item-row .text-muted,
    .cart-item-row .text-danger {
        font-size: 14px;
    }

    /* Option Badge */
    .cart-item-row .badge {
        white-space: normal !important;
        text-align: left;
        line-height: 1.4;
        display: block;
        margin-top: 8px;
        background: #f5f5f5 !important;
        color: #666 !important;
        border-radius: 6px;
        padding: 8px 10px;
        font-size: 12px;
        font-weight: normal;
    }

    /* Quantity Controls */
    .quantity-col {
        margin-top: 10px;
    }

    .quantity-col .input-group {
        width: auto;
        display: inline-flex;
        border: 1px solid #ddd;
        border-radius: 8px;
        overflow: hidden;
    }

    .quantity-col .btn {
        width: 38px;
        height: 38px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f8f8f8;
        border: none;
        color: #333;
        font-size: 18px;
        font-weight: 500;
    }

    .quantity-col .btn:active {
        background: #e8a2c0;
        color: #fff;
    }

    .quantity-col .form-control {
        width: 45px;
        text-align: center;
        border: none;
        border-left: 1px solid #ddd;
        border-right: 1px solid #ddd;
        font-weight: 600;
        font-size: 15px;
    }

    /* Total Price */
    .total-col {
        font-size: 16px !important;
        color: #e8a2c0;
        font-weight: 700;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #f0f0f0;
    }

    /* Remove Button */
    .remove-col {
        position: absolute !important;
        top: 12px;
        right: 12px;
        width: auto !important;
    }

    .remove-item-btn {
        background: transparent;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        color: #999 !important;
        border: none;
    }

    .remove-item-btn:hover,
    .remove-item-btn:active {
        color: #dc3545 !important;
        background: #fff5f5;
    }

    /* Cart Summary */
    .cart-summary {
        background: #fff;
        border-radius: 12px;
        padding: 15px;
        border: 1px solid #f0f0f0;
    }

    /* Proceed to Checkout Button */
    .cart-summary .btn-pink,
    .cart-summary .btn-primary,
    .proceed-checkout-btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 16px;
        font-weight: 600;
        border-radius: 10px;
        background: #e8a2c0;
        border: none;
        color: #fff;
    }
}

/* ============================
   CHECKOUT PAGE - Mobile
   ============================ */
@media (max-width: 991px) {
    .checkout-steps-lux {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .checkout-page {
        padding: 15px !important;
    }

    /* Stack columns */
    .checkout-page .row {
        flex-direction: column;
    }

    .checkout-page .col-lg-8,
    .checkout-page .col-lg-4 {
        width: 100% !important;
        padding: 0 !important;
    }

    .checkout-main {
        padding: 15px;
        border: 1px solid #f0f0f0;
        border-radius: 12px;
        margin-bottom: 15px;
        background: #fff;
    }

    /* Form Fields */
    .checkout-step .row.g-4 {
        gap: 12px !important;
    }

    .checkout-step .col-md-6,
    .checkout-step .col-12 {
        width: 100% !important;
        padding: 0 !important;
    }

    .luxury-input,
    .checkout-step input,
    .checkout-step select,
    .checkout-step textarea {
        padding: 12px 15px !important;
        font-size: 16px !important;
        height: auto;
        border-radius: 8px;
        border: 1px solid #ddd;
        background: #fff;
    }

    .luxury-input:focus,
    .checkout-step input:focus,
    .checkout-step select:focus {
        border-color: #e8a2c0;
        outline: none;
        box-shadow: 0 0 0 2px rgba(232, 162, 192, 0.15);
    }

    /* Shipping & Payment Cards */
    .shipping-card,
    .payment-card {
        margin-bottom: 12px;
        width: 100%;
    }

    .shipping-label,
    .payment-label {
        display: flex;
        align-items: center;
        padding: 12px !important;
        gap: 12px;
        border-radius: 8px;
    }

    .shipping-label .icon,
    .payment-label .icon {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(232, 162, 192, 0.1);
        border-radius: 50%;
        font-size: 16px;
    }

    .method-title {
        font-size: 14px;
        font-weight: 600;
    }

    .method-desc {
        font-size: 12px;
        color: #888;
    }

    .shipping-label .price {
        font-weight: 600;
        font-size: 14px;
        margin-left: auto;
    }

    /* Navigation Buttons - Clean Style */
    .checkout-step .d-flex.justify-content-between {
        flex-direction: column-reverse;
        gap: 12px;
        margin-top: 20px !important;
    }

    .checkout-step .btn {
        width: 100%;
        padding: 14px 20px;
        border-radius: 10px;
        font-weight: 600;
        font-size: 16px;
    }

    /* Next Step Button */
    .next-step,
    .checkout-step .btn-pink,
    .checkout-step .btn-primary {
        background: #e8a2c0;
        border: none;
        color: #fff;
    }

    .next-step:active,
    .checkout-step .btn-pink:active {
        background: #d490ae;
    }

    /* Back Button */
    .back-step,
    .checkout-step .btn-outline-secondary {
        background: #f5f5f5;
        border: 1px solid #ddd;
        color: #666;
    }

    /* Place Order Button */
    .place-order-btn {
        background: #e8a2c0;
        border: none;
        color: #fff;
        padding: 16px 20px;
        font-size: 17px;
    }

    /* Order Summary */
    .checkout-sidebar {
        padding: 15px;
        border-radius: 12px;
        background: #fff;
        border: 1px solid #f0f0f0;
    }
}



/* ============================
   ABOUT & CONTACT PAGES
   ============================ */
@media (max-width: 991px) {
    .about-hero h1 {
        font-size: 2.5rem !important;
    }

    .story-content {
        flex-direction: column;
    }

    .story-image {
        min-height: 300px;
        margin-bottom: 30px;
    }
}

@media (max-width: 768px) {

    /* About Page Mobile */
    .about-hero {
        padding: 60px 0;
        text-align: center;
    }

    .about-hero h1 {
        font-size: 2rem !important;
    }

    .mv-grid,
    .values-grid,
    .stats-grid,
    .team-grid {
        grid-template-columns: 1fr;
        /* Stack vertically */
        gap: 20px;
    }

    .story-image {
        height: 250px;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .cta-buttons .btn {
        width: 100%;
    }

    /* Contact Page Mobile */
    .contact-page .col-md-4 {
        margin-bottom: 20px;
        /* Add spacing between info cards */
    }

    .contact-info .card {
        margin-bottom: 10px;
    }

    .contact-form-section .row.g-5 {
        gap: 30px !important;
        /* Reduce gap between form and map */
    }

    .contact-form-section .col-lg-6 {
        width: 100%;
    }

    .contact-form-section iframe {
        height: 300px !important;
        /* Fixed height for map on mobile */
    }

    /* Footer Stack */
    .footer-col {
        margin-bottom: 30px;
        text-align: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* ============================
   ORDER SUCCESS / GENERAL
   ============================ */
@media (max-width: 768px) {
    .success-icon {
        font-size: 50px !important;
    }

    .order-details-table {
        font-size: 13px;
    }
}

/* ============================
   MOBILE NAVBAR & ICON FIXES
   ============================ */
@media (max-width: 768px) {

    /* Adjust Navbar Height & Spacing */
    .navbar-inner {
        padding: 0 15px !important;
        height: 60px !important;
        justify-content: space-between !important;
    }

    /* Logo Sizing */
    .logo-img {
        height: 28px !important;
        /* Smaller logo for mobile */
    }

    .logo-text {
        font-size: 0.9rem !important;
        display: block !important;
        /* Ensure visible */
    }

    /* Icon Container */
    .navbar-icons {
        gap: 5px !important;
        /* Reduce gap between icons */
        margin-right: -5px !important;
        /* Slight pull right to align with edge */
        display: flex !important;
        flex-wrap: nowrap !important;
    }

    /* Touch Targets & Icon Alignment */
    .navbar-icons .icon-btn,
    .navbar-icons .account-btn,
    .navbar-icons .search-toggle {
        width: 40px !important;
        height: 40px !important;
        font-size: 18px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Wishlist Icon Force Show */
    .navbar-icons a[href*="wishlist"] {
        display: flex !important;
    }

    /* Badge Positioning */
    .cart-badge {
        top: 2px !important;
        right: 2px !important;
        font-size: 9px !important;
        width: 16px !important;
        height: 16px !important;
        line-height: 16px !important;
    }

    /* Account Dropdown Fix */
    .account-dropdown {
        position: static !important;
        /* Allow dropdown to use screen width */
    }

    .dropdown-menu-premium {
        position: absolute !important;
        right: 10px !important;
        left: 10px !important;
        width: auto !important;
        top: 60px !important;
        /* Below navbar */
        border-radius: 12px !important;
    }
}