/* ======================= */
/* Overlay + toast         */
/* ======================= */
.jwqvm-overlay[hidden]{display:none}
.jwqvm-overlay{
  /* výchozí: desktop/tablet – centrovaný modal, 16/16/16 */
  --jwqvm-pad-top: 16px;
  --jwqvm-pad-bottom: 16px;
  --jwqvm-pad-inline: 16px;

  position:fixed; inset:0; z-index:9999;
  display:flex; align-items:center; justify-content:center; /* center by default */
  padding-block: var(--jwqvm-pad-top) var(--jwqvm-pad-bottom);
  padding-inline: var(--jwqvm-pad-inline);
  background:rgba(0,0,0,.45);
}
/* iOS safe-area pro výchozí stav */
@supports (padding:max(0px)){
  .jwqvm-overlay{
    --jwqvm-pad-top: max(16px, env(safe-area-inset-top));
    --jwqvm-pad-bottom: max(16px, env(safe-area-inset-bottom));
  }
}

.jwqvm-toast{
  position:fixed; left:50%; bottom:24px; transform:translateX(-50%);
  background:#111; color:#fff; padding:10px 14px; border-radius:8px;
  font-size:.95rem; z-index:10000; opacity:0; transition:opacity .2s;
}
.jwqvm-toast.show{opacity:1}

/* ======================= */
/* Modal shell             */
/* ======================= */
.jwqvm-modal{
  position:relative;
  display:flex; flex-direction:column;
  background:#fff; width:min(760px,100%);
  max-height: calc(100dvh - (var(--jwqvm-pad-top) + var(--jwqvm-pad-bottom)));
  border-radius:16px; box-shadow:0 20px 50px rgba(0,0,0,.25);
  overflow:hidden;
}
.jwqvm-modal-header{
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 22px; border-bottom:1px solid #eee;
}
.jwqvm-title{margin:0; font-size:1.25rem; font-weight:700}
.jwqvm-close{
  position:absolute; top:10px; right:10px;
  width:36px; height:36px; border-radius:9999px;
  border:0; background:rgba(0,0,0,.6); color:#fff;
  display:grid; place-items:center;
  font-size:20px; line-height:1; cursor:pointer; opacity:1;
  box-shadow:0 4px 12px rgba(0,0,0,.25);
  align-items: center;
  justify-content: center;
  align-content: center;
}
.jwqvm-close:hover{background:rgba(0,0,0,.75)}
.jwqvm-modal-body{
  padding:18px 22px;
  overflow:auto;          /* vnitřní scroll */
  flex:1 1 auto;
  min-height:0;           /* nutné pro funkční scroll ve flex layoutu */
}

/* ======================= */
/* Summary (image + text)  */
/* ======================= */
.jwqvm-summary{
  display:grid; grid-template-columns:140px 1fr; gap:18px;
  align-items:start; margin-bottom:16px;
}
.jwqvm-media img{
  width:100%; height:auto; display:block; border-radius:10px;
  max-height:32vh; object-fit:cover;            /* šetří výšku na mobilu */
}
.jwqvm-text p{margin:.25rem 0}

/* ======================= */
/* Variations (selectors)  */
/* ======================= */
.jwqvm-modal .variations tr,
.jwqvm-modal .variations td{display:block}
.jwqvm-modal .variations td.label{margin-bottom:4px}
.jwqvm-modal .variations td.value{margin:0 0 12px 0}
.jwqvm-modal .variations select{width:100%}

/* ===================================== */
/* Single variation area (price/stock +  */
/*   extra field + qty + add button)     */
/* ===================================== */
.jwqvm-modal .single_variation_wrap{
  display:grid; grid-template-columns:1fr; row-gap:12px;
  margin-top:6px; width:100%;
}
.jwqvm-modal .single_variation{margin:0}

