/* ============================================================
   SIMPLECHECKOUT (BASE) + DEALS ADAPTATION (SCOPED)
   Clean / Optimized build
   ============================================================ */

/* -------------------------
   0) Base SimpleCheckout
   ------------------------- */
.simple-content { margin: 0 5px; }
.simple-content fieldset { text-align: left; }
.simple-content fieldset h3 { margin: 0; }
.simple-content .name { float: none !important; }
.simple-content .button,
#simplecheckout_login .button { margin: 0 !important; }
.simple-content .buttons { margin: 0 0 15px 0; border: none; }
.simple-content .form-control { width: 100%; }

.simplecheckout { width: 100%; }
.simplecheckout:after,
.simplecheckout-button-block:after { content: ""; display: block; clear: both; }

/* three columns (if used in templates) */
.simplecheckout-three-column { float:left; margin-right:2%; min-width:200px; max-width:500px; width:32%; }
.simplecheckout-three-column + .simplecheckout-three-column + .simplecheckout-three-column { margin-right:0; float:right; }
@media (max-width:768px){
  .simplecheckout-three-column { float:none; width:100%; min-width:auto !important; max-width:1900px !important; }
}

/* default float columns (compat) */
.simplecheckout-left-column { float:left; margin-right:10px; min-width:280px; max-width:900px; width:52%; }
.simplecheckout-right-column { float:right; min-width:280px; max-width:900px; width:46%; }
@media (max-width:1024px){
  .simplecheckout-left-column,
  .simplecheckout-right-column{
    float:none;
    width:100% !important;
    min-width:auto !important;
    max-width:1900px !important;
  }
}

.simplecheckout-block { clear: both; margin-bottom: 20px; }
.simplecheckout-block-content { padding-bottom: 10px; }
.simplecheckout-block-content:after { content:""; display:block; clear:both; }

/* payment/shipping methods base */
.simplecheckout-methods-table { width:100%; }
.simplecheckout-methods-table td.code { width:1px; }
.simplecheckout-methods-table td.title { padding:5px; }
.simplecheckout-methods-table td.title label { display:block !important; }
.simplecheckout-methods-table td.quote { width:15%; text-align:right; }
.simplecheckout-methods-description { padding:5px; margin:5px 0; }

/* warnings */
.simplecheckout-warning-block{
  clear: both;
  margin-bottom: 15px;
  padding: 10px 10px 10px 33px;
  border: 1px solid #F8ACAC;
  border-radius: 5px;
  color: #555;
  text-align: left;
}

/* buttons base */
.simplecheckout-button-block{
  clear: both;
  margin-bottom: 20px;
  padding: 6px;
  background: #fff;
  text-align: right;
}
.simplecheckout-button-right { float:right; text-align:right; }
.simplecheckout-button-left { float:left; text-align:left; }
@media (max-width:780px){ .simplecheckout-button-left{ display:none; } }

/* cart base table */
#simplecheckout_cart .form-control { display:inline-block !important; min-width:50px; }
.simplecheckout-cart{
  margin:0 !important;
  width:100%;
  border-collapse:collapse;
  border-top:1px solid #ddd;
  border-right:1px solid #ddd;
  border-left:1px solid #ddd;
}
.simplecheckout-cart th{
  padding:8px;
  border-bottom:1px solid #ddd;
  background:#f8f8f8;
  color:#4d4d4d;
  font-weight:bold;
}
.simplecheckout-cart td{
  padding:7px;
  border-bottom:1px solid #ddd;
  vertical-align: top;
}
.simplecheckout-cart td.quantity{
  min-width:70px;
  text-align:center;
  white-space:nowrap;
}
.simplecheckout-cart td.quantity input{ float:none !important; }
.simplecheckout-cart td.price,
.simplecheckout-cart td.total{ text-align:right; white-space:nowrap; }

/* inputs */
.simple-content input[type=text],
.simple-content input[type=password],
.simple-content input[type=email],
.simple-content input[type=tel],
.simple-content input[type=phone],
.simple-content input[type=date],
.simple-content input[type=time],
.simple-content select,
.simple-content textarea{
  width:100%;
  box-sizing:border-box;
  margin:0 !important;
}

