/* SUBINCHO / Three-column purchase layout: scoped exclusively to the product page. */
#product-product .sb-three-col-layout { margin-left:0; margin-right:0; }
#product-product .sb-product-gallery,
#product-product .sb-product-details { min-width:0; }
#product-product .sb-purchase-ui, #product-product .sb-purchase-ui * { box-sizing:border-box; }
/* Do not override global text or button colors supplied by the storefront theme. */
#product-product .sb-main-config-col { min-width:0; }
#product-product .sb-buy-col { min-width:0; }
#product-product .sb-summary { padding:3px 1px 14px; margin:0 0 18px; border-bottom:1px solid #e2eaf0; }
#product-product .sb-summary .description { margin:0 0 12px; }
#product-product .sb-summary ul.descr { display:flex; flex-wrap:wrap; gap:7px 8px; list-style:none; margin:0 0 10px; padding:0; }
#product-product .sb-summary ul.descr li { border:1px solid #e4ebf0; background:#f6f9fb; border-radius:5px; padding:5px 8px; font-size:12px; line-height:1.3; color:#34536a; }
#product-product .sb-summary .attr { display:flex; flex-wrap:wrap; gap:6px 15px; margin:0; padding:0; list-style:none; font-size:12px; }
#product-product .sb-summary .attr li { margin:0; padding:0; float:none; }
#product-product .sb-summary .attr .desc { color:#708293; }
#product-product .sb-config-card { padding:18px 18px 20px; margin:0; background:#f6fafd; border:1px solid #dbeaf2; border-radius:12px; }
#product-product .sb-config-header { margin:0 0 18px; }
#product-product .sb-config-header h2 { font-size:19px; font-weight:750; line-height:1.3; color:#1f3c53; margin:0 0 6px; }
#product-product .sb-config-header p { color:#627b8d; font-size:12px; line-height:1.45; margin:0; }
#product-product .sb-option-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:13px; align-items:start; }
#product-product .sb-option-field { min-width:0; }
#product-product .sb-option-field .form-group { margin:0; }
#product-product .sb-option-field .control-label { display:block; margin:0 0 6px; font-size:13px; font-weight:650; line-height:1.35; color:#2a4558; text-align:left; }
#product-product .sb-option-field .form-control { display:block; height:43px; width:100%; padding:7px 11px; border:1px solid #cad9e4; border-radius:7px; box-shadow:none; color:#294255; background-color:#fff; font-size:13px; }
#product-product .sb-option-field textarea.form-control { height:auto; }
#product-product .sb-option-field .input-group { width:100%; }
#product-product .sb-option-field .input-group .form-control { width:100%; }
#product-product .sb-option-field .form-control:focus { border-color:#278fb8; box-shadow:0 0 0 3px rgba(39,143,184,.10); }
#product-product .sb-option-field .radio, #product-product .sb-option-field .checkbox { margin:6px 0; }
#product-product .sb-option-field .radio label, #product-product .sb-option-field .checkbox label { line-height:1.5; }
#product-product .sb-option-field .text-danger { margin-top:4px; font-size:12px; }
#product-product .sb-option-field .has-error .form-control { border-color:#c95454; }
#product-product .sb-config-card .form-group.required .control-label:before { content:'* '; color:#c95454; }
#product-product .sb-checkout-card { background:#fff; border:1px solid #dae5ec; border-radius:12px; box-shadow:0 5px 22px rgba(20,52,70,.065); padding:21px 20px; }
#product-product .sb-stock-row { display:flex; align-items:center; gap:7px; color:#1d825c; font-size:13px; font-weight:700; margin-bottom:18px; }
#product-product .sb-stock-dot { width:8px; height:8px; border-radius:50%; background:#23a26b; box-shadow:0 0 0 3px #dff5e9; flex:none; }
#product-product .sb-final-price { display:flex; flex-direction:column; align-items:flex-start; gap:8px; border-bottom:1px solid #e6edf1; padding-bottom:17px; margin-bottom:17px; }
#product-product .sb-final-price-caption { display:flex; flex-direction:column; gap:4px; }
#product-product .sb-final-price-caption strong { color:#687f8d; font-size:13px; font-weight:650; }
#product-product .sb-final-price-caption small { color:#82949f; font-size:11px; line-height:1.35; }
#product-product .sb-final-price-value { width:100%; text-align:left; }
#product-product .sb-final-price-value ul.price { list-style:none; padding:0; margin:0; }
#product-product .sb-final-price-value .price li { margin:0; padding:0; float:none; }
#product-product .sb-final-price-value h3.product-price,
#product-product .sb-final-price-value h3.special-price { font-size:31px; font-weight:800; margin:0; padding:0; line-height:1.15; color:#173f59; }
#product-product .sb-final-price-value .old-price { font-size:14px; color:#9aa8b1; }
#product-product .sb-final-price-value .rewardpoint,
#product-product .sb-final-price-value .discount { font-size:12px; color:#6e8391; }
/* Match original OpenCart button DOM: all buttons are direct children of .qty.
   CSS grid only positions them; the storefront theme controls colors, icons and hover states. */