/* add-to-cart řádek */
.jwqvm-modal .woocommerce-variation-add-to-cart.variations_button{
  display:flex !important; flex-wrap:wrap; align-items:stretch;
  width:100%; row-gap:12px;
}

/* extra field přes celý řádek */
.jwqvm-modal .woocommerce-variation-add-to-cart.variations_button > #woo_variant_text_field_wrapper{
  flex:1 1 100%; width:100% !important; margin:0;
}
.jwqvm-modal #woo_variant_text_field_wrapper input{width:100%}

/* qty – vlevo, kompaktní */
.jwqvm-modal .woocommerce-variation-add-to-cart.variations_button > .quantity{
  flex:0 0 auto; min-width:0 !important;
}
.jwqvm-modal .woocommerce-variation-add-to-cart.variations_button .quantity .qty{
  width:4.5em !important; text-align:center;
}

/* tlačítko vyplní zbytek */
.jwqvm-modal .woocommerce-variation-add-to-cart.variations_button > .single_add_to_cart_button{
  flex:1 1 0; display:block !important; width:100% !important;
  max-width:none !important; box-sizing:border-box; margin-left:0;
}

/* vodorovná mezera jen když qty existuje */
.jwqvm-modal .woocommerce-variation-add-to-cart.variations_button:has(.quantity .qty:not([hidden]):not([style*="display:none"]))
  > .single_add_to_cart_button{ margin-left:12px; }

/* skrýt prázdný qty wrapper */
.jwqvm-modal .woocommerce-variation-add-to-cart.variations_button .quantity:empty,
.jwqvm-modal .woocommerce-variation-add-to-cart.variations_button .quantity:not(:has(.qty)){
  display:none !important;
}

/* když je disabled → bez mezery */
.jwqvm-modal .woocommerce-variation-add-to-cart.variations_button.woocommerce-variation-add-to-cart-disabled
  > .single_add_to_cart_button{ margin-left:0 !important; }

/* jistota: starý block akcí pryč */
.jwqvm-modal .jwqvm-actions{display:none !important}

/* ======================= */
/* Skeleton                */
/* ======================= */
.jwqvm-skel{
  min-height:140px; display:flex; align-items:center; justify-content:center; opacity:.7;
}

/* ======================= */
/* Loop dual actions       */
/* ======================= */
.jwux-dual-actions{
    display: flex;
    width: 100%;
    flex-direction: column;
    flex-wrap: nowrap;
    align-content: center;
    align-items: center;
}

.jwux-dual-actions .button{
  margin:0 0 .5rem 0; 
  display: flex;
  width: 100%;
  flex-direction: column;
  align-content: center;
  align-items: center;
  justify-content: center;
}
.jwux-dual-actions .button:last-child{margin-bottom:0}
.jwux-detail-button{background:transparent; border:1px solid currentColor; opacity:.85}

.jwux-dual-actions .button.product_type_variable.add_to_cart_button {
	background: #7f9795 !important;
}

.jwux-dual-actions .button.product_type_variable.add_to_cart_button:hover {
	background: --global-palette-btn-bg-hover !important;
}

span.jwux-button-divider {
    margin-bottom: .4em;
}

/* ======================= */
/* Responsive              */
/* ======================= */
/* Mobil: top align + 48px top padding, ostatní 16px */
@media (max-width:560px){
  .jwqvm-overlay{
    align-items:flex-start;                 /* u horní hrany */
    --jwqvm-pad-top: 48px;
    --jwqvm-pad-bottom: 16px;
    --jwqvm-pad-inline: 16px;
  }
  @supports (padding:max(0px)){
    .jwqvm-overlay{
      --jwqvm-pad-top: max(48px, env(safe-area-inset-top));
      --jwqvm-pad-bottom: max(16px, env(safe-area-inset-bottom));
    }
  }

  .jwqvm-summary{grid-template-columns:88px 1fr; gap:12px}
  .jwqvm-modal-body{padding:14px 16px}
}
