/* Final UI layer for product-card quantity controls. */
.gap-6 {
  gap: 1rem;
}

/* Final request override: every catalog-card action is stacked in one column. */
@media screen and (max-width: 767px) {
  body.kc-tienda-page .kc-catalog-card-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  body.kc-tienda-page .kc-catalog-card-actions .kc-card-quantity-control,
  body.kc-tienda-page .kc-catalog-card-actions .kc-catalog-primary-button,
  body.kc-tienda-page .kc-catalog-card-actions .kc-catalog-secondary-button {
    grid-column: 1 !important;
    grid-row: auto !important;
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* Product cards and quick view description: mobile-only typography. */
@media screen and (max-width: 767px) {
  body.kc-tienda-page .kc-catalog-card-body .kc-catalog-card-title {
    display: block !important;
    color: #0f172a !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.32 !important;
    text-decoration: none !important;
    text-transform: uppercase !important;
  }

  body.kc-tienda-page button,
  body.kc-tienda-page [type="button"],
  body.kc-tienda-page [type="reset"] {
    cursor: pointer !important;
    -webkit-appearance: button !important;
    border: 0 !important;
    font-size: 15px !important;
  }

  body.kc-tienda-page .kc-quick-view__description {
    display: none !important;
  }
}

/* Quick view mobile actions: quantity and add-to-quote share the first row. */
@media screen and (max-width: 767px) {
  .kc-quick-view__actions {
    display: grid !important;
    grid-template-columns: minmax(78px, .42fr) minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .kc-quick-view__actions .kc-quick-view__quantity {
    grid-column: 1 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .kc-quick-view__actions .kc-quick-view__add {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding-inline: 8px !important;
    line-height: 1.05 !important;
  }

  .kc-quick-view__actions .kc-quick-view__quote {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  .kc-quick-view__image {
    display: block !important;
    width: 30% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 490px !important;
    object-fit: contain !important;
    object-position: center center !important;
  }
}

.kc-quick-view__media::after {
  position: absolute;
  right: 34px;
  bottom: 28px;
  left: 34px;
  height: 3px;
  border-radius: 3px;
  background: #ffffff00;
  content: '';
}

/* Exact mobile viewport requested: 393 x 852. */
@media screen and (width: 393px) and (height: 852px) {
  body.kc-home-page .kc-home-card-actions .kc-home-card-primary,
  body.kc-tienda-page .kc-catalog-card-actions .kc-catalog-primary-button {
    grid-column: 2 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
    min-height: 40px !important;
    font-size: 9px !important;
  }
}

/* Quick view mobile image sizing: keep the product fully contained. */
@media screen and (max-width: 767px) {
  .kc-quick-view__image {
    display: block !important;
    width: 40% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 490px !important;
    object-fit: contain !important;
    object-position: center center !important;
  }
}

/* Requested mobile primary action placement; this file loads after custom.css. */
@media screen and (max-width: 767px) {
  body.kc-home-page .kc-home-card-actions .kc-home-card-primary,
  body.kc-tienda-page .kc-catalog-card-actions .kc-catalog-primary-button {
    grid-column: 2 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
    min-height: 40px !important;
    font-size: 11px !important;
  }

  body.kc-tienda-page .kc-catalog-card-actions {
    display: grid !important;
    grid-template-columns: minmax(84px, .56fr) minmax(0, 1fr) !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  body.kc-tienda-page .kc-catalog-card-actions .kc-card-quantity-control {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  body.kc-tienda-page .kc-catalog-card-actions .kc-catalog-primary-button {
    grid-column: 2 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
    white-space: normal !important;
    line-height: 1.05 !important;
    overflow-wrap: anywhere !important;
  }

  body.kc-tienda-page .kc-catalog-card-actions .kc-catalog-secondary-button {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* Final request override: every catalog-card action is stacked in one column. */
@media screen and (max-width: 767px) {
  body.kc-tienda-page .kc-catalog-card-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  body.kc-tienda-page .kc-catalog-card-actions .kc-card-quantity-control,
  body.kc-tienda-page .kc-catalog-card-actions .kc-catalog-primary-button,
  body.kc-tienda-page .kc-catalog-card-actions .kc-catalog-secondary-button {
    grid-column: 1 !important;
    grid-row: auto !important;
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* Final tienda mobile layout: stack all catalog-card actions in one column. */
@media screen and (max-width: 767px) {
  body.kc-tienda-page .kc-catalog-card-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  body.kc-tienda-page .kc-catalog-card-actions .kc-card-quantity-control,
  body.kc-tienda-page .kc-catalog-card-actions .kc-catalog-primary-button,
  body.kc-tienda-page .kc-catalog-card-actions .kc-catalog-secondary-button {
    grid-column: 1 !important;
    grid-row: auto !important;
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* Final request: catalog card actions use one mobile column. */
@media screen and (max-width: 767px) {
  body.kc-tienda-page .kc-catalog-card-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  body.kc-tienda-page .kc-catalog-card-actions .kc-card-quantity-control,
  body.kc-tienda-page .kc-catalog-card-actions .kc-catalog-primary-button,
  body.kc-tienda-page .kc-catalog-card-actions .kc-catalog-secondary-button {
    grid-column: 1 !important;
    grid-row: auto !important;
    width: 100% !important;
    min-width: 0 !important;
  }
}

@media screen and (min-width: 992px) {
  button,
  [type="button"],
  [type="reset"] {
    cursor: pointer !important;
    -webkit-appearance: button !important;
    border: 0 !important;
    font-size: 12px !important;
  }
}

body.kc-tienda-page .kc-catalog-card-actions .kc-catalog-primary-button > svg {
  display: inline-block !important;
  width: 16px !important;
  height: 17px !important;
  flex: 0 0 auto;
}
body.kc-home-page .kc-catalog-card-actions .kc-catalog-primary-button > svg {
  display: inline-block !important;
  width: 16px !important;
  height: 17px !important;
  flex: 0 0 auto;
}
body.kc-home-page .kc-catalog-card-actions .kc-catalog-primary-button > svg.kc-cart-icon {
  visibility: visible !important;
  opacity: 1 !important;
  overflow: visible !important;
  color: #fff !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  fill: none !important;
}
body.kc-tienda-page .kc-catalog-card-actions .kc-catalog-primary-button > svg.kc-cart-icon {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  overflow: visible !important;
  color: #fff !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  fill: none !important;
}

body.kc-home-page .kc-card-quantity-control,
body.kc-tienda-page .kc-card-quantity-control,
body.kc-product-page #related-products-list .kc-card-quantity-control {
  display: flex !important;
  align-items: stretch !important;
  width: 100% !important;
  min-width: 78px !important;
  height: 40px !important;
  overflow: visible !important;
  box-sizing: border-box !important;
  border: 1px solid #d8e0eb !important;
  border-radius: 9px !important;
  background: #fff !important;
}

body.kc-home-page .kc-card-quantity-button,
body.kc-tienda-page .kc-card-quantity-button,
body.kc-product-page #related-products-list .kc-card-quantity-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 32px !important;
  width: 32px !important;
  min-width: 32px !important;
  height: 38px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: #f5f7fa !important;
  color: #233454 !important;
  font-size: 17px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  visibility: visible !important;
  opacity: 1 !important;
  cursor: pointer !important;
}

body.kc-home-page .kc-card-quantity-button:last-child,
body.kc-tienda-page .kc-card-quantity-button:last-child,
body.kc-product-page #related-products-list .kc-card-quantity-button:last-child {
  border-radius: 0 8px 8px 0 !important;
}

body.kc-home-page .kc-card-quantity-value,
body.kc-tienda-page .kc-card-quantity-value,
body.kc-product-page #related-products-list .kc-card-quantity-value {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: auto !important;
  height: 38px !important;
  margin: 0 !important;
  padding: 0 3px !important;
  border: 0 !important;
  background: #fff !important;
  color: #233454 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  text-align: center;
  box-sizing: border-box !important;
}

body.kc-home-page .kc-home-card-actions,
body.kc-home-page .kc-catalog-card-actions,
body.kc-tienda-page .kc-catalog-card-actions,
body.kc-product-page #related-products-list .kc-catalog-card-actions {
  min-width: 0 !important;
  overflow: visible !important;
}
body.kc-home-page .kc-catalog-card-actions {
  grid-template-columns: minmax(108px, .55fr) minmax(0, 1fr) !important;
  gap: 8px !important;
}
body.kc-home-page .kc-catalog-card-actions .kc-card-quantity-control,
body.kc-home-page .kc-catalog-card-actions .kc-catalog-primary-button {
  height: 36px !important;
  min-height: 36px !important;
  border-radius: 9px !important;
}
body.kc-home-page .kc-catalog-card-actions .kc-card-quantity-button {
  height: 34px !important;
}
body.kc-home-page .kc-catalog-card-actions .kc-card-quantity-value {
  height: 34px !important;
}
body.kc-home-page .kc-catalog-card-actions .kc-catalog-primary-button {
  font-size: 12px !important;
  gap: 6px !important;
}

body.kc-tienda-page .kc-catalog-intro,
body.kc-tienda-page .kc-catalog-breadcrumb-wrap,
body.kc-tienda-page .kc-catalog-toolbar,
body.kc-tienda-page .kc-shop-layout {
  width: min(calc(100% - 32px), 1646px);
  margin-right: auto;
  margin-left: auto;
}

body.kc-home-page .kc-home-card-actions .kc-home-card-secondary,
body.kc-home-page .kc-catalog-card-actions .kc-catalog-secondary-button,
body.kc-tienda-page .kc-catalog-card-actions .kc-catalog-secondary-button {
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
  width: 100%;
  min-height: 36px;
  font-size: 12px !important;
}
body.kc-home-page .kc-catalog-card-actions .kc-catalog-secondary-button {
  min-height: 36px !important;
  border-radius: 9px !important;
}

@media screen and (max-width: 767px) {
  body.kc-home-page .kc-home-card-actions .kc-home-card-primary,
  body.kc-tienda-page .kc-catalog-card-actions .kc-catalog-primary-button {
    grid-column: 2 !important;
    grid-row: 1 !important;
    min-width: 0;
    width: 100%;
    min-height: 40px;
    font-size: 13px !important;
  }

  .kc-catalog-card-actions {
    display: flex !important;
    flex-direction: column;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px !important;
  }

  .kc-catalog-card-actions .kc-card-quantity-control {
    flex: 0 0 auto;
    width: 100%;
  }

  .kc-catalog-card-actions .kc-catalog-primary-button {
    flex: 0 0 auto;
    width: 100% !important;
  }

  .kc-catalog-card-actions .kc-catalog-secondary-button {
    flex: 0 0 100%;
    width: 100% !important;
  }

  body.kc-tienda-page .kc-catalog-card-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.kc-tienda-page .kc-catalog-card-actions .kc-card-quantity-control,
  body.kc-tienda-page .kc-catalog-card-actions .kc-catalog-primary-button,
  body.kc-tienda-page .kc-catalog-card-actions .kc-catalog-secondary-button {
    grid-column: 1 !important;
    grid-row: auto !important;
    width: 100% !important;
  }
}

/* Final mobile override: keep the requested primary action in column 2. */
@media screen and (max-width: 767px) {
  body.kc-home-page .kc-home-card-actions .kc-home-card-primary,
  body.kc-tienda-page .kc-catalog-card-actions .kc-catalog-primary-button {
    grid-column: 2 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
    min-height: 40px !important;
    font-size: 11px !important;
  }
}

/* Mobile-only product page and catalog typography overrides. */
@media screen and (max-width: 767px) {
  body.kc-product-page #product-name.leading-tight {
    width: 100% !important;
    margin: 0 0 10px !important;
    color: #111827 !important;
    font-size: 26px !important;
    font-weight: 700 !important;
    line-height: 1.08 !important;
    letter-spacing: 0 !important;
    text-transform: uppercase !important;
    overflow-wrap: anywhere !important;
  }

  body.kc-product-page .product-hero-add-button > *,
  body.kc-product-page .product-hero-actions [data-open-quote-modal="true"] > * {
    position: relative;
    z-index: 1;
    font-weight: 700 !important;
    font-size: 15px !important;
  }

  body.kc-product-page button,
  body.kc-product-page [type="button"],
  body.kc-product-page [type="reset"] {
    cursor: pointer !important;
    -webkit-appearance: button !important;
    border: 0 !important;
    font-size: 15px !important;
  }

  body.kc-tienda-page .kc-catalog-card-body .kc-catalog-card-title {
    display: block !important;
    color: #0f172a !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    line-height: 1.32 !important;
    text-decoration: none !important;
    text-transform: uppercase !important;
  }

  body.kc-tienda-page .kc-catalog-card-body .kc-catalog-card-copy strong {
    display: block !important;
    min-width: 0 !important;
    color: #0f172a !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    overflow-wrap: anywhere !important;
  }

  body.kc-tienda-page .kc-catalog-card-code {
    font-size: 15px !important;
    font-weight: 600 !important;
  }

  body.kc-tienda-page .kc-quick-view__content .kc-quick-view__rule {
    display: none !important;
  }
}

/* Final request: catalog-card actions use one column only on mobile. */
@media screen and (max-width: 767px) {
  body.kc-tienda-page .kc-catalog-card-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  body.kc-tienda-page .kc-catalog-card-actions .kc-card-quantity-control,
  body.kc-tienda-page .kc-catalog-card-actions .kc-catalog-primary-button,
  body.kc-tienda-page .kc-catalog-card-actions .kc-catalog-secondary-button {
    grid-column: 1 !important;
    grid-row: auto !important;
    width: 100% !important;
    min-width: 0 !important;
  }
}
