/****************************
 * AIRDEAL RESPONSIVE FIXES *
 ****************************/

/* Base responsive guardrails */
html,
body,
#root {
  max-width: 100%;
  overflow-x: hidden;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

button,
a,
input,
select,
textarea {
  min-width: 0;
}

.container,
.container-lg {
  width: 100%;
}

.row {
  min-width: 0;
}

.row > * {
  min-width: 0;
}

.product-card,
.content-card,
.cart-table,
.cart-sidebar,
.checkout-sidebar,
.shop-sidebar__box,
.footer-item,
.payment-item,
.product-details__content {
  min-width: 0;
}

.product-card__content,
.product-card__price,
.table-product__content,
.checkout-sidebar,
.footer-item {
  overflow-wrap: anywhere;
}

.product-card__price {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.product-card__cart,
.btn {
  white-space: normal;
}

.slick-slider,
.slick-list,
.slick-track {
  min-width: 0;
}

.table {
  margin-bottom: 0;
}

.overflow-x-auto,
.scroll-sm-horizontal,
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ========================== */
/*  Extra Large ≤1399px       */
/* ========================== */
@media screen and (max-width: 1399px) {
  .container-lg {
    max-width: 1320px;
  }
}

/* ========================== */
/*  Large ≤1199px             */
/* ========================== */
@media screen and (max-width: 1199px) {
  .container-lg {
    max-width: 960px;
  }
}

/* ========================== */
/*  Medium ≤991px             */
/* ========================== */
@media screen and (max-width: 991px) {
  .container-lg {
    max-width: 720px;
  }

  .header-top {
    display: none !important;
  }

  .header-middle .header-inner {
    gap: 12px;
  }

  .header-middle .form-location-wrapper {
    flex: 1 1 auto;
    justify-content: flex-end;
    min-width: 0;
  }

  /* Header middle adjustments */
  .header-middle {
    padding: 12px 0 !important;
  }

  .header-middle .logo img {
    max-width: 160px;
  }

  .header-right {
    flex: 0 0 auto;
  }

  .form-location-wrapper {
    gap: 8px;
  }

  .location-box {
    max-width: min(100%, 260px);
  }

  .location-box select {
    max-width: 190px;
    text-overflow: ellipsis;
  }

  /* Mobile header icons always visible */
  .header-mobile-icons {
    display: flex !important;
    align-items: center;
    gap: 12px;
  }

  .header-mobile-icons .item-hover__text {
    font-size: 20px !important;
  }

  /* Search form on mobile */
  .search-form__wrapper {
    display: none;
  }

  /* Category dropdown on mobile */
  .responsive-dropdown.style-two {
    width: 100% !important;
    max-height: 70vh;
  }

  /* Banner */
  .banner-item {
    padding-block-start: 2rem;
    padding-block-end: 3rem;
    padding-inline-start: 1.5rem;
    padding-inline-end: 1.5rem;
    gap: 1.5rem;
  }

  .banner-slider__item {
    position: relative;
    min-height: 280px;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    padding: 28px;
  }

  .banner-slider__item h1 {
    max-width: 60%;
    font-size: clamp(1.75rem, 4vw, 3rem);
    line-height: 1.12;
    position: relative;
    z-index: 1;
  }

  .banner-slider__item img {
    position: absolute;
    inset-block-end: 0;
    inset-inline-end: 0;
    width: min(46%, 420px);
    height: auto;
    object-fit: contain;
  }

  .banner-item__title {
    font-size: 2rem !important;
  }

  .banner-item__content {
    max-width: 100%;
  }

  /* Product cards */
  .product-card__thumb {
    height: 180px;
  }

  /* Footer */
  .footer-item-wrapper {
    gap: 2rem;
    flex-wrap: wrap;
  }

  .footer-item {
    flex: 0 0 calc(50% - 1rem);
  }
}

/* ========================== */
/*  Small ≤767px              */
/* ========================== */
@media screen and (max-width: 767px) {
  .container-lg {
    max-width: 540px;
    padding-inline: 16px;
  }

  section,
  .py-80,
  .py-120 {
    scroll-margin-top: 72px;
  }

  .header-middle .header-inner {
    align-items: center;
  }

  /* Header top hide on very small */
  .header-top__right {
    width: 100%;
    justify-content: center;
  }

  .header-top .border-right-item:not(:last-child) {
    margin-inline-end: 12px;
    padding-inline-end: 12px;
  }

  /* Header middle */
  .header-middle .logo img {
    max-width: 140px;
  }

  .header-middle .location-box {
    padding: 6px 10px !important;
  }

  .header-middle .location-box select {
    font-size: 12px;
  }

  .search-box .form-control {
    font-size: 16px !important;
    padding-inline-start: 18px !important;
  }

  /* Banner mobile */
  .banner {
    margin-top: 16px;
    margin-bottom: 16px;
  }

  .banner-item {
    mask-image: none !important;
    -webkit-mask-image: none !important;
    border-radius: 16px;
    padding: 1.5rem;
    flex-wrap: wrap;
  }

  .banner-slider__item {
    min-height: auto;
    padding: 24px 18px 18px;
    align-items: center;
    text-align: center;
  }

  .banner-slider__item h1 {
    max-width: 100%;
    font-size: clamp(1.35rem, 8vw, 2rem);
  }

  .banner-slider__item img {
    position: static;
    width: min(100%, 320px);
    margin-top: 14px;
  }

  .banner-slider__item .btn {
    position: relative;
    z-index: 1;
  }

  .banner-item__title {
    font-size: 1.5rem !important;
    margin-block-end: 1rem;
  }

  .banner-item__content {
    max-width: 100%;
    text-align: center;
  }

  .banner-item__thumb img {
    max-width: 220px;
    width: 100%;
  }

  .banner-slider__inner {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }

  /* Categories */
  .categories-home .category-card {
    padding: 12px;
  }

  .categories-home .category-image img {
    height: 100px;
    object-fit: cover;
  }

  .section-heading .flex-between,
  .flex-between {
    align-items: flex-start;
  }

  /* Product card mobile */
  .product-card {
    padding: 12px !important;
  }

  .product-card__thumb {
    height: 140px;
  }

  .product-card__thumb img {
    max-width: 100px !important;
  }

  .product-card__content .title {
    font-size: 0.875rem;
  }

  .product-card__price {
    font-size: 0.875rem;
  }

  .product-card__cart {
    padding: 8px 16px !important;
    font-size: 0.75rem;
    width: 100%;
  }

  .new-arrival .row > [class*="col-"] {
    width: 50%;
  }

  /* Section headings */
  .section-heading {
    margin-bottom: 24px;
  }

  /* Shipping items */
  .shipping-item {
    padding: 1.25rem;
    text-align: center;
  }

  /* Shop page */
  .shop-sidebar {
    width: 280px;
    max-width: 86vw;
  }

  .list-grid-wrapper {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
  }

  .shop .row > .col-lg-9 {
    width: 100%;
  }

  .shop .col-md-3.mb-3 {
    width: 50%;
  }

  .shop .col-md-3.mb-3 a {
    height: 100%;
  }

  /* Product details */
  .product-details__thumb-slider {
    padding: 1.5rem;
  }

  .product-details__thumb img {
    max-height: 280px;
  }

  .product-details__images-slider .slick-slide {
    margin: 0 4px;
  }

  .product-details__content h5 {
    font-size: 1.125rem;
  }

  .product-details__content .flex-align.gap-32 {
    gap: 16px !important;
  }

  .product-details .btn.px-48 {
    width: 100%;
    justify-content: center;
    padding-inline: 24px !important;
  }

  /* User dashboard */
  .user-dashboard .content-card {
    padding: 16px;
  }

  .user-dashboard .user-sidebar {
    width: 280px;
    max-width: 86vw;
  }

  .user-dashboard .user-sidebar__profile {
    padding: 20px;
  }

  /* Cart page */
  .cart-table {
    padding: 20px !important;
  }

  .cart-sidebar {
    padding: 20px !important;
  }

  /* Checkout */
  .checkout .border.border-gray-100.rounded-8.px-30 {
    padding-inline: 16px;
  }

  .checkout .d-flex.justify-content-between,
  .checkout .flex-between,
  .cart .flex-between {
    flex-wrap: wrap;
  }

  /* Tables horizontal scroll */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cart-table table,
  .user-dashboard table {
    min-width: 680px;
  }

  /* Footer */
  .footer {
    padding-top: 60px;
    padding-bottom: 60px;
  }

  .footer-item-wrapper {
    gap: 1.5rem;
  }

  .footer-item {
    flex: 0 0 100%;
  }

  .footer-item__logo img {
    max-width: 160px;
  }

  /* Modals */
  .modal-dialog {
    margin: 16px;
  }

  /* Scroll top button */
  .progress-wrap {
    width: 40px;
    height: 40px;
    line-height: 40px;
    inset-inline-end: 16px;
    inset-block-end: 16px;
  }

  .progress-wrap::after {
    width: 40px;
    height: 40px;
    line-height: 40px;
  }
}

/* ========================== */
/*  Extra Small ≤575px        */
/* ========================== */
@media screen and (max-width: 575px) {
  body {
    font-size: 14px;
  }

  h2, .h2 {
    font-size: 1.5rem;
  }

  h3, .h3 {
    font-size: 1.25rem;
  }

  h4, .h4 {
    font-size: 1.125rem;
  }

  h5, .h5 {
    font-size: 1rem;
  }

  /* Header */
  .header-middle .logo img {
    max-width: 120px;
  }

  .header-middle .header-inner {
    flex-wrap: wrap;
  }

  .header-middle .form-location-wrapper {
    order: 3;
    flex-basis: 100%;
    justify-content: stretch;
  }

  .header-middle .location-box {
    width: 100%;
    max-width: 100%;
  }

  .header-middle .location-box select {
    width: 100%;
    max-width: none;
  }

  .header-right .flex-align {
    gap: 10px !important;
  }

  .header-mobile-icons {
    gap: 8px;
  }

  .header-mobile-icons .item-hover__text {
    font-size: 18px !important;
  }

  .header-mobile-icons .badge-count {
    width: 14px;
    height: 14px;
    font-size: 9px;
  }

  /* Banner */
  .banner-item__title {
    font-size: 1.25rem !important;
  }

  .banner-item__thumb img {
    max-width: 180px;
  }

  /* Categories */
  .categories-home .category-card h6 {
    font-size: 0.875rem;
  }

  /* Product grid 2 per row */
  .new-arrival .col-6,
  .shop-section .col-6 {
    padding-inline: 6px;
  }

  .new-arrival .row,
  .shop-section .row {
    --bs-gutter-x: 12px;
    --bs-gutter-y: 12px;
  }

  /* Product card extra small */
  .product-card__thumb {
    height: 120px;
  }

  .product-card__thumb img {
    max-width: 90px !important;
  }

  .product-card .wishlist-btn {
    width: 32px !important;
    height: 32px !important;
    margin: 6px !important;
  }

  /* Shop section */
  .list-grid-wrapper {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .shop .shop-sidebar__box {
    padding: 16px !important;
  }

  /* Sub categories in shop */
  .shop .col-md-3.mb-3 {
    width: 50%;
  }

  /* User dashboard orders */
  .user-dashboard .d-flex.justify-content-around.mb-4 {
    flex-wrap: wrap;
    gap: 8px;
  }

  .user-dashboard .d-flex.justify-content-around.mb-4 button {
    flex: 1 1 auto;
    font-size: 0.875rem;
    padding: 8px 12px;
  }

  /* User dashboard cards */
  .user-dashboard .col-lg-6 {
    width: 100%;
  }

  /* Pagination */
  .page-link.h-48.w-48 {
    width: 36px;
    height: 36px;
    font-size: 0.875rem;
  }

  /* Cart */
  .cart-table thead th {
    font-size: 0.875rem;
  }

  .table-product__thumb {
    max-width: 80px;
    max-height: 80px;
  }

  .table-product__content .title {
    font-size: 0.875rem;
  }

  /* Checkout order summary */
  .checkout-sidebar .flex-between.gap-24 {
    gap: 8px !important;
  }

  .checkout-sidebar .w-144 {
    width: auto !important;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Footer */
  .footer-item-wrapper > div {
    width: 100% !important;
  }

  .modal-dialog {
    max-width: calc(100% - 24px);
  }

  .swal2-popup {
    width: calc(100% - 24px) !important;
  }

  /* Scrollbar hide for horizontal scroll areas */
  .scroll-sm-horizontal::-webkit-scrollbar {
    height: 4px;
  }
}

/* ========================== */
/*  Tiny ≤424px               */
/* ========================== */
@media screen and (max-width: 424px) {
  .container-lg {
    padding-inline: 12px;
  }

  .header-middle .logo img {
    max-width: 62px;
  }

  .header-right .item-hover__text {
    font-size: 20px !important;
  }

  /* Keep product grids usable on very narrow screens */
  .list-grid-wrapper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shop .col-md-3.mb-3 {
    width: 100%;
  }

  .new-arrival .row > [class*="col-"] {
    width: 50%;
  }

  /* Product card */
  .product-card__thumb {
    height: 128px;
  }

  .product-card__thumb img {
    max-width: 96px !important;
  }

  .product-card__content .title {
    min-height: 2.5em;
  }

  /* Banner */
  .banner-item {
    padding: 1rem;
  }

  .banner-item__title {
    font-size: 1.125rem !important;
  }

  /* Categories single column */
  .categories-home .slick-slide {
    margin: 0 4px;
  }

  /* User modals */
  .user-dashboard [style*="width: 700px"],
  .user-dashboard [style*="width: 500px"],
  .user-dashboard [style*="width: 400px"] {
    width: 95% !important;
    max-width: 100% !important;
  }

  /* Address modal fields */
  .user-dashboard .row.g-3 .form-control,
  .user-dashboard .row.g-3 select {
    margin-bottom: 8px;
  }

  /* Checkout payment */
  .payment-item .form-check-label {
    font-size: 0.875rem;
  }

  /* Footer store badges */
  .footer .flex-align.gap-8.my-32 img {
    max-width: 120px;
  }
}

/* ========================== */
/*  HEADER MOBILE FIXES       */
/* ========================== */
@media screen and (max-width: 991px) {
  /* Ensure mobile menu toggle is always visible */
  .toggle-mobileMenu {
    display: flex !important;
  }

  /* Mobile search active */
  .search-form.active {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 999;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }

  /* Header right on mobile */
  .header-middle .header-right {
    display: block !important;
  }
}

/* ========================== */
/*  PRODUCT DETAILS FIXES     */
/* ========================== */
@media screen and (max-width: 767px) {
  .product-details .col-xl-6 {
    width: 100%;
  }

  .product-details__thumb img {
    max-height: 250px;
  }

  .product-details__images-slider .slick-slide {
    margin: 0 4px;
  }

  .product-details__images-slider .centerw-\[180px\] {
    width: 80px !important;
    height: 80px !important;
  }

  .product-details__images-slider .centerw-\[180px\] img {
    max-width: 60px;
  }

  .product-dContent__header {
    padding: 12px 16px;
  }

  .product-dContent__box {
    padding: 20px 16px;
  }
}

/* ========================== */
/*  USER DASHBOARD MODALS     */
/* ========================== */
@media screen and (max-width: 767px) {
  .user-dashboard [style*="position: fixed"] [style*="width: 700px"] {
    width: 95% !important;
    max-width: 600px !important;
  }

  .user-dashboard [style*="position: fixed"] [style*="width: 500px"] {
    width: 95% !important;
    max-width: 500px !important;
  }

  .user-dashboard [style*="position: fixed"] [style*="width: 400px"] {
    width: 95% !important;
    max-width: 400px !important;
  }
}

/* ========================== */
/*  TABLE IMPROVEMENTS        */
/* ========================== */
@media screen and (max-width: 767px) {
  .table.style-three tbody tr td {
    padding: 16px 12px;
  }

  .cart-table .table-product {
    gap: 12px;
  }

  .cart-table .table-product__thumb {
    max-width: 70px;
    max-height: 70px;
  }

  .cart-table td {
    white-space: nowrap;
  }
}

/* ========================== */
/*  SLICK SLIDER FIXES        */
/* ========================== */
@media screen and (max-width: 575px) {
  .slick-arrow {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .arrow-center .slick-arrow {
    inset-inline-start: 8px;
  }

  .arrow-center .slick-arrow.slick-next {
    inset-inline-end: 8px;
    inset-inline-start: auto;
  }
}

/* ========================== */
/*  GENERAL UTILITY FIXES     */
/* ========================== */
@media screen and (max-width: 767px) {
  .flex-between {
    gap: 12px;
  }

  .gap-32 {
    gap: 16px !important;
  }

  .gap-24 {
    gap: 12px !important;
  }

  .p-32 {
    padding: 20px !important;
  }

  .p-24 {
    padding: 16px !important;
  }

  .px-40 {
    padding-inline: 20px !important;
  }

  .py-48 {
    padding-block: 24px !important;
  }

  .mb-32 {
    margin-bottom: 20px !important;
  }

  .mt-32 {
    margin-top: 20px !important;
  }

  .mt-40 {
    margin-top: 24px !important;
  }

  .mt-56 {
    margin-top: 32px !important;
  }

  .pt-80 {
    padding-top: 40px !important;
  }

  .pb-80 {
    padding-bottom: 40px !important;
  }

  .py-80 {
    padding-block: 40px !important;
  }

  .py-120 {
    padding-block: 60px !important;
  }
}