/* ============================================================
   1) DEALS SCOPED STYLE (inside .ds-checkout)
   ============================================================ */

/* container sizing */
.ds-checkout .simplecheckout{
  max-width:1200px;
  margin:0 auto;
}

/* stable 2-col layout on desktop */
@media (min-width:1025px){
  .ds-checkout .simplecheckout-step{
    display:flex;
    flex-wrap:wrap;
    gap:24px;
  }
  .ds-checkout .simplecheckout-left-column,
  .ds-checkout .simplecheckout-right-column{
    float:none !important;
    margin:0 !important;
    min-width:0 !important;
    max-width:none !important;
    box-sizing:border-box;
  }
  .ds-checkout .simplecheckout-left-column{ width:calc(50% - 12px); }
  .ds-checkout .simplecheckout-right-column{ width:calc(50% - 12px); }

  .ds-checkout #simplecheckout_cart,
  .ds-checkout #simplecheckout_comment,
  .ds-checkout #simplecheckout_summary,
  .ds-checkout #simplecheckout_payment_form{
    width:100%;
  }
}
@media (max-width:1024px){
  .ds-checkout .simplecheckout-step{ display:block; }
}

/* cards */
.ds-checkout .simplecheckout-block{
  background:#fff;
  border:1px solid #eef0f4;
  border-radius:12px;
  margin-bottom:24px;
  overflow:visible;
}
.ds-checkout .simplecheckout-block-content{
  padding:20px;
}

/* headings spacing */
.ds-checkout .simplecheckout-block-heading,
.ds-checkout .checkout-heading{
  background:transparent !important;
  border:0 !important;
  margin:16px 16px 0 16px !important;
  padding:0 0 12px 0 !important;
  font-weight:700;
  font-size:18px;
  color:#25314c;
}
.ds-checkout .simplecheckout-block-heading:after,
.ds-checkout .checkout-heading:after{
  content:"";
  display:block;
  height:1px;
  background:#eef0f4;
  margin-top:12px;
}

/* fields */
.ds-checkout .simplecheckout input[type="text"],
.ds-checkout .simplecheckout input[type="email"],
.ds-checkout .simplecheckout input[type="tel"],
.ds-checkout .simplecheckout input[type="password"],
.ds-checkout .simplecheckout select,
.ds-checkout .simplecheckout textarea{
  height:46px;
  border-radius:10px;
  border:1px solid #e5e7eb;
  padding:10px 12px;
  background:#f9fafb;
  outline:none;
}
.ds-checkout .simplecheckout textarea{ min-height:120px; height:auto; }
.ds-checkout .simplecheckout input:focus,
.ds-checkout .simplecheckout select:focus,
.ds-checkout .simplecheckout textarea:focus{
  background:#fff;
  border-color:#3d63e7;
}

/* radios/checkboxes must remain real for Simple JS */
.ds-checkout .simplecheckout input[type="radio"],
.ds-checkout .simplecheckout input[type="checkbox"]{
  opacity:1;
  position:static;
  margin-right:8px;
  cursor:pointer;
}

/* payment/shipping method tiles */
.ds-checkout .simplecheckout-methods-table td.title label{
  display:flex !important;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  border:1px solid #e5e7eb;
  border-radius:12px;
  background:#f9fafb;
  margin:8px 0;
}
.ds-checkout .simplecheckout-methods-table td.title label:hover{
  border-color:#3d63e7;
  background:#fff;
}

/* ============================================================
   2) Prevent SmartCheckout CSS affecting SimpleCheckout
   ============================================================ */
