/* Preserve the existing desktop design; overrides apply only below 992px. */
@media screen and (max-width: 991px) {
/* Shared responsive rules load after the theme and page-specific styles. */
img, video { max-width: 100%; }
img { height: auto; }
iframe { max-width: 100%; }
.site-main, .site-main .row > *, .product-flex > * { min-width: 0; }
.site-main, footer { overflow-wrap: anywhere; }
.form-control { max-width: 100%; }
textarea.form-control { resize: vertical; }
.btn { max-width: 100%; white-space: normal; }
.table-responsive { max-width: 100%; overflow-x: auto; }
.home-slider-actions, .home-product-slide-actions { flex-wrap: wrap; }

@media (max-width: 991px) {
  nav .navigation .logo.site-brand { width: auto; max-width: calc(100% - 60px); }
  nav .navigation-main .open-menu { width: 48px; }
  nav .navigation-main .floating-menu {
    max-height: 100vh;
    max-height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    visibility: hidden;
  }
  nav .navigation-main .floating-menu.expanded { visibility: visible; }
  nav .navigation-main .floating-menu > ul > li > a { min-height: 44px; }
  .product-flex-gallery .owl-product-gallery { min-height: 0; }
  .product-flex-gallery .owl-product-gallery img { height: clamp(240px, 65vw, 460px); }
  .product-order-actions { position: static; flex-wrap: wrap; margin-bottom: 16px; }
  .product-order-actions > * { flex: 1 1 180px; }
  .product-order-actions .whatsapp-order,
  .product-order-actions .add-to-cart {
    height: auto !important;
    line-height: 24px !important;
    padding: 11px 16px;
  }
  .product .product-flex .product-flex-info { margin-top: 24px; }
}

@media (max-width: 767px) {
  body { -webkit-text-size-adjust: 100%; }
  .site-main h1, .site-main .h1 { font-size: clamp(26px, 7vw, 36px); }
  .site-main h2, .site-main .h2 { font-size: clamp(22px, 6vw, 30px); }
  .site-main .btn, footer .btn { min-height: 44px; }
  .form-control, .sort-bar select { font-size: 16px; min-height: 44px; }
  nav .navigation-top > ul { display: flex; justify-content: flex-end; padding: 0px 8px;}
  nav .navigation-top > ul > li > a { min-width: 44px; min-height: 44px; padding: 8px; }
  nav .search-wrapper { width: 100%; max-width: 100%; }
  nav .search-wrapper form { display: flex; gap: 8px; }
  nav .search-wrapper .form-control { min-width: 0; padding-right: 12px; }
  nav .search-wrapper .btn-search { position: static; flex: 0 0 auto; transform: none; }
  .header-content .item { height: auto; min-height: 480px; min-height: max(286px, 35svh); }
  .header-content .item .box { position: relative; top: auto; transform: none; padding-top: 70px; }
  .header-content .item .btn { margin-top: 20px; }
  .home-product-slide { margin: 0 6px; }
  .home-product-slide-image { height: clamp(190px, 60vw, 270px); }
  .home-slider-actions > *, .home-product-slide-actions > * { flex: 1 1 150px; text-align: center; }
  .sort-bar { display: flex; flex-wrap: wrap; gap: 12px; }
  .sort-bar:before, .sort-bar:after { display: none; }
  .sort-bar .sort-results, .sort-bar .sort-options { float: none !important; max-width: 100%; }
  .sort-bar select { max-width: 100%; }
  .pagination { display: flex; flex-wrap: wrap; }
  .pagination > li > a, .pagination > li > span { min-width: 44px; min-height: 44px; }
  .product .info-box { display: flex; flex-wrap: wrap; gap: 8px; }
  .product .info-box > span { min-width: 0; }
  .nav-tabs { display: flex; flex-wrap: wrap; }
  .checkout .cart-block.cart-block-item {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
  }
  .checkout .cart-block.cart-block-item:before,
  .checkout .cart-block.cart-block-item:after { display: none; }
  .checkout .cart-block.cart-block-item > div { display: block; float: none; width: auto; padding: 0; margin: 0; }
  .checkout .cart-block.cart-block-item .image img { width: 80px; height: 80px; object-fit: contain; }
  .checkout .cart-block.cart-block-item .title { align-self: center; }
  .checkout .cart-block.cart-block-item .price { align-self: center; text-align: right; }
  .checkout .cart-block .price .final { font-size: 20px; margin: 0; }
  .checkout .cart-block .form-control { height: 44px; }
  .checkout .cart-remove { grid-column: 1 / -1; justify-self: start; }
  .checkout .cart-block.cart-block-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 20px 16px; }
  .checkout .cart-block.cart-block-footer > div { float: none; width: auto; max-width: 100%; }
  .checkout-page .btn { width: 100%; margin-bottom: 8px; }
  .checkout .white-block { padding: 20px 16px; }
  .staff-orders .order-filters > .btn { flex: 1 1 140px; }
  footer .footer-links .form-newsletter { display: flex; flex-wrap: wrap; gap: 10px; }
  footer .footer-links .form-newsletter .form-control { flex: 1 1 200px; width: auto; min-width: 0; }
  footer .footer-links .form-newsletter .btn { position: static; transform: none; flex: 1 1 120px; }
  footer .footer-social .links { text-align: left; margin-top: 16px; }
  footer .footer-social .links a { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
}

@media (max-width: 479px) {
  .products .row > .col-xs-6 { width: 100%; }
  .products article .figure-grid .text .title { font-size: 20px; }
  .step-wrapper .stepper > ul { display: flex; flex-wrap: wrap; gap: 16px 0; }
  .step-wrapper .stepper > ul > li { flex: 0 0 50%; }
  .step-wrapper .stepper > ul > li:before { display: none; }
}

/* The email preview also needs to fit tablets narrower than its 600px table. */
@media (max-width: 639px) {
  .table-mobile { width: 100% !important; max-width: 100% !important; }
  .table-mobile-small { width: 92% !important; max-width: 100% !important; }
}

/* Fluid sizing within phone and tablet layouts. */
.site-main > section:not(.header-content):not(.main-header):not(.product):not(.owl-icons-wrapper):not(.stretcher-wrapper) {
  padding-top: 0px;
  padding-bottom: clamp(32px, 5vw, 80px);
}
.site-main h1, .site-main .h1 { font-size: clamp(26px, 2vw + 16px, 48px); }
.site-main h2, .site-main .h2 { font-size: clamp(22px, 1.5vw + 14px, 36px); }
.site-main .container, footer .container {
  width: 100%;
  padding-left: clamp(15px, 3vw, 48px);
  padding-right: clamp(15px, 3vw, 48px);
}
.products .responsive-product-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(16px, 2vw, 28px);
  margin: 0;
}
.products .responsive-product-grid:before,
.products .responsive-product-grid:after { display: none; }
.products .responsive-product-grid > [class*="col-"] {
  float: none;
  width: auto;
  min-width: 0;
  padding: 0;
  display: flex;
}
.products .responsive-product-grid article { margin-bottom: 0; }
.products .responsive-product-grid article .image { height: auto; aspect-ratio: 4 / 3; }
.products .responsive-product-grid article .text { padding: clamp(14px, 1.5vw, 24px); }
.products .responsive-product-grid article .text .title { white-space: normal; font-size: clamp(18px, 1.2vw + 8px, 24px); }
.products article:focus-within .btn-add { transform: none; }
.products article .add-to-cart { transform: none; }
.product-order-actions { position: static; flex-wrap: wrap; margin-bottom: 16px; }
.product-order-actions > * { flex: 1 1 180px; }
.product-order-actions .whatsapp-order,
.product-order-actions .add-to-cart { height: auto !important; line-height: 24px !important; padding: 11px 16px; }
.product-flex-gallery .owl-product-gallery { min-height: 0; }
.product-flex-gallery .owl-product-gallery img { height: clamp(240px, 40vw, 600px); }
.sort-bar { 
  margin-top: 0; 
  opacity: 1;
  @media (max-width: 479px) {
      display: none;
    } 
  }
