/* ========================================
   DENTALOWL MOBILE-FIRST OPTIMIZATIONS
   Frictionless journey: browse → cart → checkout → order
   ======================================== */

/* ----------------------------------------
   STICKY BOTTOM ACTION BAR
   Cart & Checkout - always-visible CTA
   ---------------------------------------- */

.dentalowl-mobile-bar {
    display: none;
}

@media (max-width: 991.98px) {
    .dentalowl-mobile-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1030;
        background: var(--do-white, #fff);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
        padding: 12px 16px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
        align-items: center;
        gap: 16px;
        padding-inline: max(16px, env(safe-area-inset-left));
        padding-inline-end: max(16px, env(safe-area-inset-right));
    }
    
    .dentalowl-mobile-bar .bar-total {
        flex: 1;
        font-size: 1.125rem;
        font-weight: 700;
        color: var(--do-gray-800, #1f2937);
    }
    
    .dentalowl-mobile-bar .bar-total span {
        color: var(--do-primary, #2563EB);
    }
    
    .dentalowl-mobile-bar .bar-btn {
        flex-shrink: 0;
        min-height: 48px;
        min-width: 140px;
        padding: 12px 24px;
        font-size: 1rem;
        font-weight: 600;
        border-radius: 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Prevent content from hiding under sticky bar */
    .dentalowl-cart-section,
    .dentalowl-checkout-section {
        padding-bottom: 100px !important;
    }
}

/* ----------------------------------------
   TAP TARGETS (min 48x48px)
   ---------------------------------------- */

@media (max-width: 991.98px) {
    .dentalowl-tap-target {
        min-width: 48px;
        min-height: 48px;
        padding: 12px;
    }
    .navbar-md .btn[data-bs-toggle="offcanvas"],
    .navbar-md .fa-navicon,
    .shopingicon a,
    .shopingicon .ionicon-bag-handle-outline,
    .shopingicon .ionicon-person-outline,
    .shopingicon .ionicon-cart-outline,
    .navbar-md .list-unstyled li a {
        min-width: 48px;
        min-height: 48px;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }
    
    .offcanvas-body .list-unstyled li a {
        min-height: 48px;
        padding: 12px 0;
        display: flex;
        align-items: center;
    }
    
    .offcanvas-body .menu-icon {
        min-width: 28px;
        font-size: 1.25rem;
    }
    
    /* Cart quantity +/- buttons */
    .plus-btn,
    .minus-btn,
    .input-group-button .button {
        min-width: 44px !important;
        min-height: 44px !important;
        padding: 10px !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .product-quantity input,
    .input-field-cart-modal,
    .in-num {
        min-height: 44px !important;
        font-size: 1rem !important;
        text-align: center;
    }
    
    /* Product card Add to Cart */
    .add-in-cart-btn,
    .add_to_cart,
    .btn.add-in-cart-btn {
        min-height: 44px;
        padding: 10px 16px;
        font-size: 0.9375rem;
    }
    
    /* Checkout/Delivery option buttons */
    .btn-delivery,
    .btn-check + label.btn {
        min-height: 44px;
        padding: 12px 20px;
    }
}

/* ----------------------------------------
   REDUCE VERTICAL NOISE
   ---------------------------------------- */

@media (max-width: 991.98px) {
    .checkout-step {
        padding-top: 1rem !important;
        padding-bottom: 1.5rem !important;
    }
    
    .checkout-step h3 {
        font-size: 0.9rem;
    }
    
    .cart-page-title .checkout-step {
        padding: 1rem 0 !important;
    }
    
    .billing-detail-section .checkout-page-titles,
    .checkout-page-titles {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .charges-section,
    .ordered-subtotal-section {
        padding: 0.5rem 0;
    }
    
    .delivery-promise-banner {
        padding: 10px 14px !important;
        font-size: 0.875rem;
    }
}

/* ----------------------------------------
   FORM & KEYBOARD FLOW
   ---------------------------------------- */

@media (max-width: 991.98px) {
    .form-control,
    .form-select,
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"] {
        min-height: 48px;
        font-size: 16px !important; /* Prevents iOS zoom on focus */
        padding: 12px 16px;
    }
    
    input[type="tel"] {
        inputmode: tel;
    }
    
    input[type="email"] {
        inputmode: email;
    }
    
    input[type="number"] {
        inputmode: numeric;
    }
    
    #promocode_input {
        min-height: 48px;
        font-size: 16px;
    }
    
    .coupon-box .btn {
        min-height: 48px;
    }
}

/* ----------------------------------------
   CART PAGE - MOBILE
   ---------------------------------------- */

@media (max-width: 767.98px) {
    .cart-table .table {
        font-size: 0.9rem;
    }
    
    .cart-table .product-thumbnail img {
        max-width: 64px;
    }
    
    .cart-total.d-xl-none {
        position: sticky;
        bottom: 0;
        background: #fff;
        padding: 16px;
        margin: 0 -16px -16px -16px;
        box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
        border-radius: 12px 12px 0 0;
    }
    
    .cart-total .btn-primary {
        min-height: 48px;
        font-size: 1rem;
        font-weight: 600;
    }
}

/* ----------------------------------------
   CHECKOUT - READABILITY & ORDER SUMMARY
   ---------------------------------------- */

@media (max-width: 991.98px) {
    .order-checkout-detail {
        border: 1px solid var(--do-gray-200, #e5e7eb);
        border-radius: 12px;
        padding: 16px;
        margin-top: 1rem;
    }
    
    .ordered-product {
        padding-bottom: 1rem !important;
    }
    
    .ordered-product-img {
        max-width: 64px;
    }
    
    .ordered-product-info p {
        font-size: 0.9rem;
    }
    
    .final-order-total {
        font-size: 1.1rem;
    }
}

/* ----------------------------------------
   PRODUCT LISTING CARDS - MOBILE
   ---------------------------------------- */

@media (max-width: 575.98px) {
    .grid-card-container {
        padding: 6px !important;
    }
    
    .grid-view-card .card-body {
        padding: 10px 12px !important;
    }
    
    .grid-view-card .card-title {
        font-size: 0.9rem;
        line-height: 1.3;
    }
    
    .img-box-h250 {
        min-height: 140px;
        aspect-ratio: 1;
        object-fit: cover;
    }
}

/* ----------------------------------------
   IMAGE - LAYOUT SHIFT PREVENTION
   ---------------------------------------- */

.img-box-h250,
.product-img .pic-1,
.cart-img-box .pic-1 {
    aspect-ratio: 1;
    object-fit: cover;
}

.product-thumbnail img {
    aspect-ratio: 1;
    object-fit: cover;
}
