.kkw-wrap{
  margin:16px 0;
  padding:14px;
  border:1px solid #e5e7eb;
  border-radius:12px;
  background:#fff;
}
.kkw-actions{display:grid;gap:10px;margin-bottom:14px}
.kkw-btn{
  width:100%;
  border-radius:10px!important;
  padding:12px 14px!important;
  font-weight:600;
}
.kkw-grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
@media (max-width:700px){.kkw-grid-2{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}}
.kkw-field{margin:0}
.kkw-field label{display:flex;align-items:center;gap:6px;margin:0 0 6px 0}
.kkw-req{color:#dc2626;font-weight:700}
.kkw-input{
  width:100%!important;
  border-radius:10px!important;
  padding:12px 12px!important;
  border:1px solid #d1d5db!important;
}
.kkw-help{margin-top:6px;color:#6b7280;font-size:12px}
.kkw-section{margin-top:16px}
.kkw-section-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.kkw-section-head strong{font-size:16px}
.kkw-info{
  display:inline-flex;align-items:center;justify-content:center;
  width:18px;height:18px;border-radius:999px;
  background:#e5e7eb;color:#111827;font-size:12px;
}
.kkw-choice-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
@media (max-width:700px){.kkw-choice-grid{grid-template-columns:1fr}}
.kkw-choice{position:relative;display:block}
.kkw-choice input{position:absolute;opacity:0;pointer-events:none}
.kkw-choice-box{
  position:relative;
  display:block;
  border-radius:12px;
  overflow:hidden;
  background:#f3f4f6;
  border:1px solid #e5e7eb;
  transition:box-shadow .15s ease, transform .05s ease, border-color .15s ease;
}
.kkw-choice:hover .kkw-choice-box{box-shadow:0 8px 22px rgba(0,0,0,.08)}
.kkw-choice:active .kkw-choice-box{transform:translateY(1px)}
.kkw-choice-img{width:100%;height:150px;background:#fff;display:block}
.kkw-choice-img img{width:100%;height:100%;object-fit:cover;display:block}
.kkw-choice-label{padding:10px 12px;font-weight:600;color:#111827;line-height:1.25}
.kkw-badge{
  position:absolute;top:10px;right:10px;
  background:#facc15;color:#111827;
  border-radius:8px;padding:4px 8px;
  font-size:12px;font-weight:700;
  box-shadow:0 6px 14px rgba(0,0,0,.08);
}
.kkw-check{
  position:absolute;top:10px;left:10px;
  width:18px;height:18px;border-radius:999px;
  background:#fff;border:2px solid #d1d5db;
  box-shadow:0 6px 14px rgba(0,0,0,.06);
}
.kkw-choice input:checked + .kkw-choice-box{border-color:#111827}
.kkw-choice input:checked + .kkw-choice-box .kkw-check{
  background:#facc15;border-color:#111827;
}
.kkw-choice input:checked + .kkw-choice-box .kkw-check:after{
  content:"";
  position:absolute;left:5px;top:2px;
  width:5px;height:9px;
  border:2px solid #111827;
  border-left:0;border-top:0;
  transform:rotate(45deg);
}
.kkw-price-preview{
  margin-top:14px;
  padding:12px;
  border:1px dashed #e5e7eb;
  border-radius:12px;
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
  background:#fafafa;
}
.kkw-modal{position:fixed;inset:0;z-index:9999;display:none}
.kkw-modal-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.6)}
.kkw-modal-body{position:relative;max-width:900px;margin:6vh auto;background:#fff;border-radius:12px;padding:14px}
.kkw-modal-close{position:absolute;top:10px;right:12px;border:0;background:transparent;font-size:22px;cursor:pointer}

/* v0.2.5: option cards responsive (desktop 2-col, mobile stacked) */
.kkw-options-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
@media (max-width:700px){
  .kkw-options-grid{grid-template-columns:1fr}
}
@media (max-width:560px){
  .kkw-options-grid{gap:10px}
  .kkw-option-card{padding:10px}
  .kkw-option-title{font-size:13px}
  .kkw-option-badge{font-size:12px}
}
@media (max-width:380px){
  .kkw-options-grid{gap:8px}
  .kkw-option-card{padding:8px}
}
/* v0.2.4: variation swatches (colors from variations) */
.kkw-variation-block{margin:14px 0}
.kkw-variation-label{display:flex;align-items:center;gap:8px;margin:0 0 10px 0;font-weight:700}
.kkw-swatches{display:flex;flex-wrap:wrap;gap:10px}
.kkw-swatch{
  width:40px;height:40px;border-radius:999px;border:2px solid #e5e7eb;
  background:#fff;display:inline-flex;align-items:center;justify-content:center;
  cursor:pointer;user-select:none;position:relative;
}
.kkw-swatch.is-selected{border-color:#111827}
.kkw-swatch .kkw-swatch-dot{
  width:30px;height:30px;border-radius:999px;border:1px solid rgba(0,0,0,.12);
  background:var(--kkw-swatch,#f3f4f6);
}
.kkw-swatch .kkw-swatch-text{
  position:absolute;bottom:-18px;left:50%;transform:translateX(-50%);
  font-size:11px;color:#374151;white-space:nowrap;
}
@media (max-width:560px){
  .kkw-swatch{width:36px;height:36px}
  .kkw-swatch .kkw-swatch-dot{width:26px;height:26px}
  .kkw-swatch .kkw-swatch-text{display:none}
}

/* v0.2.7: swatches in RAL section */
.kkw-variation-block{margin:0}
.kkw-variation-block .kkw-swatches{margin-top:6px}

/* v0.2.9: variation hint */
.kkw-variation-hint{margin-top:8px;font-size:12px;color:#b91c1c}

/* v0.3.2: color groups UI */
.kkw-color-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
@media (max-width:700px){
  .kkw-color-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
}
@media (max-width:420px){
  .kkw-color-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
}
.kkw-color-card{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px;
  border:1px solid #e5e7eb;
  border-radius:14px;
  background:#fff;
  cursor:pointer;
  position:relative;
  text-align:left;
}
.kkw-color-card:hover{border-color:#cbd5e1}
.kkw-color-card.is-selected{border-color:#111827; box-shadow:0 0 0 2px rgba(17,24,39,.08)}
.kkw-color-dot{
  width:34px;height:34px;border-radius:999px;
  background:var(--kkw-swatch,#f3f4f6);
  border:1px solid rgba(0,0,0,.12);
  flex:0 0 auto;
}
.kkw-color-name{font-weight:700;font-size:13px;line-height:1.2;color:#111827}
.kkw-color-badge{
  margin-left:auto;
  font-weight:700;
  font-size:12px;
  padding:4px 8px;
  border-radius:999px;
  background:#fbbf24;
  color:#111827;
}

/* v0.3.4: color grid 3-up desktop, wraps below */
.kkw-color-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}
@media (max-width:900px){
  .kkw-color-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width:420px){
  .kkw-color-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
}

/* v0.3.4: selected color more obvious */
.kkw-color-card{transition:transform .08s ease, box-shadow .08s ease, border-color .08s ease}
.kkw-color-card.is-selected{
  border-color:#111827;
  box-shadow:0 0 0 3px rgba(17,24,39,.12);
  transform:translateY(-1px);
}
.kkw-color-card.is-selected::after{
  content:"✓";
  position:absolute;
  top:10px;
  right:10px;
  width:22px;height:22px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:#111827;
  color:#fff;
  font-size:13px;
  line-height:1;
}

/* v0.3.8 bounds error */
.kkw-err{margin-top:6px;font-size:12px;color:#b91c1c}
.kkw-has-err .kkw-input{border-color:#b91c1c; box-shadow:0 0 0 2px rgba(185,28,28,.08)}

/* v0.3.8.1 actions layout */
.kkw-actions{
  display:flex;
  gap:12px;
  width:100%;
  align-items:stretch;
}
.kkw-actions .kkw-video-btn{
  flex:1 1 0;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid #e5e7eb;
  background:#fff;
  font-weight:700;
  line-height:1.2;
  min-height:44px;
}
.kkw-actions .kkw-video-btn:hover{border-color:#cbd5e1}
.kkw-actions .kkw-video-btn:focus{outline:none; box-shadow:0 0 0 3px rgba(17,24,39,.10)}
@media (max-width:520px){
  .kkw-actions{gap:10px}
  .kkw-actions .kkw-video-btn{padding:12px 10px}
}

/* v0.3.9.0 font down (2px) */
.kkw-wrap{font-size:14px}
.kkw-wrap .kkw-section-head strong{font-size:14px}
.kkw-wrap .kkw-help{font-size:10px}
.kkw-wrap .kkw-color-name{font-size:12px}
.kkw-wrap .kkw-btn{font-size:14px}
.kkw-wrap .kkw-input{font-size:14px}


/* v0.3.9.4 cart and checkout variation layout fix */
.woocommerce td.product-name dl.variation,
.woocommerce-page td.product-name dl.variation{
  margin:10px 0 0;
  width:100%;
  max-width:100%;
}
.woocommerce td.product-name dl.variation dt,
.woocommerce-page td.product-name dl.variation dt,
.woocommerce td.product-name dl.variation dd,
.woocommerce-page td.product-name dl.variation dd{
  float:none;
  clear:both;
  display:block;
  width:100%;
  max-width:100%;
  margin:0;
  padding:0;
}
.woocommerce td.product-name dl.variation dt,
.woocommerce-page td.product-name dl.variation dt{
  font-weight:700;
  line-height:1.35;
  word-break:normal;
  overflow-wrap:break-word;
}
.woocommerce td.product-name dl.variation dd,
.woocommerce-page td.product-name dl.variation dd{
  margin:0 0 8px;
  padding:2px 0 0;
}
.woocommerce td.product-name dl.variation dd p,
.woocommerce-page td.product-name dl.variation dd p{
  margin:0;
  line-height:1.45;
  word-break:normal;
  overflow-wrap:break-word;
}
.woocommerce td.product-name dl.variation::after,
.woocommerce-page td.product-name dl.variation::after{
  content:"";
  display:block;
  clear:both;
}
@media (max-width:768px){
  .woocommerce table.shop_table_responsive tr.cart_item td.product-name,
  .woocommerce-page table.shop_table_responsive tr.cart_item td.product-name,
  .woocommerce table.shop_table_responsive tr.order_item td.product-name,
  .woocommerce-page table.shop_table_responsive tr.order_item td.product-name{
    padding-right:12px;
  }
  .woocommerce table.shop_table_responsive tr.cart_item td.product-name .product-quantity,
  .woocommerce-page table.shop_table_responsive tr.cart_item td.product-name .product-quantity,
  .woocommerce table.shop_table_responsive tr.order_item td.product-name .product-quantity,
  .woocommerce-page table.shop_table_responsive tr.order_item td.product-name .product-quantity{
    display:block;
    margin-top:6px;
  }
  .woocommerce table.shop_table_responsive tr.cart_item td.product-name dl.variation,
  .woocommerce-page table.shop_table_responsive tr.cart_item td.product-name dl.variation,
  .woocommerce table.shop_table_responsive tr.order_item td.product-name dl.variation,
  .woocommerce-page table.shop_table_responsive tr.order_item td.product-name dl.variation{
    display:block !important;
    margin-top:10px;
  }
  .woocommerce table.shop_table_responsive tr.cart_item td.product-name dl.variation dt,
  .woocommerce-page table.shop_table_responsive tr.cart_item td.product-name dl.variation dt,
  .woocommerce table.shop_table_responsive tr.order_item td.product-name dl.variation dt,
  .woocommerce-page table.shop_table_responsive tr.order_item td.product-name dl.variation dt{
    padding-top:8px;
    border-top:1px solid rgba(0,0,0,.08);
  }
  .woocommerce table.shop_table_responsive tr.cart_item td.product-name dl.variation dt:first-of-type,
  .woocommerce-page table.shop_table_responsive tr.cart_item td.product-name dl.variation dt:first-of-type,
  .woocommerce table.shop_table_responsive tr.order_item td.product-name dl.variation dt:first-of-type,
  .woocommerce-page table.shop_table_responsive tr.order_item td.product-name dl.variation dt:first-of-type{
    padding-top:0;
    border-top:0;
  }
  .woocommerce table.shop_table_responsive tr.cart_item td.product-name dl.variation dd,
  .woocommerce-page table.shop_table_responsive tr.cart_item td.product-name dl.variation dd,
  .woocommerce table.shop_table_responsive tr.order_item td.product-name dl.variation dd,
  .woocommerce-page table.shop_table_responsive tr.order_item td.product-name dl.variation dd{
    padding-left:0;
    margin-bottom:10px;
  }
}
