/* Storefront only: admin and the standalone personalizer keep their own layout. */
.store-page { min-width: 0; }
.store-page :is(h1, h2, h3, p, .store-item-description) { overflow-wrap: anywhere; }
.store-page .store-item-description { min-width: 0; }
.store-page .product-rich-description :is(img, video, iframe) { max-width: 100%; }
.store-catalog-filters > * { min-width: 0; max-width: 100%; }
.store-catalog-filters input { width: 100%; min-width: 0; }
.store-checkout-section-heading { flex-wrap: wrap; gap: .5rem; }
.store-checkout-section-heading > * { min-width: 0; }
.store-checkout-section-heading > span { overflow-wrap: anywhere; }
.store-checkout-submit { flex-wrap: wrap; gap: .25rem .5rem; }

@media (max-width: 639px) {
  .store-catalog-filters { width: 100%; }
  .store-catalog-filters > * { width: 100%; }
  .store-page :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]) {
    font-size: 16px;
    max-width: 100%;
    min-width: 0;
  }
  .store-checkout-form { padding: 1rem; }
  .store-catalog-price { flex-wrap: wrap; gap: .75rem; }
  .store-catalog-price > a { text-align: center; }
}

@media (pointer: coarse) {
  .store-page :is(button, a.btn-brand, input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]), select) {
    min-height: 44px;
  }
  .store-catalog-search-button { min-width: 44px; }
}

.store-page :is(button, a, input, select, textarea):focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 3px;
}


/* Desktop header: one balanced row, mobile/tablet: compact actions and menu. */
.store-header .store-header-row { display:flex; flex-wrap:nowrap; gap:clamp(.75rem,1.5vw,1.75rem); padding-top:.45rem; padding-bottom:.45rem; }
.store-header .store-header-row .store-brand-link { flex:0 1 14rem; min-width:0; }
.store-header .store-brand-copy { min-width:0; overflow-wrap:anywhere; }
.store-header .store-header-row .store-brand-logo { flex-shrink:0; max-width:min(12rem, 26vw); max-height:4.25rem; }
.store-header-actions { flex:0 0 auto; flex-wrap:nowrap; justify-content:flex-end; gap:.4rem; min-width:0; }
.store-header-actions a { white-space:nowrap; }
.store-desktop-nav { flex:1 1 auto; order:0; min-width:0; flex-wrap:nowrap; justify-content:center; gap:clamp(.65rem,1.25vw,1.35rem); white-space:nowrap; }
@media (max-width: 1279px) {
  .store-header .store-header-row .store-brand-link { flex:1 1 auto; }
}
#mobileNav { overflow-y: auto; overscroll-behavior: contain; }
#mobileNav a { overflow-wrap: anywhere; min-width: 0; }
.store-header :is(a, button):focus-visible { outline: 2px solid #4f46e5; outline-offset: 3px; }
.store-size-guide-panel { display: flex; flex-direction: column; min-height: 0; max-height: calc(var(--store-visible-height, 100dvh) - 1.5rem); }
.store-size-guide-panel > :first-child { flex-shrink: 0; gap: .75rem; }
.store-size-guide-panel > :first-child > div { min-width: 0; overflow-wrap: anywhere; }
.store-size-guide-panel [data-store-dialog-close] { flex-shrink: 0; min-width: 44px; min-height: 44px; }
.store-size-guide-content { overflow: auto; overscroll-behavior: contain; min-height: 0; }
.store-size-guide :focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; }
.store-product-purchase-controls { flex-wrap: wrap; }
.store-product-purchase-controls > :first-child { flex-shrink: 0; }
.store-product-purchase-controls #addToCartBtn { min-width: min(12rem, 100%); overflow-wrap: anywhere; }

@media (max-width: 639px) {
  .store-header .store-header-row .store-brand-link { flex:1 1 auto; }
  .store-header .store-header-row .store-brand-logo { max-height: 3.5rem; max-width: 42vw; }
  .store-header-actions { flex:0 0 auto; }
  .store-size-guide-content { padding: 1rem; }
}
@media (pointer: coarse) {
  .store-header :is(a, button), .store-page button { min-height: 44px; }
  .store-header button, .store-page button { min-width: 44px; }
}