#product-product .sb-purchase-qty {
  display:grid;
  grid-template-columns:minmax(0,1fr) 42px 42px;
  gap:8px;
  align-items:stretch;
  position:static;
  float:none;
  width:100%;
  margin:0;
  padding:0;
}
#product-product .sb-purchase-qty > .alert { grid-column:1/-1; }
#product-product .sb-purchase-qty > #button-cart {
  grid-column:1/-1;
  display:block;
  position:static;
  float:none;
  width:100%;
  min-height:49px;
  margin:0;
}
/* Cart icon uses the theme's existing codezeel/icons.png sprite.
   The sprite URL is read from the native wishlist CSS at runtime so the
   theme directory does not need to be hardcoded here. No button colors change. */
#product-product .sb-purchase-qty > #button-cart::before,
#product-product .sb-mobile-cart::before {
  content:"";
  display:inline-block;
  width:20px;
  height:20px;
  margin-right:8px;
  vertical-align:-9px;
  background-image:var(--sb-native-cart-sprite, none);
  background-repeat:no-repeat;
  background-position:0 var(--sb-native-cart-sprite-y, 0px);
  flex:none;
}
#product-product .sb-purchase-qty > .request {
  grid-column:1;
  position:static;
  float:none;
  width:100%;
  min-width:0;
  margin:0;
}
#product-product .sb-purchase-qty > .wishlist {
  grid-column:2;
  position:static;
  float:none;
  margin:0;
}
#product-product .sb-purchase-qty > .compare {
  grid-column:3;
  position:static;
  float:none;
  margin:0;
}
#product-product .sb-reservation-wrap { margin:9px 0 0; }
#product-product .sb-reservation-wrap .timer { text-align:center; font-size:12px; }
/* Timer visibility is managed by the existing reservation module. */
/* Compatibility override for a previously cached CSS rule from older product.twig.
   Respect the reservation module's inline visibility:hidden/visible state. */
#product-product .sb-reservation-wrap .timer:not([expired]) {
  display: block !important;
}