.ds-checkout .oct-checkout-block,
.ds-checkout .oct-checkout-actions,
.ds-checkout .ds-checkout-payment{
  height:auto !important;
  min-height:unset !important;
}
.ds-checkout .form-check-item{
  border:none !important;
  background:transparent !important;
  padding:0 !important;
}
.ds-checkout .form-check-item:has(:checked){
  background:transparent !important;
}
.ds-checkout .simplecheckout ul.dropdown-address{
  z-index:1000;
  position:absolute;
}
.ds-checkout .content-block:hover{ box-shadow:none !important; }
.ds-checkout .simplecheckout-block{ height:auto !important; }

/* ============================================================
   3) CART (DESKTOP) — clean + stable
   ============================================================ */
.ds-checkout .table-responsive{ overflow-x:auto; }

.ds-checkout .simplecheckout-cart{
  border:1px solid #eef0f4;
  border-radius:12px;
  overflow:hidden;
  border-collapse:separate;
  border-spacing:0;
  table-layout:fixed;
}
.ds-checkout .simplecheckout-cart th{
  background:#f9fafb;
  border-bottom:1px solid #eef0f4;
  font-weight:600;
  color:#6b7280;
}
.ds-checkout .simplecheckout-cart td{ vertical-align:middle; }

.ds-checkout .simplecheckout-cart col.image{ width:80px; }
.ds-checkout .simplecheckout-cart col.model{ width:120px; }
.ds-checkout .simplecheckout-cart col.quantity{ width:190px; }
.ds-checkout .simplecheckout-cart col.price{ width:120px; }
.ds-checkout .simplecheckout-cart col.total{ width:120px; }
.ds-checkout .simplecheckout-cart col.remove{ width:1px; }

.ds-checkout .simplecheckout-cart td.name{
  white-space:normal;
  overflow-wrap:anywhere;
}
.ds-checkout .simplecheckout-cart td.model{
  text-align:center;
  color:#6b7280;
  font-size:13px;
}

/* remove second image inside name on desktop */
.ds-checkout #simplecheckout_cart .simplecheckout-cart td.name .image{ display:none; }

/* qty controls desktop */
.ds-checkout .simplecheckout-cart td.quantity .input-group.btn-block{ max-width:200px; margin:0 auto; }
.ds-checkout .simplecheckout-cart td.quantity .btn{
  width:34px;
  height:34px;
  padding:0;
  border-radius:10px;
}
.ds-checkout .simplecheckout-cart td.quantity input.form-control{
  width:56px !important;
  height:34px;
  border-radius:10px;
  border:1px solid #e5e7eb;
  background:#fff;
  text-align:center;
  padding:0;
}

/* totals right side (desktop) */
.ds-checkout #simplecheckout_cart .simplecheckout-cart-total,
.ds-checkout #simplecheckout_cart .simplecheckout-cart-buttons{
  max-width:420px;
  float:right;
}
.ds-checkout #simplecheckout_cart .simplecheckout-cart-total{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 0;
}
.ds-checkout #simplecheckout_cart .simplecheckout-cart-total-value{
  white-space:nowrap;
  text-align:right;
  font-weight:700;
}
.ds-checkout #simplecheckout_cart .simplecheckout-cart-total .inputs{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.ds-checkout #simplecheckout_cart .simplecheckout-cart-total .inputs input.form-control{
  max-width:220px;
}

/* caret blink fix (left part of cart) */
.ds-checkout #simplecheckout_cart .simplecheckout-cart td.image,
.ds-checkout #simplecheckout_cart .simplecheckout-cart td.name,
.ds-checkout #simplecheckout_cart .simplecheckout-cart td.name *{
  cursor:default;
  -webkit-user-select:none;
  user-select:none;
  caret-color:transparent;
}
.ds-checkout #simplecheckout_cart .simplecheckout-cart td.name a{
  cursor:pointer;
  -webkit-user-select:text;
  user-select:text;
  caret-color:auto;
}
.ds-checkout #simplecheckout_cart .simplecheckout-cart td.quantity input{
  -webkit-user-select:text;
  user-select:text;
  caret-color:auto;
}

/* ============================================================
   4) CART (MOBILE) — title row + controls row
   Requires: tr.sc-cart-mobile-title + td.sc-desktop-name in cart.twig
   ============================================================ */
