/* =========================================================
   RR Audiocar — Página de carrito moderna
   Override de /carrito-de-compras/ alineado con el drawer.
   ========================================================= */

:root{
  --rrc-bg:#f7f8fa;
  --rrc-surface:#ffffff;
  --rrc-border:#e5e7eb;
  --rrc-text:#111827;
  --rrc-muted:#6b7280;
  --rrc-red:#d00000;
  --rrc-red-dark:#8f0000;
  --rrc-radius:14px;
  --rrc-shadow:0 4px 16px rgba(0,0,0,.06);
}

/* Layout general */
body.woocommerce-cart .woocommerce{
  max-width:1280px;
  margin:0 auto;
  padding:24px 16px 48px;
}

body.woocommerce-cart .woocommerce > h2,
body.woocommerce-cart .woocommerce > h1,
body.woocommerce-cart .entry-title{
  font-size:28px;
  font-weight:800;
  color:var(--rrc-text);
  margin:0 0 24px;
}

/* Grid principal: items izquierda, summary derecha */
.rr-cart-page{
  display:grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap:28px;
  align-items:start;
}

.rr-cart-page__form{
  background:var(--rrc-surface);
  border:1px solid var(--rrc-border);
  border-radius:var(--rrc-radius);
  box-shadow:var(--rrc-shadow);
  padding:8px 8px 20px;
}

.rr-cart-page__summary{
  position:sticky;
  top:96px;
  display:flex;
  flex-direction:column;
  gap:16px;
}

/* Filas de productos */
.rr-cart-page__items{
  display:flex;
  flex-direction:column;
}

.rr-cart-row{
  display:grid;
  grid-template-columns: 96px 1fr 140px 120px 40px;
  align-items:center;
  gap:16px;
  padding:18px 14px;
  border-bottom:1px solid var(--rrc-border);
}
.rr-cart-row:last-child{ border-bottom:0; }

.rr-cart-row__thumb img{
  width:96px; height:96px;
  object-fit:contain;
  border-radius:10px;
  background:#fff;
  border:1px solid var(--rrc-border);
  display:block;
}

.rr-cart-row__name{
  font-size:15px;
  font-weight:600;
  line-height:1.35;
  margin:0 0 6px;
}
.rr-cart-row__name a{
  color:var(--rrc-text);
  text-decoration:none;
}
.rr-cart-row__name a:hover{ color:var(--rrc-red); }

.rr-cart-row__meta{
  color:var(--rrc-muted);
  font-size:13px;
}
.rr-cart-row__unit-price{
  font-weight:500;
}

/* Cantidad: usa el componente quantity de Woo */
.rr-cart-row__qty .quantity{
  display:inline-flex;
  align-items:center;
  border:1px solid var(--rrc-border);
  border-radius:10px;
  overflow:hidden;
  background:#fff;
  height:38px;
}
.rr-cart-row__qty .quantity input.qty{
  width:48px;
  height:36px;
  border:0;
  text-align:center;
  font-size:14px;
  font-weight:600;
  -moz-appearance:textfield;
  background:transparent;
}
.rr-cart-row__qty .quantity input.qty::-webkit-inner-spin-button,
.rr-cart-row__qty .quantity input.qty::-webkit-outer-spin-button{
  -webkit-appearance:none; margin:0;
}

.rr-cart-row__subtotal{
  text-align:right;
  font-weight:800;
  font-size:16px;
  color:var(--rrc-text);
}
.rr-cart-row__subtotal .woocommerce-Price-amount{ white-space:nowrap; }

.rr-cart-row__remove{
  text-align:right;
}
.rr-cart-row__remove-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:32px;
  height:32px;
  border-radius:50%;
  background:#f3f4f6;
  color:var(--rrc-muted) !important;
  font-size:20px;
  line-height:1;
  text-decoration:none;
  transition:background .15s, color .15s;
}
.rr-cart-row__remove-btn:hover{
  background:var(--rrc-red);
  color:#fff !important;
}

/* Actions bar (cupón + actualizar) */
.rr-cart-page__actions{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:12px;
  padding:16px 14px 0;
  border-top:1px solid var(--rrc-border);
  margin-top:8px;
}

.rr-cart-coupon{
  flex:1 1 auto;
  min-width:240px;
}
.rr-cart-coupon > summary{
  cursor:pointer;
  font-weight:600;
  font-size:14px;
  color:var(--rrc-text);
  list-style:none;
  padding:8px 0;
}
.rr-cart-coupon > summary::-webkit-details-marker{ display:none; }
.rr-cart-coupon > summary::before{
  content:"+ ";
  color:var(--rrc-red);
  font-weight:800;
}
.rr-cart-coupon[open] > summary::before{ content:"− "; }