#sb-buybar-footer-spacer { display:none; }
#product-product .sb-mobile-buybar { display:none; }
/* On wide pages without sidebars use the classic gallery/configuration/buying three-column composition. */
@media (min-width:1200px) {
  #product-product #content.col-sm-12 > .sb-three-col-layout { display:grid; grid-template-columns:minmax(0,1.00fr) minmax(0,1.10fr) minmax(292px,.83fr); gap:20px; align-items:start; }
  #product-product #content.col-sm-12 > .sb-three-col-layout > .sb-product-gallery { grid-column:1; grid-row:1; float:none; width:auto; padding:0; margin:0; }
  #product-product #content.col-sm-12 > .sb-three-col-layout > .sb-product-details { display:contents; }
  #product-product #content.col-sm-12 > .sb-three-col-layout .sb-purchase-ui { display:contents; }
  #product-product #content.col-sm-12 > .sb-three-col-layout .sb-main-config-col { grid-column:2; grid-row:1; }
  #product-product #content.col-sm-12 > .sb-three-col-layout .sb-buy-col { grid-column:3; grid-row:1; position:sticky; top:18px; align-self:start; margin-right: -15px;}
}
/* Sites with sidebars or smaller screens use a spacious, stable two-column fallback. */
@media (min-width:768px) and (max-width:1199px) {
  #product-product .sb-main-config-col { margin-bottom:18px; }
}
@media (max-width:767px) {
  #product-product .sb-three-col-layout > .sb-product-gallery,
  #product-product .sb-three-col-layout > .sb-product-details { float:none; width:100%; padding-left:0; padding-right:0; }
  #product-product .sb-main-config-col { margin:0 0 16px; }
  #product-product .sb-summary { padding-top:12px; }
  #product-product .sb-config-card { padding:15px; border-radius:10px; }
  #product-product .sb-config-header h2 { font-size:18px; }
  #product-product .sb-checkout-card { padding:17px; }
  #product-product .sb-final-price-value h3.product-price,
  #product-product .sb-final-price-value h3.special-price { font-size:28px; }
  #product-product .sb-mobile-buybar {
    position:fixed; left:0; right:0; bottom:0; z-index:900;
    display:flex; align-items:center; justify-content:space-between; gap:11px;
    padding:10px 13px max(10px,env(safe-area-inset-bottom));
    background:#fff; border-top:1px solid #dce8ee;
    box-shadow:0 -4px 16px rgba(23,54,73,.12);
    /* Keep it in the layout so class changes can animate. */
    opacity:0;
    transform:translate3d(0,calc(100% + 12px),0);
    visibility:hidden;
    pointer-events:none;
    transition:transform .28s ease, opacity .24s ease, visibility 0s linear .28s;
  }
  /* The class is still controlled by the existing scroll/visibility logic. */
  #product-product .sb-mobile-buybar.sb-buybar-visible {
    opacity:1;
    transform:translate3d(0,0,0);
    visibility:visible;
    pointer-events:auto;
    transition:transform .28s ease, opacity .24s ease, visibility 0s;
  }
  /* Preserve server-side disabled/reserved state. */
  #product-product .sb-mobile-buybar[hidden] { display:none; }
  #product-product .sb-mobile-buybar-price { display:flex; flex-direction:column; flex:1; min-width:0; }
  #product-product .sb-mobile-buybar-price small { font-size:10px; color:#78909f; }
  #product-product .sb-mobile-buybar-price strong { font-size:19px; font-weight:800; line-height:1.2; white-space:nowrap; color:#173e57; }
  /* The fixed mobile cart button uses btn-primary too, never a separate custom color. */
  #product-product .sb-mobile-cart { min-height:43px; padding:8px 16px; white-space:nowrap; }
  /* Spacer is placed AFTER the site footer so the fixed bar cannot cover its last lines. */
  #sb-buybar-footer-spacer { display:block; height:98px; }
}
@media (prefers-reduced-motion: reduce) {
  #product-product .sb-mobile-buybar,
  #product-product .sb-mobile-buybar.sb-buybar-visible { transition:none; }
}
/* Gallery and short specs adapt to the narrower column without altering image/zoom IDs. */
#product-product .sb-product-gallery .product-info,
#product-product .sb-product-gallery .product-image,
#product-product .sb-product-gallery .image { max-width:100%; width:100%; }
#product-product .sb-product-gallery .product-image { float:none; }
#product-product .sb-product-gallery .image img { max-width:100%; height:auto; }
#product-product .sb-product-gallery .img-info { margin:0 0 12px; font-size:12px; font-weight:700; color:#557d94; }
#product-product .sb-summary-title { font-size:16px; line-height:1.3; font-weight:700; color:#2a4d65; margin:0 0 12px; }
/* Sections below the purchase area are outside the three-column grid. */
#product-product .sb-below-product > .extra,
#product-product .sb-below-product > #tabs_info { clear:both; width:100%; }
#product-product .sb-below-product > .extra { margin-top:24px; }

/* Product options as visible selectable tiles (only the configurator). */
#product-product .sb-option-field .sb-options-tiles { display:flex; flex-wrap:wrap; align-items:stretch; gap:8px; }
#product-product .sb-option-field .sb-options-tiles[hidden] { display:none !important; }
#product-product .sb-option-field .sb-option-tile {
  appearance:none; -webkit-appearance:none; display:flex; flex:1 1 112px; max-width:calc(50% - 4px);
  flex-direction:column; justify-content:center; align-items:flex-start; gap:3px;
  min-height:48px; min-width:0; padding:9px 11px;
  background:#fff; border:1px solid #ccdce6; border-radius:7px;
  text-align:left; font-size:12px; line-height:1.35; color:#274354;
  font-weight:600; box-shadow:none; text-shadow:none; cursor:pointer;
}
#product-product .sb-option-field .sb-option-tile:hover { border-color:#70bedb; background:#f5fbfe; }
#product-product .sb-option-field .sb-option-tile.is-selected {
  background:#e9faff; border:2px solid #00aef0; padding:8px 10px;
}
#product-product .sb-option-field .sb-option-tile:focus-visible { outline:2px solid #00aef0; outline-offset:2px; }
#product-product .sb-option-field .sb-option-tile:disabled { opacity:.5; cursor:not-allowed; }
#product-product .sb-option-field .sb-option-tile-name { display:block; overflow-wrap:anywhere; }
#product-product .sb-option-field .sb-option-tile-price { display:block; font-size:11px; font-weight:500; color:#5d7281; }
#product-product .sb-option-field .sb-tile-option-group.sb-tiles-enhanced > .sb-native-option-select {
  position:absolute !important; overflow:hidden !important; clip:rect(0,0,0,0) !important;
  clip-path:inset(50%) !important; width:1px !important; height:1px !important;
  padding:0 !important; border:0 !important; margin:-1px !important; opacity:0 !important;
}
#product-product .sb-option-field .sb-tile-option-group.has-error .sb-options-tiles { outline:1px solid #c95454; border-radius:7px; }
@media (max-width:420px) { #product-product .sb-option-field .sb-option-tile { flex-basis:calc(50% - 4px); } }