/* Product cards: prevent narrow, overflowing footers and detached CTAs. */
.store-product-grid { align-items: stretch; }
.store-product-card { min-width: 0; width: 100%; height: 100%; }
.store-product-card-body { min-width: 0; gap: .25rem; }
.store-product-card-meta { min-width: 0; flex-wrap: wrap; align-items: flex-start; }
.store-product-card-meta > * { max-width: 100%; min-width: 0; }
.store-product-card-title { min-width: 0; overflow-wrap: break-word; }
.store-product-card-footer { display: flex; flex-direction: column; align-items: stretch; gap: .75rem; min-width: 0; }
.store-product-card-footer > div { min-width: 0; }
.store-product-card-footer .text-2xl, .store-product-card-footer .text-xl { font-size: 1.4rem; line-height: 1.4; }
.store-product-card-cta { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; width: 100%; max-width: 100%; min-height: 44px; padding: .7rem 1rem; text-align: center; white-space: normal; overflow-wrap: break-word; line-height: 1.3; }
@media (min-width: 1500px) {
  .store-product-card-footer { flex-direction: row; align-items: center; justify-content: space-between; }
  .store-product-card-cta { width: auto; flex-shrink: 0; }
}


/* Slightly denser, more professional storefront scale on desktop. */
@media (min-width: 1024px) {
  .store-page { max-width: 76rem; }
  .store-page--product { padding-top: 2rem !important; padding-bottom: 2.5rem !important; }
  .store-page--product > .grid { gap: 2rem !important; }
  .store-page--product h1 { font-size: clamp(1.65rem, 2.15vw, 2.25rem) !important; line-height: 1.15 !important; }
  .store-page--product .text-3xl { font-size: 1.75rem !important; }
  .store-page--product .text-4xl { font-size: 2.1rem !important; }
  .store-page--product .rounded-3xl { border-radius: 1.25rem !important; }
  .store-page--product .shadow-xl { box-shadow: 0 14px 34px rgba(15,23,42,.09) !important; }
  .store-page--product .shadow-lg { box-shadow: 0 10px 26px rgba(15,23,42,.075) !important; }

  .store-header .store-header-row { padding-top: .3rem; padding-bottom: .3rem; }
  .store-header .store-header-row .store-brand-logo { max-width: 10.5rem; max-height: 3.6rem; }
  .store-desktop-nav { font-size: .9rem; gap: clamp(.55rem, 1vw, 1rem); }

  .store-product-grid { gap: 1.1rem !important; }
  .store-product-card { border-radius: 1rem !important; }
  .store-product-card-body { padding: 1rem !important; }
  .store-product-card-title { font-size: 1rem !important; line-height: 1.35 !important; }
  .store-product-card-footer .text-2xl,
  .store-product-card-footer .text-xl { font-size: 1.2rem !important; }
  .store-product-card-cta { min-height: 40px; padding: .55rem .8rem; font-size: .85rem; }
}


/* Product detail: tighter professional hierarchy aligned with the 76rem store shell. */
.store-page--product {
    padding-top: 1.75rem;
    padding-bottom: 3rem;
}
.store-page--product .store-product-layout {
    gap: 1.5rem;
    align-items: start;
}
.store-page--product .store-product-media-card,
.store-page--product .store-product-buy-card {
    border-radius: 1.125rem;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .07);
}
.store-page--product #mockupContainer {
    border-radius: 1rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}
.store-page--product .store-product-gallery {
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
}
.store-page--product .store-product-gallery > button {
    scroll-snap-align: start;
}
@media (min-width: 1024px) {
    .store-page--product .store-product-media-card,
    .store-page--product .store-product-buy-card {
        padding: 1.25rem;
    }
}
@media (max-width: 640px) {
    .store-page--product {
        padding-top: .75rem;
        padding-bottom: 2rem;
    }
    .store-page--product .store-product-layout {
        gap: .75rem;
    }
    .store-page--product .store-product-media-card,
    .store-page--product .store-product-buy-card {
        border-radius: .875rem;
        padding: .875rem;
    }
    .store-page--product #mockupContainer {
        border-radius: .75rem;
    }
    .store-page--product .store-product-gallery > button {
        width: 3.5rem;
        height: 3.5rem;
    }
}

/* Mobile storefront hardening: preserve real product media, actions and account
   navigation without horizontal overflow or fixed-height clipping. */