.rr-cart-coupon__body{
  display:flex;
  gap:8px;
  margin-top:10px;
}
.rr-cart-coupon__body input.input-text{
  flex:1 1 auto;
  height:42px;
  border:1px solid var(--rrc-border);
  border-radius:10px;
  padding:0 12px;
  font-size:14px;
  background:#fff;
}
.rr-cart-coupon__apply{
  height:42px;
  padding:0 16px;
  border-radius:10px;
  border:0;
  background:var(--rrc-text);
  color:#fff;
  font-weight:600;
  cursor:pointer;
}
.rr-cart-coupon__apply:hover{ background:#000; }

.rr-cart-update{
  height:42px;
  padding:0 18px;
  border-radius:10px;
  border:1px solid var(--rrc-border);
  background:#fff;
  color:var(--rrc-text);
  font-weight:600;
  cursor:pointer;
}
.rr-cart-update:hover{ border-color:#9ca3af; }
.rr-cart-update[disabled]{ opacity:.6; cursor:not-allowed; }

/* Summary box (cart_totals + shipping_calc + cross-sells por Woo) */
.rr-cart-page__summary .cart_totals{
  background:var(--rrc-surface);
  border:1px solid var(--rrc-border);
  border-radius:var(--rrc-radius);
  box-shadow:var(--rrc-shadow);
  padding:22px;
}
.rr-cart-page__summary .cart_totals > h2{
  font-size:18px;
  font-weight:800;
  margin:0 0 14px;
  color:var(--rrc-text);
}
.rr-cart-page__summary table.shop_table{
  width:100%;
  border:0;
  border-collapse:collapse;
  margin:0;
}
.rr-cart-page__summary table.shop_table th,
.rr-cart-page__summary table.shop_table td{
  border:0;
  padding:10px 0;
  font-size:14px;
  color:var(--rrc-text);
  background:transparent;
}
.rr-cart-page__summary table.shop_table th{
  color:var(--rrc-muted);
  font-weight:500;
  width:50%;
}
.rr-cart-page__summary table.shop_table tr{
  border-bottom:1px dashed #eef2f6;
}
.rr-cart-page__summary table.shop_table tr.order-total{
  border-bottom:0;
}
.rr-cart-page__summary table.shop_table tr.order-total th,
.rr-cart-page__summary table.shop_table tr.order-total td{
  padding-top:16px;
  font-size:16px;
  font-weight:800;
}
.rr-cart-page__summary table.shop_table tr.order-total .amount{
  font-size:24px;
  color:var(--rrc-text);
}

/* Shipping calculator */
.rr-cart-page__summary .shipping-calculator-button{
  color:var(--rrc-red);
  font-weight:600;
  text-decoration:none;
}
.rr-cart-page__summary .shipping-calculator-form{
  margin-top:10px;
}
.rr-cart-page__summary .shipping-calculator-form input,
.rr-cart-page__summary .shipping-calculator-form select,
.rr-cart-page__summary .shipping-calculator-form .select2-selection{
  height:40px !important;
  border-radius:10px !important;
  border:1px solid var(--rrc-border) !important;
}

/* CTA: Finalizar compra */
.rr-cart-page__summary .wc-proceed-to-checkout{
  padding:18px 0 0;
}
.rr-cart-page__summary .wc-proceed-to-checkout .checkout-button,
.rr-cart-page__summary a.checkout-button{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  height:54px;
  border-radius:12px;
  background:var(--rrc-red);
  color:#fff !important;
  font-size:16px;
  font-weight:800;
  text-transform:none;
  text-decoration:none;
  letter-spacing:0;
  box-shadow:0 8px 20px rgba(208,0,0,.25);
  transition:background .15s, transform .05s;
}
.rr-cart-page__summary .wc-proceed-to-checkout .checkout-button:hover{
  background:var(--rrc-red-dark);
}
.rr-cart-page__summary .wc-proceed-to-checkout .checkout-button:active{
  transform:translateY(1px);
}

/* Mensaje de carrito vacío */
.cart-empty,
.woocommerce-cart .cart-empty{
  text-align:center;
  padding:64px 20px;
  border:1px dashed var(--rrc-border);
  border-radius:var(--rrc-radius);
  font-size:18px;
  color:var(--rrc-muted);
  background:var(--rrc-surface);
}
.return-to-shop .wc-backward{
  display:inline-block;
  margin-top:16px;
  padding:12px 22px;
  background:var(--rrc-red);
  color:#fff !important;
  border-radius:10px;
  text-decoration:none;
  font-weight:700;
}

/* Cross-sells (productos relacionados que Woo agrega abajo) */
.rr-cart-page__summary .cross-sells{
  display:none; /* en sidebar queda apretado: mejor desactivar acá; ya hay módulos en home */
}

/* =====================
   Responsive
   ===================== */
@media (max-width: 1024px){
  .rr-cart-page{
    grid-template-columns: 1fr;
  }
  .rr-cart-page__summary{
    position:static;
  }
}

@media (max-width: 640px){
  body.woocommerce-cart .woocommerce > h1,
  body.woocommerce-cart .woocommerce > h2,
  body.woocommerce-cart .entry-title{
    font-size:22px;
  }
  .rr-cart-row{
    grid-template-columns: 84px 1fr 32px;
    grid-template-areas:
      "thumb info remove"
      "thumb qty  subtotal";
    gap:10px 12px;
    padding:14px 8px;
  }
  .rr-cart-row__thumb{ grid-area:thumb; }
  .rr-cart-row__thumb img{ width:84px; height:84px; }
  .rr-cart-row__info{ grid-area:info; }
  .rr-cart-row__qty{ grid-area:qty; align-self:end; }
  .rr-cart-row__subtotal{ grid-area:subtotal; text-align:right; align-self:end; }
  .rr-cart-row__remove{ grid-area:remove; }

  .rr-cart-row__name{ font-size:14px; }
  .rr-cart-row__subtotal{ font-size:15px; }

  .rr-cart-page__actions{
    flex-direction:column;
    align-items:stretch;
  }
  .rr-cart-update{ width:100%; }

  .rr-cart-page__summary .wc-proceed-to-checkout .checkout-button{
    height:50px;
    font-size:15px;
  }
}