@media (max-width:767px){

  /* hide table header on mobile */
  .ds-checkout #simplecheckout_cart .simplecheckout-cart thead{ display:none; }

  /* show the mobile-only title row */
  .ds-checkout #simplecheckout_cart .simplecheckout-cart tr.sc-cart-mobile-title{ display:table-row; }
  .ds-checkout #simplecheckout_cart .sc-cart-mobile-title-td{
    padding:12px 12px 8px !important;
    border-bottom:0 !important;
  }
  .ds-checkout #simplecheckout_cart .sc-cart-mobile-title-td a{
    display:block;
    font-weight:700;
    line-height:1.35;
    white-space:normal;
  }

  /* hide desktop name cell on mobile */
  .ds-checkout #simplecheckout_cart td.sc-desktop-name,
  .ds-checkout #simplecheckout_cart th.name{ display:none !important; }

  /* hide extra columns */
  .ds-checkout #simplecheckout_cart .simplecheckout-cart td.model,
  .ds-checkout #simplecheckout_cart .simplecheckout-cart td.price,
  .ds-checkout #simplecheckout_cart .simplecheckout-cart th.model,
  .ds-checkout #simplecheckout_cart .simplecheckout-cart th.price,
  .ds-checkout #simplecheckout_cart .simplecheckout-cart col.model,
  .ds-checkout #simplecheckout_cart .simplecheckout-cart col.price{ display:none !important; }

  /* ensure image/qty/total are visible */
  .ds-checkout #simplecheckout_cart .simplecheckout-cart td.image,
  .ds-checkout #simplecheckout_cart .simplecheckout-cart col.image{ display:table-cell !important; }
  .ds-checkout #simplecheckout_cart .simplecheckout-cart td.image{ width:72px !important; }
  .ds-checkout #simplecheckout_cart .simplecheckout-cart td.image img{
    width:60px;
    border-radius:8px;
    display:block;
  }

  /* prevent overlap: fixed widths + fixed table */
  .ds-checkout #simplecheckout_cart .simplecheckout-cart{ table-layout:fixed !important; }
  .ds-checkout #simplecheckout_cart .simplecheckout-cart td.quantity{ width:210px !important; padding-left:34px !important; overflow:visible !important; }
  .ds-checkout #simplecheckout_cart .simplecheckout-cart td.total{
    width:105px !important;
    white-space:nowrap !important;
    text-align:right !important;
    font-weight:700;
    padding-left:125px !important;
  }

  /* qty controls: always in one row + includes remove */
  .ds-checkout #simplecheckout_cart .simplecheckout-cart td.quantity .input-group.btn-block{
    display:inline-flex !important;
    flex-wrap:nowrap !important;
    align-items:center !important;
    gap:8px !important;
    max-width:210px !important;
    width:auto !important;
    margin:0 !important;
    white-space:nowrap !important;
  }
  .ds-checkout #simplecheckout_cart .simplecheckout-cart td.quantity .input-group-btn{
    display:inline-flex !important;
    align-items:center !important;
    gap:8px !important;
    width:auto !important;
  }
  .ds-checkout #simplecheckout_cart .simplecheckout-cart td.quantity .btn{
    width:34px !important;
    height:34px !important;
    padding:0 !important;
    border-radius:12px !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    flex:0 0 auto !important;
  }
  .ds-checkout #simplecheckout_cart .simplecheckout-cart td.quantity input.form-control{
    width:48px !important;
    height:34px !important;
    padding:0 !important;
    text-align:center !important;
    border-radius:12px !important;
    background:#fff !important;
    flex:0 0 auto !important;
  }
  .ds-checkout #simplecheckout_cart .simplecheckout-cart td.quantity .btn.btn-danger{
    display:inline-flex !important;
    opacity:1 !important;
    visibility:visible !important;
  }
}

/* mobile title row must be hidden on desktop */
@media (min-width:768px){
  .ds-checkout #simplecheckout_cart tr.sc-cart-mobile-title{ display:none !important; }
}