.home-product-slide-actions > * { flex: 1 1 140px; text-align: center; }
footer .footer-links .form-newsletter { display: flex; flex-wrap: wrap; gap: 10px; }
footer .footer-links .form-newsletter .form-control { flex: 1 1 200px; width: auto; min-width: 0; }
footer .footer-links .form-newsletter .btn { position: static; transform: none; flex: 1 1 120px; }

@media (min-width: 600px) {
  .products .responsive-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Isotope-driven shop/category grid: Isotope absolutely-positions items and
   ignores CSS grid, so we set explicit item widths it can honour. One column
   on small phones, two columns from 600px up. */
.products .responsive-product-grid .product-grid-item {
  float: none;
  width: 100%;
  padding: 0 0 clamp(16px, 2vw, 28px);
  box-sizing: border-box;
}
@media (min-width: 600px) {
  .products .responsive-product-grid .product-grid-item {
    width: 50%;
    padding: 0 8px clamp(16px, 2vw, 28px);
  }
}

/* Home "Explore our sofas" carousel: custom.css makes the add-to-cart button
   position:static, which frees the theme's absolutely-positioned .btn-add:before
   triangle from its overflow:hidden clip so it covers the whole slide. Neutralise
   the triangle and render a normal flat button on mobile. */
.home-product-slide-actions .add-to-cart.btn-add {
  position: static;
  width: auto;
  height: auto;
  min-height: 44px;
  overflow: visible;
  background: #ffbb00;
  color: #fff;
  padding: 10px 12px;
  line-height: 22px;
}
.home-product-slide-actions .add-to-cart.btn-add:hover { background: #e1a500; }
.home-product-slide-actions .add-to-cart.btn-add:before { display: none; }
.home-product-slide-actions .add-to-cart.btn-add .icon {
  position: static;
  bottom: auto;
  right: auto;
}

/* Shop search: stop the appended "Search" button text from wrapping
   letter-by-letter, and stack the field/button on very narrow phones. */
.product-search-form .input-group-btn .btn { white-space: nowrap; }
@media (max-width: 479px) {
  .product-search-form .input-group { display: flex; flex-direction: column; }
  .product-search-form .input-group .form-control {
    width: 100%;
    border-radius: 3px;
    margin-bottom: 8px;
  }
  .product-search-form .input-group .input-group-btn { width: 100%; }
  .product-search-form .input-group .input-group-btn .btn {
    width: 100%;
    border-radius: 3px;
  }
}


@media (min-width: 768px) {
  .checkout .cart-block.cart-block-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding: 20px;
  }
  .checkout .cart-block.cart-block-item:before,
  .checkout .cart-block.cart-block-item:after { display: none; }
  .checkout .cart-block.cart-block-item > div { display: block; float: none; width: auto; padding: 0; min-width: 0; }
  .checkout .cart-block.cart-block-item .image { flex: 0 0 88px; }
  .checkout .cart-block.cart-block-item .image img { height: 88px; object-fit: contain; }
  .checkout .cart-block.cart-block-item .title { flex: 1 1 180px; }
  .checkout .cart-block.cart-block-item .quantity { flex: 0 0 80px; }
  .checkout .cart-block.cart-block-item .price { flex: 0 1 auto; margin-left: auto; }
  .checkout .cart-block.cart-block-item .price .final { font-size: clamp(20px, 2vw, 28px); }
  .checkout .cart-block .form-control { min-height: 44px; }
}
@media (max-width: 991px) {
  .filters { width: min(90vw, 420px); }
}
/* Allow hero copy to grow on landscape phones and tablets. */
@media (max-height: 600px) {
  .header-content .item { height: auto; min-height: 440px; }
  .header-content .item .box { position: relative; top: auto; transform: none; padding-top: 70px }
}
@media (hover: none), (pointer: coarse) {
  .site-main .btn, footer .btn, nav .navigation-top > ul > li > a { min-height: 44px; }
  .form-control, .sort-bar select { min-height: 44px; font-size: 16px; }
  .products article .info { opacity: 1; visibility: visible; }
  .products article .btn-add { transform: none; }
}

}
