/* Merum Style critical responsive layout — loaded after all theme styles. */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

img,
svg,
video,
iframe,
select,
input,
textarea {
  max-width: 100%;
}

.site-header,
.site-footer,
.newsletter,
main,
.container {
  min-width: 0;
}

/* Header */
@media (max-width: 600px) {
  .site-header .header-row {
    width: calc(100% - 24px);
    gap: 7px;
  }

  .site-header .menu-toggle {
    flex: 0 0 28px;
    width: 28px;
    padding: 0;
  }

  .site-header .brand {
    flex: 1 1 auto;
    min-width: 0;
    font-size: clamp(20px, 6vw, 24px);
    white-space: nowrap;
  }

  .site-header .header-tools {
    flex: 0 0 auto;
    gap: 3px;
  }

  .site-header .header-tools > a,
  .site-header .header-tools > button {
    width: 31px;
    height: 31px;
    flex: 0 0 31px;
  }
}

@media (max-width: 350px) {
  .site-header .header-tools > a,
  .site-header .header-tools > button {
    width: 29px;
    height: 29px;
    flex-basis: 29px;
  }

  .site-header .brand {
    font-size: 19px;
  }
}

/* Shop and category archives */
.shop-archive-shell,
.shop-archive-shell .products-grid,
.shop-archive-shell .product-card,
.shop-archive-shell .product-img,
.shop-archive-shell .product-info {
  min-width: 0;
  max-width: 100%;
}

.shop-archive-shell .products-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.shop-archive-shell .product-card,
.shop-archive-shell .product-card > a {
  width: 100%;
}

.shop-archive-shell .product-info h3,
.shop-archive-shell .product-cat {
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .shop-archive-shell .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 22px 12px !important;
  }
}

@media (max-width: 600px) {
  .shop-archive-shell {
    width: calc(100% - 24px);
    padding: 46px 0;
  }

  .shop-archive-shell .archive-bar {
    flex-wrap: wrap;
    gap: 12px;
  }

  .shop-archive-shell .archive-bar .woocommerce-ordering,
  .shop-archive-shell .archive-bar select {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }
}

@media (max-width: 340px) {
  .shop-archive-shell .products-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Product details: WooCommerce content is rendered inside this shell. */
.product-detail-shell {
  width: min(1180px, calc(100% - 40px));
  min-width: 0;
  overflow: hidden;
}

.product-detail-shell > .product {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 64px !important;
  width: 100% !important;
}

.product-detail-shell > .product > .woocommerce-product-gallery,
.product-detail-shell > .product > .summary {
  float: none !important;
  width: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
}

.product-detail-shell .woocommerce-product-gallery img,
.product-detail-shell .woocommerce-product-gallery__wrapper,
.product-detail-shell .woocommerce-product-gallery__image {
  max-width: 100%;
}

.product-detail-shell .flex-control-thumbs {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.product-detail-shell .flex-control-thumbs li {
  float: none !important;
  width: auto !important;
  min-width: 0;
}

.product-detail-shell .woocommerce-tabs,
.product-detail-shell .related.products,
.product-detail-shell .up-sells {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
}

.product-detail-shell form.variations_form,
.product-detail-shell form.variations_form .variations,
.product-detail-shell form.variations_form .single_variation_wrap,
.product-detail-shell form.variations_form .variations_button {
  width: 100% !important;
  min-width: 0 !important;
}

.product-detail-shell form.variations_form.cart {
  display: block !important;
}

.product-detail-shell form.variations_form .variations,
.product-detail-shell form.variations_form .variations tbody,
.product-detail-shell form.variations_form .variations tr,
.product-detail-shell form.variations_form .variations th,
.product-detail-shell form.variations_form .variations td {
  display: block !important;
  width: 100% !important;
}

.product-detail-shell form.variations_form .variations tr {
  margin-bottom: 14px;
}

.product-detail-shell form.variations_form .variations th,
.product-detail-shell form.variations_form .variations td {
  padding: 0 !important;
}

.product-detail-shell form.variations_form .variations th label {
  display: block;
  margin-bottom: 8px;
}

.product-detail-shell form.variations_form .variations td.value {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
}

.product-detail-shell form.variations_form select {
  width: 100% !important;
  min-width: 0 !important;
  height: 52px !important;
  margin: 0 !important;
}

.product-detail-shell form.variations_form .reset_variations {
  margin: 0 !important;
}

.product-detail-shell form.variations_form .variations_button {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: stretch !important;
  gap: 10px 12px !important;
  float: none !important;
}

.product-detail-shell form.variations_form .quantity {
  flex: 0 0 72px;
  float: none !important;
  margin: 0 !important;
}

.product-detail-shell form.variations_form .quantity input {
  width: 72px !important;
  height: 54px !important;
}

.product-detail-shell form.variations_form .single_add_to_cart_button {
  flex: 1 1 240px;
  float: none !important;
  width: auto !important;
  min-width: 0 !important;
  height: 54px !important;
  margin: 0 !important;
}

.product-detail-shell form.variations_form .wcboost-wishlist-single-button {
  flex: 1 0 100%;
  float: none !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  justify-content: center !important;
}

@media (max-width: 900px) {
  .product-detail-shell {
    width: calc(100% - 28px);
    padding: 38px 0 64px;
  }

  .product-detail-shell > .product {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 34px !important;
  }

  .product-detail-shell form.variations_form .single_add_to_cart_button,
  .product-detail-shell form.variations_form .quantity,
  .product-detail-shell form.variations_form .quantity input {
    width: 100% !important;
    flex-basis: 100%;
  }
}

/* Footer: never allow the five-column desktop grid to win on small screens. */
.site-footer > .footer-grid {
  display: grid !important;
  grid-template-columns: 1.25fr 1fr 1.05fr 1.2fr 1fr !important;
  width: min(1180px, calc(100% - 40px));
  max-width: 1180px;
}

.site-footer > .footer-grid > * {
  min-width: 0;
  max-width: 100%;
}

.site-footer > .footer-grid a,
.site-footer > .footer-grid p,
.site-footer > .footer-grid h3,
.site-footer > .footer-grid h4 {
  max-width: 100%;
  overflow-wrap: anywhere;
}

@media (max-width: 1000px) {
  .site-footer > .footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 700px) {
  .site-footer > .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: calc(100% - 28px);
    gap: 32px 22px !important;
  }
}

@media (max-width: 480px) {
  .site-footer > .footer-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    width: calc(100% - 24px);
    gap: 28px !important;
  }

  .site-footer .footer-col,
  .site-footer > .footer-grid > div:first-child {
    width: 100%;
  }
}

