/* ============================================================
   Doha Quest Booking Pages — Mobile Responsive Overrides
   File: booking2-mobile.css
   Loaded AFTER wpos-booking.css and booking2.css
   Contains ONLY @media query blocks.
   ============================================================ */


/* ============================================================
   @media (max-width: 1199px)  — large tablets / small laptops
   ============================================================ */
@media only screen and (max-width: 1199px) {

  /* Tighten booking wrap padding slightly */
  .wpos-bw-booking-wrap {
    padding: 22px;
  }

  /* Breadcrumb: shrink font slightly */
  .wpos-wc-bw-bkn a {
    font-size: 0.83rem;
  }

  /* Datepicker: prevent any horizontal bleed */
  .wpos-wcb-datepicker .ui-datepicker {
    min-width: 260px;
  }
}


/* ============================================================
   @media (max-width: 991px)  — tablets portrait + small laptops
   Mirrors wpos-booking.css "max-width: 991px" block and extends
   ============================================================ */
@media only screen and (max-width: 991px) {

  /* --- Booking layout: right sidebar drops below tickets column --- */
  .wpos-bw-booking-wrap {
    flex-direction: column;
  }
  .wpos-bw-booking-left,
  .wpos-bw-booking-right {
    flex: 1 1 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  /* Mini cart sidebar no longer sticky at tablet */
  .wpos-bw-booking-right {
    position: static !important;
    top: auto !important;
  }

  /* --- Checkout: order summary stacks below form --- */
  .wpos-bw-booking-wrap .row.g-4 > .col-lg-7,
  .wpos-bw-booking-wrap .row.g-4 > .col-lg-5 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  /* Un-sticky order summary panel on tablet */
  .wpos-bw-booking-wrap .row.g-4 > .col-lg-5 > div[style*="sticky"] {
    position: static !important;
    top: auto !important;
  }

  /* --- Breadcrumb: reduce text size --- */
  .wpos-wc-bw-bkn a {
    font-size: 0.80rem;
  }
  .wpos-wc-bw-step-timer-wrp {
    padding: 12px 16px;
  }

  /* --- Category card: stack image above content --- */
  .wpos-wc-bw-product-cat-list {
    flex-direction: column;
  }
  .wpos-wc-bw-product-pcat .wpos-wc-bw-cat-img-wrp,
  .wpos-wc-bw-product-pcat .wpos-wc-bw-cat-cnt-wrp {
    flex-basis: 100% !important;
    width: 100% !important;
  }
  .wpos-wc-bw-product-pcat .wpos-wc-bw-cat-img {
    border-radius: 8px 8px 0 0 !important;
  }

  /* --- Timeslots: 3 per row (already in wpos-booking.css; reinforce) --- */
  .wpos-wcb-time-slot {
    width: calc(33.33% - 20px);
  }

  /* --- Cart totals: full width on tablet --- */
  .wpos-wc-bw-cart-total-wrap {
    max-width: 100% !important;
    margin-left: 0 !important;
  }

  /* --- Cart action buttons: stack vertically --- */
  .wpos-bw-booking-wrap .d-flex.justify-content-between.align-items-center.mt-4 {
    flex-direction: column;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .wpos-bw-booking-wrap .d-flex.justify-content-between.align-items-center.mt-4 a {
    width: 100%;
    text-align: center;
  }

  /* --- Parent-category page title --- */
  .wpos-wc-bw-parent-cat-ttl {
    font-size: 1.15rem;
  }
}


/* ============================================================
   @media (max-width: 767px)  — tablets narrow / large phones
   Mirrors wpos-booking.css "max-width: 767px" block and extends
   ============================================================ */
@media only screen and (max-width: 767px) {

  /* --- Page header --- */
  .booking-page-header {
    padding: 18px 0 14px !important;
  }
  .booking-page-title {
    font-size: 1.4rem;
  }

  /* --- Booking wrap: reduce internal padding --- */
  .wpos-bw-booking-wrap {
    padding: 16px;
  }

  /* --- Breadcrumb bar wrapper --- */
  .wpos-wc-bw-step-timer-wrp {
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 10px 12px;
    gap: 8px;
  }
  /* Keep step text labels visible but small — scroll horizontally if needed */
  .wpos-wc-bw-bkn-wrap ul li span {
    display: inline !important;
    font-size: 0.72rem;
    white-space: nowrap;
  }
  .wpos-wc-bw-bkn-wrap ul {
    gap: 4px !important;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none; /* Firefox */
  }
  .wpos-wc-bw-bkn-wrap ul::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
  }
  .wpos-wc-bw-bkn a {
    font-size: 0.72rem;
    white-space: nowrap;
    padding-bottom: 2px;
  }
  /* Chevron separator: keep it small */
  .wpos-wc-bw-icon-right {
    font-size: 0.65rem;
    margin: 0 1px;
  }
  .wpos-wc-bw-icon-left {
    margin: 0 4px 0 0;
  }

  /* --- Session timer pill: full width on narrow screens --- */
  #dq-session-timer {
    font-size: 0.78rem !important;
    padding: 4px 10px !important;
  }

  /* --- Category card (tickets.html) --- */
  .wpos-wc-bw-product-cat-list {
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
  }
  .wpos-wc-bw-cat-img,
  .wpos-wc-bw-cat-img-inr img {
    min-height: 200px !important;
    height: 200px !important;
    border-radius: 8px 8px 0 0 !important;
  }
  .wpos-wc-bw-cat-cnt-wrp {
    padding: 16px !important;
    text-align: center;
  }
  .wpos-wc-bw-cat-ttl,
  .wpos-wc-bw-cat-ttl a {
    font-size: 1rem !important;
  }
  .mwbook-book-btn {
    width: 100%;
    text-align: center;
    display: block;
  }

  /* --- Accordion heading (tickets-select.html) --- */
  .wpos-wc-bw-acc-heading,
  .wpos-wc-bw-product-ccat .wpos-wc-bw-acc-heading {
    font-size: 0.90rem;
    padding: 12px 14px !important;
  }
  .wpos-wcb-booking-ct-icon {
    gap: 6px;
    flex-wrap: wrap;
  }
  /* Accordion icon stays right */
  .wpos-wc-bw-acc-icon {
    flex-shrink: 0;
  }

  /* --- Date picker header row --- */
  .wpos-wcb-booking-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .wpos-wcb-change-date {
    align-self: flex-start;
  }
  .wpos-wcb-selected-date {
    font-size: 0.95rem;
  }

  /* --- Datepicker: full width, table-layout:fixed prevents overflow --- */
  .wpos-wcb-booking-inp-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }
  .wpos-wcb-datepicker,
  .wpos-wcb-datepicker .ui-datepicker {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 8px;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  /* KEY FIX: table-layout:fixed distributes 7 cols equally within the 308px box */
  .wpos-wcb-booking-inp-wrap .ui-datepicker-calendar {
    table-layout: fixed !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .wpos-wcb-booking-inp-wrap .ui-datepicker-calendar th,
  .wpos-wcb-booking-inp-wrap .ui-datepicker-calendar td {
    width: auto !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    padding: 2px 1px !important;
  }
  .wpos-wcb-booking-inp-wrap .ui-datepicker td span,
  .wpos-wcb-booking-inp-wrap .ui-datepicker td a {
    font-size: 11px !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    margin: 0 auto !important;
    display: block !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }
  .wpos-wcb-booking-inp-wrap .ui-datepicker th {
    font-size: 11px !important;
    padding: 6px 2px !important;
    text-align: center !important;
  }
  .wpos-wcb-datepicker .ui-datepicker-header {
    padding: 8px 6px;
  }
  .wpos-wcb-datepicker .ui-datepicker-title {
    font-size: 0.95rem;
  }
  /* Status legend: wrap onto multiple lines if needed */
  .wpos-wcb-booking-status-wrap {
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.78rem;
  }

  /* --- Ticket list cards: card layout (tickets-select.html) --- */

  /* Card outer — white card, overflow:hidden clips image to rounded corners */
  .wpos-bw-product-list {
    background: #fff !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    border-bottom: none !important;
    margin-bottom: 14px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
  }
  .wpos-bw-product-list:last-child { margin-bottom: 0 !important; }

  /* Inner: zero padding so image bleeds edge-to-edge at top */
  .wpos-bw-product-list-inr {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    padding: 0 !important;
    background-color: #fff !important;
    box-sizing: border-box !important;
    width: 100% !important;
  }
  /* Product image: full-width banner, no border-radius (card clips it).
     Use specificity 0,2,0 to beat booking2-desktop.css's
     .wpos-bw-product-list-inr .wpos-bw-product-img-wrap { max-width:150px !important }  */
  .wpos-bw-product-list-inr .wpos-bw-product-img-wrap,
  .wpos-bw-product-img-wrap {
    flex: 0 0 auto !important;
    max-width: 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    align-self: stretch !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .wpos-bw-product-list-inr .wpos-bw-product-img,
  .wpos-bw-product-img {
    height: 185px !important;
    width: 100% !important;
    max-width: 100% !important;
    object-fit: cover !important;
    border-radius: 0 !important;
    display: block !important;
  }
  /* Content column: horizontal padding, centered text */
  .wpos-bw-product-cnt-wrap {
    width: 100% !important;
    flex-basis: 100% !important;
    min-width: 0 !important;
    padding: 12px 14px 4px !important;
    text-align: center !important;
  }
  /* Meta column: stacked vertically — qty row, then buttons.
     Must override booking2.css global: flex:0 0 210px !important; width:210px !important; max-width:210px !important */
  .wpos-bw-meta-wrap {
    width: 100% !important;
    max-width: 100% !important;     /* beats booking2.css: max-width:210px !important */
    min-width: 0 !important;
    flex: 0 0 auto !important;      /* beats booking2.css: flex:0 0 210px !important */
    flex-basis: auto !important;
    flex-direction: column !important;
    align-items: stretch !important;
    box-sizing: border-box !important;
    gap: 8px !important;
    padding: 4px 14px 14px !important;
  }
  /* Total price at bottom.
     Must override booking2.css global: flex:0 0 90px !important; width:90px !important; max-width:90px !important */
  .wpos-bw-total-price-wrap {
    width: 100% !important;
    max-width: 100% !important;     /* beats booking2.css: max-width:90px !important */
    min-width: 0 !important;
    flex: 0 0 auto !important;
    box-sizing: border-box !important;
    padding: 0 14px 12px !important;
    text-align: center !important;
  }
  /* Accordion content: reduce horizontal padding so cards get full ~340px width
     (beats booking2-desktop.css: .wpos-wc-bw-acc-content { padding:20px 15px !important }) */
  .wpos-wc-bw-acc-content {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  /* View Cart wrap inherits meta padding */
  .dq-view-cart-wrap { width: 100% !important; }

  /* --- Qty pill buttons: shrink from 110px to 44px on mobile --- */
  .wpos-bw-product-list .quantity .wpos-bw-qty-btn,
  .quantity .wpos-bw-qty-btn {
    width: 44px !important;
    min-width: 44px !important;
    font-size: 1.1rem;
    padding: 0;
  }
  /* Qty stepper: compact pill centered — match original's max-width:50% from wpos-booking.css.
     specificity 0,3,0 so this wins over wpos-booking.css 0,3,0 (same spec, later in cascade) */
  .wpos-bw-product-list .wpos-bw-meta-wrap .quantity {
    width: auto !important;
    max-width: 50% !important;
    align-self: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  /* Add to Cart wrapper: full-width so button spans the card */
  .wpos-bw-product-list .wpos-bw-meta-wrap .wpos-bw-product-add-to-cart {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  /* "Add to Cart" button: force block + full width
     specificity 0,3,0 to beat booking2-desktop.css inline-block !important */
  .wpos-bw-product-list .wpos-bw-meta-wrap .wpos-wc-add-to-cart-btn,
  .wpos-bw-product-list .wpos-bw-meta-wrap .dq-add-single {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
    font-size: 1rem !important;
  }
  /* View Cart WRAPPER: only sizing — NO display override so style="display:none" is respected.
     JS controls visibility via inline style. */
  .wpos-bw-product-list .wpos-bw-meta-wrap .dq-view-cart-wrap {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  /* View Cart link (inner <a>): full-width block when the wrapper IS shown */
  .wpos-bw-product-list .wpos-bw-meta-wrap .dq-view-cart-btn {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
  }
  /* Kill booking2-desktop.css specificity-0,2,0 rule that adds pb:30px and mb:30px
     to .wpos-wc-bw-accordion-wrap .wpos-bw-product-list-inr — we handle spacing via
     the outer card's margin-bottom instead */
  .wpos-wc-bw-accordion-wrap .wpos-bw-product-list-inr {
    padding: 0 !important;
    margin-bottom: 0 !important;
    border-bottom: none !important;
  }

  /* dq-qty-ctrl container: full width on mobile */
  .wpos-bw-product-list .dq-qty-ctrl,
  .quantity.dq-qty-ctrl {
    width: 100%;
    justify-content: center;
  }
  /* Qty input: flex-grow fills remaining space inside the 50%-wide stepper */
  .dq-qty-ctrl .dq-qty-input,
  .wpos-bw-product-list .dq-qty-input {
    flex: 1 1 auto;
    min-width: 0;
  }

  /* --- Ticket total bar footer (tickets-select.html) --- */
  .dq-ticket-total-bar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    padding: 12px 14px;
  }
  .dq-ticket-total-bar a.btn {
    width: 100%;
    text-align: center;
  }

  /* --- Mini cart sidebar: full width when it shows --- */
  #dq-mini-cart,
  .wpos-wc-bw-cart-side-widget {
    width: 100% !important;
  }

  /* --- Cart page (cart.html): table scroll wrapper --- */
  .wpos-wc-bw-cart-form-wrp {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
  .wpos-wc-bw-cart-table {
    min-width: 480px; /* force scroll on very narrow screens */
    font-size: 0.85rem;
  }
  .wpos-wc-bw-cart-table th,
  .wpos-wc-bw-cart-table td {
    padding: 10px 8px !important;
  }
  /* Cart totals table: full width */
  .wpos-wc-bw-cart-total-wrap {
    max-width: 100% !important;
    margin-left: 0 !important;
    width: 100%;
  }
  .wpos-wc-bw-cart-total-wrap .table {
    width: 100%;
  }
  /* Visit date meta box */
  .dq-cart-meta {
    font-size: 0.88rem;
  }

  /* --- Cart action buttons row (cart.html) --- */
  .wpos-bw-booking-wrap .d-flex.justify-content-between.align-items-center.mt-4 {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .wpos-bw-booking-wrap .d-flex.justify-content-between.align-items-center.mt-4 a {
    width: 100%;
    text-align: center;
  }

  /* --- Checkout form (checkout.html): all fields go full width --- */
  .wpos-bw-booking-wrap .row.g-4 {
    flex-direction: column;
  }
  .wpos-bw-booking-wrap .row.g-4 > div[class*="col-lg"] {
    flex: 0 0 100%;
    max-width: 100%;
  }
  /* Billing form inner: all col-sm-* fields go full width */
  #dq-checkout-form .col-sm-6,
  #dq-checkout-form .col-sm-4 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  /* Order summary panel: un-sticky */
  .wpos-bw-booking-wrap .row.g-4 > .col-lg-5 > div {
    position: static !important;
    top: auto !important;
  }
  /* Place Order button: already 100% wide, keep it */
  #dq-place-order-btn {
    font-size: 1rem !important;
  }
  /* Coupon bar */
  .dq-coupon-bar {
    font-size: 0.85rem;
  }

  /* --- Breadcrumb / stepper + timer: step-timer wrap on narrow --- */
  .wpos-wc-bw-cart-cnt-wrp,
  .wpos-wc-bw-step-timer-wrp {
    flex-direction: column !important;
  }

  /* --- Confirmation page: order detail tables scroll --- */
  .woocommerce-order-details,
  .woocommerce-customer-details {
    overflow-x: auto;
  }
  .woocommerce table.shop_table {
    min-width: 320px;
  }

  /* --- Popup / date change modal --- */
  .wpos-wc-bw-popup-data-wrp {
    min-width: 0 !important;
    max-width: 95vw !important;
    width: 95vw !important;
  }
  .wpos-wc-bw-popup-data-cnt {
    max-width: 95vw !important;
    margin: 0.75rem auto !important;
    padding: 16px !important;
  }

  /* --- Qty error text --- */
  .wpos-bw-qty-err {
    text-align: center;
  }

  /* --- Show/hide desktop helpers from original plugin --- */
  .wpos-show-mobile {
    display: block !important;
  }
  .wpos-show-desktop {
    display: none !important;
  }
}


/* ============================================================
   @media (max-width: 576px)  — small phones (iPhone SE, etc.)
   ============================================================ */
@media only screen and (max-width: 576px) {

  /* --- Page header --- */
  .booking-page-header {
    padding: 14px 0 10px !important;
  }
  .booking-page-title {
    font-size: 1.2rem;
  }

  /* --- Booking wrap: minimal padding on tiny screens --- */
  .wpos-bw-booking-wrap {
    padding: 12px !important;
    border-radius: 6px;
  }

  /* --- Breadcrumb: icon-only mode already active at 767px.
        On 576px make the step-timer wrap even tighter. --- */
  .wpos-wc-bw-step-timer-wrp {
    padding: 8px 10px;
    border-radius: 6px;
  }
  .wpos-wc-bw-bkn-wrap ul {
    gap: 6px !important;
  }
  .wpos-wc-bw-bkn a {
    font-size: 0.72rem;
  }

  /* --- Category card image: 200px min-height --- */
  .wpos-wc-bw-cat-img,
  .wpos-wc-bw-cat-img-inr img {
    min-height: 200px !important;
    height: 200px !important;
  }

  /* --- Accordion heading: even smaller font --- */
  .wpos-wc-bw-product-ccat .wpos-wc-bw-acc-heading {
    font-size: 0.82rem !important;
    padding: 10px 12px !important;
  }

  /* --- Datepicker cells: smallest readable size --- */
  .wpos-wcb-booking-inp-wrap .ui-datepicker td span,
  .wpos-wcb-booking-inp-wrap .ui-datepicker td a {
    font-size: 10px;
    width: 28px;
    height: 28px;
    line-height: 28px;
  }
  .wpos-wcb-booking-inp-wrap .ui-datepicker th {
    font-size: 11px;
    padding: 6px 2px !important;
  }
  .wpos-wcb-datepicker .ui-datepicker {
    padding: 6px;
  }

  /* --- Ticket card: keep zero-padding inner, reduce image height --- */
  .wpos-bw-product-list-inr {
    padding: 0 !important;
    gap: 0 !important;
  }
  .wpos-bw-product-img {
    height: 160px !important;
  }
  .wpos-bw-price-wrap .woocommerce-Price-amount {
    font-size: 1.1rem;
  }
  .wpos-bw-desc {
    font-size: 0.92rem;
  }
  .wpos-bw-short-desc {
    font-size: 0.78rem;
  }

  /* --- Qty buttons: 44px already set; reinforce on 576 --- */
  .wpos-bw-product-list .quantity .wpos-bw-qty-btn,
  .quantity .wpos-bw-qty-btn {
    width: 44px !important;
  }
  /* Qty input */
  .wpos-bw-product-list .quantity .qty,
  .dq-qty-ctrl .dq-qty-input {
    font-size: 0.95rem;
  }

  /* --- Meta wrap: go vertical again on very small phones --- */
  .wpos-bw-meta-wrap {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  /* --- Cart table: even tighter on small phones --- */
  .wpos-wc-bw-cart-table {
    font-size: 0.80rem;
  }
  .wpos-wc-bw-cart-table th,
  .wpos-wc-bw-cart-table td {
    padding: 8px 6px !important;
    white-space: normal !important;
  }

  /* --- Checkout form fields: full width already; reduce label font --- */
  .form-label.fw-600 {
    font-size: 0.82rem;
  }
  .dq-field {
    font-size: 0.88rem;
    padding: 8px 10px;
  }

  /* --- Coupon bar --- */
  #dq-coupon-toggle {
    font-size: 0.82rem !important;
  }
  .dq-coupon-bar .input-group {
    flex-direction: column;
    gap: 6px;
  }
  .dq-coupon-bar .input-group input,
  .dq-coupon-bar .input-group .btn {
    width: 100% !important;
    border-radius: 6px !important;
  }

  /* --- Order summary: compact --- */
  #dq-co-lines.table th,
  #dq-co-lines.table td {
    font-size: 0.83rem;
    padding: 6px 8px;
  }

  /* --- Ticket total bar --- */
  .dq-ticket-total-bar {
    padding: 10px 12px;
  }
  #dq-ticket-total-amount {
    font-size: 1.1rem !important;
  }

  /* --- Confirmation page: order received message --- */
  .woocommerce-thankyou-order-received {
    font-size: 0.95rem;
  }
  .woocommerce ul.order_details {
    padding: 14px;
  }
  .woocommerce ul.order_details li {
    font-size: 0.85rem;
  }
}


/* ============================================================
   @media (max-width: 420px)  — very small phones
   ============================================================ */
@media only screen and (max-width: 420px) {

  /* Breadcrumb: remove gap between items almost entirely */
  .wpos-wc-bw-bkn-wrap ul {
    gap: 4px !important;
  }
  /* Page title */
  .booking-page-title {
    font-size: 1.05rem;
  }

  /* Booking wrap */
  .wpos-bw-booking-wrap {
    padding: 10px !important;
  }

  /* Datepicker cells: minimal */
  .wpos-wcb-booking-inp-wrap .ui-datepicker td span,
  .wpos-wcb-booking-inp-wrap .ui-datepicker td a {
    font-size: 9px;
    width: 24px;
    height: 24px;
    line-height: 24px;
  }
  .wpos-wcb-booking-inp-wrap .ui-datepicker th {
    font-size: 9px;
    padding: 4px 1px !important;
  }

  /* Ticket card image: reduce to 100px to save space */
  .wpos-bw-product-img {
    height: 100px !important;
  }

  /* Cart table: allow full horizontal scroll */
  .wpos-wc-bw-cart-table {
    min-width: 380px;
  }
}


/* ============================================================
   @media (min-width: 576px) and (max-width: 767px)  — sm range
   Mirrors wpos-booking.css sm block; adds our overrides
   ============================================================ */
@media only screen and (min-width: 576px) and (max-width: 767px) {

  /* Category cards: allow 2-up grid on sm screens */
  .wpos-wc-bw-cat-wrap .col-sm-10 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  /* Ticket card meta: side-by-side qty + add-to-cart */
  .wpos-bw-meta-wrap {
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap;
    gap: 10px !important;
  }
  /* Qty control takes its natural width */
  .wpos-bw-product-list .quantity,
  .quantity.dq-qty-ctrl {
    width: auto !important;
    max-width: none !important;
  }
  /* Add-to-cart button: auto-grows */
  .wpos-bw-product-list .wpos-wc-add-to-cart-btn,
  .wpos-bw-product-list .wpos-bw-product-add-to-cart {
    width: auto !important;
    flex: 1 1 auto;
  }
}


/* ============================================================
   @media (min-width: 768px) and (max-width: 991px)  — md range
   ============================================================ */
@media only screen and (min-width: 768px) and (max-width: 991px) {

  /* Ticket card: image smaller, meta wraps below */
  .wpos-bw-product-img {
    height: 130px !important;
  }

  /* Mini cart sidebar: full width when stacked */
  .wpos-bw-booking-right {
    width: 100% !important;
    flex: 1 1 100% !important;
  }
  .wpos-wc-bw-cart-side-widget {
    width: 100%;
  }

  /* Cart table: readable without scroll at md */
  .wpos-wc-bw-cart-table {
    min-width: 0;
    width: 100%;
    font-size: 0.88rem;
  }

  /* Checkout: form and summary both full width */
  .wpos-bw-booking-wrap .row.g-4 > .col-lg-7,
  .wpos-bw-booking-wrap .row.g-4 > .col-lg-5 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}


/* ============================================================
   Utility: ensure no horizontal overflow on booking pages
   (applied unconditionally to all small sizes)
   ============================================================ */
@media only screen and (max-width: 991px) {

  .booking-page-wrap {
    overflow-x: hidden;
  }
  /* Make sure wpos-bw-booking-wrap doesn't push page width */
  .wpos-bw-booking-wrap,
  .wpos-wc-bw-step-timer-wrp {
    max-width: 100%;
    box-sizing: border-box;
  }
  /* wcb booking field wrap: allow wrap on tablet */
  .wpos-wcb-booking-field-wrap {
    flex-wrap: wrap;
  }
  /* Status dots wrap on tablet */
  .wpos-wcb-booking-status-wrap {
    flex-wrap: wrap;
  }
}

/* ============================================================
   QA FIXES — 2026-06-14
   ============================================================ */

/* FIX 5 + 6: Cart actions — stack vertically on mobile, checkout btn full-width */
@media (max-width: 767px) {
  .dq-cart-actions {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .dq-cart-actions .dq-checkout-btn {
    width: 100% !important;
    text-align: center !important;
    display: block !important;
  }
  .dq-cart-actions .btn-outline-secondary {
    width: 100% !important;
    text-align: center !important;
    display: block !important;
  }
}

/* FIX 7 + 8: Confirmation card — reduce padding and full-width CTA buttons on mobile */
@media (max-width: 576px) {
  .dq-conf-card {
    padding: 28px 16px !important;
  }
  .dq-conf-actions .btn-home,
  .dq-conf-actions .btn-more {
    width: 100% !important;
    text-align: center !important;
    display: block !important;
  }
  .dq-conf-actions {
    flex-direction: column !important;
    gap: 10px !important;
  }
}


/* ============================================================
   MOBILE LAYOUT CORE FIXES — 2026-06-15
   ============================================================ */

/* FIX A: Reduce the huge py-5 (48px) container padding on mobile */
@media (max-width: 767px) {
  .booking-page-wrap {
    padding-top: 1.25rem !important;
    padding-bottom: 1.5rem !important;
  }

  /* Tighten top margin on booking wrap */
  .wpos-bw-booking-wrap {
    margin-top: 0.5rem !important;
  }
  /* Step 2 wpos-wc-bw-product-cat-acc wrapper also has mt-4 via parent */
  .wpos-wc-bw-product-cat-acc {
    margin-top: 0 !important;
  }

  /* Step 3: empty cart state has Bootstrap py-5 (48px) — reduce on mobile */
  #dq-empty-cart {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }
}

/* FIX B: Checkout billing form — 1 column on mobile (2-column grid too tight at <768px) */
@media (max-width: 767px) {
  .woocommerce-billing-fields__field-wrapper {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }
  /* Ensure all form-row elements take full width */
  .woocommerce-billing-fields__field-wrapper .form-row-first,
  .woocommerce-billing-fields__field-wrapper .form-row-last {
    width: 100% !important;
    float: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* FIX C: Step 1 category card — stack vertically on mobile */
@media (max-width: 767px) {
  .wpos-bw-booking-wrap .wpos-wc-bw-product-cat-list.wpos-wc-bw-has-cat-img {
    flex-direction: column !important;
  }

  .wpos-bw-booking-wrap .wpos-wc-bw-cat-img-wrp {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  .wpos-bw-booking-wrap .wpos-wc-bw-cat-img {
    border-radius: 12px 12px 0 0 !important;
    height: 200px !important;
    min-height: 200px !important;
  }

  .wpos-bw-booking-wrap .wpos-wc-bw-cat-cnt-wrp {
    flex: 1 1 100% !important;
    padding: 20px !important;
    text-align: center !important;
  }

  .wpos-bw-booking-wrap .wpos-wc-bw-cat-ttl {
    font-size: 22px !important;
    line-height: 30px !important;
    margin-bottom: 12px !important;
  }
}


/* ============================================================
   AGENT FIXES — 2026-06-15 (from parallel audit agents)
   ============================================================ */

/* ── CART PAGE (cart.html) ─────────────────────────────────
   Root cause: .kadence-woo-cart-form-wrap uses flex-basis:0% on
   the cart form and flex: 0 0 310px on collaterals → at 390px
   the form gets crushed to 5px, collaterals appear first.
   Fix: stack to column on mobile, all children full width.
   ─────────────────────────────────────────────────────────── */
@media only screen and (max-width: 767px) {

  .kadence-woo-cart-form-wrap {
    flex-direction: column !important;
    gap: 20px !important;
    align-items: stretch !important;
  }

  form.woocommerce-cart-form.wpos-wc-bw-cart-form-wrp {
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
  }

  .cart-collaterals.wpos-wc-bw-cart-collaterals-wrp {
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .wpos-wc-bw-cart-collaterals-wrp .cart_totals {
    width: 100% !important;
  }

  /* Cart table — let browser distribute columns naturally, keep within viewport */
  form.woocommerce-cart-form .shop_table.cart {
    width: 100% !important;
    font-size: 0.78rem !important;
  }

  /* Tighten headers so SUBTOTAL fits without overflow */
  form.woocommerce-cart-form .shop_table.cart th {
    font-size: 0.66rem !important;
    white-space: nowrap !important;
    letter-spacing: 0 !important;
    padding: 8px 4px !important;
  }

  form.woocommerce-cart-form .shop_table.cart td {
    padding: 10px 5px !important;
    vertical-align: top !important;
  }

  /* Product thumbnail in cart rows — responsive size */
  td.product-thumbnail {
    width: 56px !important;
    padding: 8px 4px !important;
  }

  td.product-thumbnail img {
    width: 48px !important;
    height: 48px !important;
    max-width: 100% !important;
  }

  /* Trim the verbose booking meta to avoid overflow */
  .wpos-wc-bw-cart-form-wrp .wc-item-meta,
  .wpos-wc-bw-cart-form-wrp .wc-item-meta li {
    font-size: 0.70rem !important;
    line-height: 1.3 !important;
  }
}


/* ── CHECKOUT PAGE (checkout.html) ────────────────────────
   Root cause: Bootstrap 4 .form-row { display:flex } turns every
   WooCommerce billing <p class="form-row"> into a flex row.
   Label (~119px) and input span sit side-by-side → inputs get
   only 197px instead of full card width (~316px).
   Fix: force .form-row back to display:block inside billing fields.
   ─────────────────────────────────────────────────────────── */
@media (max-width: 767px) {

  /* Kill Bootstrap flex collision on WC billing form-rows */
  .woocommerce .woocommerce-billing-fields .form-row,
  .woocommerce-page .woocommerce-billing-fields .form-row,
  .woocommerce-billing-fields p.form-row {
    display: block !important;
    flex-direction: unset !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
  }

  /* Label stacks above input */
  .woocommerce-billing-fields p.form-row label,
  .woocommerce-billing-fields .form-row label.required_field {
    display: block !important;
    width: 100% !important;
    margin-bottom: 4px !important;
  }

  /* Input wrapper and input take full width */
  .woocommerce-billing-fields .woocommerce-input-wrapper {
    display: block !important;
    width: 100% !important;
  }
  .woocommerce-billing-fields .input-text,
  .woocommerce-billing-fields input.input-text {
    width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
  }

  /* col2-set and order_review: contain within column flex */
  form.checkout.woocommerce-checkout .col2-set {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  form.checkout.woocommerce-checkout #order_review {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* Billing card containment */
  .woocommerce-billing-fields {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .woocommerce-billing-fields__field-wrapper {
    grid-template-columns: 1fr !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    gap: 0 !important;
  }
}

@media (max-width: 576px) {
  /* Re-affirm block layout at small phones */
  .woocommerce-billing-fields .form-row,
  .woocommerce-billing-fields p.form-row {
    display: block !important;
  }
  .woocommerce-billing-fields .input-text {
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* ============================================================
   Booking header — mobile layout
   Original bookings.dohaquest.com at <=767px shows only:
     [quest logo]          [≡ hamburger]
   Nav text links and cart icon are hidden.
   ============================================================ */
@media (max-width: 767px) {
  /* Tighter side padding on small screens */
  .dq-booking-header-inner {
    padding: 0 16px !important;
  }

  /* Hide text nav links (Overview, Tickets, My Account) and cart icon */
  .dq-booking-nav .dq-nav-link,
  .dq-booking-nav .dq-cart-icon-link {
    display: none !important;
  }

  /* Hide the nav container gap/flex when all links are gone */
  .dq-booking-nav {
    gap: 0 !important;
  }

  /* Show hamburger button */
  .dq-mobile-hamburger {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}

/* ─── Hide WP Booking mini-cart sidebar on mobile (replaced by "Your Order") ─ */
@media (max-width: 767px) {
  /* specificity 0,2,0 to beat booking2-desktop.css .wpos-bw-booking-wrap .wpos-bw-booking-right { display:block !important } */
  .wpos-bw-booking-wrap .wpos-bw-booking-right,
  .wpos-bw-booking-right {
    display: none !important;
  }
}