.store-product-size-heading{flex-wrap:wrap;gap:.5rem}
.store-product-personalize-btn{flex-wrap:wrap;white-space:normal;line-height:1.25}
.store-product-quantity-control{flex:0 0 auto}
.store-product-guarantees>*{min-width:0}
.store-whatsapp-fab{
  right:max(1rem,env(safe-area-inset-right));
  bottom:max(1rem,env(safe-area-inset-bottom));
}
.store-product-gallery{overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch}
.store-page--product #baseMockupImg,
.store-page--product #baseMockupVideo{max-width:100%;max-height:100%}

@media(max-width:639px){
  .store-header .store-header-row{gap:.45rem;min-height:4.5rem;height:auto}
  .store-header-actions>a:not([href="/carrito"]){display:none}
  .store-header .store-header-row .store-brand-link{flex:1 1 auto;min-width:0}
  .store-header .store-header-row .store-brand-logo{max-width:min(8rem,38vw);max-height:3.25rem}
  #mobileNav{max-height:calc(100dvh - 4.5rem - env(safe-area-inset-bottom));padding-bottom:max(1rem,env(safe-area-inset-bottom))}
  #mobileNav nav{grid-template-columns:repeat(2,minmax(0,1fr))}
  .store-page--product #mockupContainer{min-height:min(86vw,25rem)}
  .store-page--product #baseMockupImg,
  .store-page--product #baseMockupVideo{padding:.75rem!important}
  .store-product-size-heading>*{min-width:0}
  .store-product-size-heading label{flex:1 1 12rem;flex-wrap:wrap}
  .store-product-personalize-btn{padding-left:1rem!important;padding-right:1rem!important}
  .store-product-purchase-controls{align-items:stretch}
  .store-product-purchase-controls #addToCartBtn{flex:1 1 12rem;min-height:48px}
  .store-product-guarantees{gap:.6rem}
  .store-product-guarantees>div{padding:.65rem}
  .store-whatsapp-fab{width:3.5rem;height:3.5rem;padding:.75rem!important}
  .store-whatsapp-fab svg{width:2rem;height:2rem}
}
@media(max-width:479px){
  .store-product-purchase-controls{display:grid!important;grid-template-columns:1fr}
  .store-product-quantity-control{width:100%;justify-content:center}
  .store-product-purchase-controls #addToCartBtn{width:100%;min-width:0}
  .store-product-purchase-controls #addToCartBtn>span:nth-child(2){display:none}
  .store-product-guarantees{grid-template-columns:1fr!important}
  .store-product-personalize-btn>span:last-child{width:100%;max-width:max-content}
}
@media(max-width:359px){
  #mobileNav nav{grid-template-columns:1fr}
  .store-header .store-header-row .store-brand-logo{max-width:34vw}
}
@media(prefers-reduced-motion:reduce){
  .store-page *,.store-header *{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}
}

/* Cart / checkout: sticky summaries are desktop affordances; on compact screens
   they must stay in normal document flow and never cover form fields or totals. */
#addressSuggestions,#billingSuggestions{
  max-height:min(15rem,40dvh);
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
@media(max-width:1023px){
  .store-page--cart .sticky,
  .store-page--checkout .sticky{position:static!important;top:auto!important}
}
@media(max-width:639px){
  .store-page--cart,.store-page--checkout{padding-top:1rem!important;padding-bottom:2rem!important}
  .store-page--cart>h1,.store-page--checkout>h1{font-size:1.65rem;line-height:1.2;margin-bottom:1.25rem}
  .store-page--cart>.grid,.store-page--checkout>.grid{gap:1rem!important}
  .store-page--checkout .store-checkout-form{border-radius:1rem}
  .store-page--checkout .store-checkout-section-heading{align-items:flex-start}
}


/* Address suggestions remain touch-sized and readable without widening the checkout. */
.store-address-options { max-height: min(15rem, 40dvh); overscroll-behavior: contain; }
.store-address-option { display: block; width: 100%; min-height: 44px; padding: .75rem; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.store-address-option[aria-selected="true"], .store-address-option:hover { background: #eef2ff; }
.store-address-street, .store-address-locality { display: block; }
.store-address-street { font-weight: 700; color: #111827; }
.store-address-locality, .store-address-status { font-size: .75rem; color: #475569; }
.store-address-status { overflow-wrap: anywhere; }