/* Product gallery lightbox */
body.merum-lightbox-open {
  overflow: hidden !important;
}

.merum-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: grid;
  place-items: center;
  padding: 18px;
  color: #fff;
  opacity: 0;
  visibility: hidden;
  transition: opacity .24s ease, visibility .24s ease;
}

.merum-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.merum-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 15, 14, .94);
  backdrop-filter: blur(14px);
}

.merum-lightbox__dialog {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1180px, 100%);
  height: min(900px, calc(100dvh - 36px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 4px;
  background: #171513;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .5);
  transform: translateY(12px) scale(.985);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}

.merum-lightbox.is-open .merum-lightbox__dialog {
  transform: none;
}

.merum-lightbox__topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 64px;
  padding: 12px 14px 12px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.merum-lightbox__eyebrow,
.merum-lightbox__hint,
.merum-lightbox__status {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.merum-lightbox__eyebrow {
  font-weight: 700;
}

.merum-lightbox__hint {
  margin-left: 16px;
  color: rgba(255, 255, 255, .5);
}

.merum-lightbox__status {
  color: rgba(255, 255, 255, .7);
}

.merum-lightbox__close {
  justify-self: end;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font: 300 27px/1 Arial, sans-serif;
  cursor: pointer;
  transition: background .2s, transform .2s;
}

.merum-lightbox__close:hover,
.merum-lightbox__close:focus-visible {
  background: rgba(255, 255, 255, .1);
  transform: rotate(5deg);
  outline: none;
}

.merum-lightbox__stage {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  min-height: 0;
  overflow: hidden;
}

.merum-lightbox__figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 20px;
}

.merum-lightbox__image {
  align-self: center;
  justify-self: center;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100% - 34px);
  object-fit: contain;
  cursor: zoom-in;
  user-select: none;
  transition: transform .25s ease;
}

.merum-lightbox__image.is-zoomed {
  transform: scale(1.55);
  cursor: zoom-out;
}

.merum-lightbox__caption {
  overflow: hidden;
  padding-top: 12px;
  color: rgba(255, 255, 255, .68);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.merum-lightbox__nav {
  align-self: center;
  justify-self: center;
  width: 44px;
  height: 56px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 30px;
  background: rgba(255, 255, 255, .04);
  color: #fff;
  font: 300 34px/1 Arial, sans-serif;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .2s;
}

.merum-lightbox__nav:hover,
.merum-lightbox__nav:focus-visible {
  border-color: rgba(255, 255, 255, .5);
  background: rgba(255, 255, 255, .1);
  outline: none;
  transform: scale(1.04);
}

.merum-lightbox__thumbs {
  display: flex;
  gap: 9px;
  min-height: 88px;
  overflow-x: auto;
  padding: 12px 18px 14px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  scrollbar-width: none;
}

.merum-lightbox__thumbs::-webkit-scrollbar {
  display: none;
}

.merum-lightbox__thumb {
  flex: 0 0 58px;
  width: 58px;
  height: 64px;
  overflow: hidden;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 2px;
  background: #2a2724;
  opacity: .5;
  cursor: pointer;
  transition: opacity .2s, border-color .2s, transform .2s;
}

.merum-lightbox__thumb:hover,
.merum-lightbox__thumb.is-active {
  border-color: #fff;
  opacity: 1;
  transform: translateY(-2px);
}

.merum-lightbox__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 700px) {
  .merum-lightbox {
    padding: 0;
  }

  .merum-lightbox__dialog {
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .merum-lightbox__topbar {
    min-height: 58px;
    padding: 9px 10px 9px 14px;
  }

  .merum-lightbox__hint {
    display: none;
  }

  .merum-lightbox__stage {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
  }

  .merum-lightbox__figure {
    padding: 10px 0;
  }

  .merum-lightbox__nav {
    width: 36px;
    height: 48px;
    border: 0;
    background: transparent;
  }

  .merum-lightbox__image.is-zoomed {
    transform: scale(1.25);
  }

  .merum-lightbox__thumbs {
    min-height: 78px;
    padding: 9px 12px 11px;
  }

  .merum-lightbox__thumb {
    flex-basis: 52px;
    width: 52px;
    height: 58px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .merum-lightbox,
  .merum-lightbox__dialog,
  .merum-lightbox__image,
  .merum-lightbox__nav,
  .merum-lightbox__thumb {
    transition: none !important;
  }
}
