/* EcommPaaS Porto V2 — Cart clean rewrite. Prefix: .cart-* Scope: body.checkout-cart-index */
/* Loaded AFTER porto.css via checkout_cart_index.xml */

/* R214: porto-icons @font-face must be declared here because home-clean.css (which also
   declares it) is only loaded on the homepage. On direct cart visits, the font would be
   absent and the ::before bag icon (line ~327) would not render. */
@font-face {
  font-family: 'porto-icons';
  src: url('../fonts/porto-icons.woff2') format('woff2'),
       url('../fonts/porto-icons.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   TOKEN SYSTEM
   ============================================================ */
body.checkout-cart-index {
  --cart-blue:         #0088cc;
  --cart-blue-dark:    #006699;
  --cart-text:         #222529;
  --cart-text-light:   #777;
  --cart-text-muted:   #999;
  --cart-bg:           #fff;
  --cart-bg-light:     #f4f4f4;
  --cart-border:       #e7e7e7;
  --cart-border-dark:  #222529;
  --cart-dark-hover:   #3a3d42;
  --cart-danger:       #e23333;
  --cart-radius:       3px;
  --cart-font:         Poppins, 'Open Sans', Helvetica, Arial, sans-serif;
  --cart-max-width:    1200px;
}

body.checkout-cart-index [class^="cart-"],
body.checkout-cart-index [class*=" cart-"] {
  box-sizing: border-box;
  font-family: var(--cart-font);
}

/* ============================================================
   1. PAGE MAIN WIDTH DEFEAT
   ============================================================ */
body.checkout-cart-index .page-main,
body.checkout-cart-index .columns,
body.checkout-cart-index .column.main {
  max-width: none !important;
  width: 100% !important;
  padding: 0 !important;
}

body.checkout-cart-index .page-main {
  max-width: var(--cart-max-width) !important;
  margin: 0 auto !important;
  padding: 0 20px !important;
}

/* ============================================================
   2. BREADCRUMBS + PAGE TITLE
   ============================================================ */
body.checkout-cart-index .breadcrumbs { padding: 10px 0; margin-bottom: 0; }

body.checkout-cart-index .breadcrumbs .items {
  display: flex; flex-wrap: wrap; list-style: none;
  margin: 0; padding: 0; font-size: 12px; color: var(--cart-text-light);
}

body.checkout-cart-index .breadcrumbs .item { display: flex; align-items: center; }
body.checkout-cart-index .breadcrumbs .item + .item::before { content: '/'; margin: 0 6px; color: var(--cart-text-muted); }
body.checkout-cart-index .breadcrumbs .item a { color: var(--cart-text-light); text-decoration: none; }
body.checkout-cart-index .breadcrumbs .item a:hover { color: var(--cart-blue); }

body.checkout-cart-index .page-title-wrapper .page-title {
  font-size: 22px; font-weight: 700; color: var(--cart-blue);
  margin: 14px 0 24px; line-height: 1.2;
}

/* ============================================================
   3. CART LAYOUT — 2-col grid: 70% items / 30% summary
   ============================================================ */
body.checkout-cart-index .cart-container {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 30px;
  align-items: start;
  margin-bottom: 40px;
}

/* ============================================================
   4. CART ITEMS TABLE
   ============================================================ */
body.checkout-cart-index .cart.table-wrapper {
  background: var(--cart-bg);
  border: 1px solid var(--cart-border);
  border-radius: var(--cart-radius);
  overflow: hidden;
}

body.checkout-cart-index .cart.items thead th {
  background: transparent !important;
  padding: 12px 16px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--cart-text);
  border-bottom: 1px solid var(--cart-border);
  white-space: nowrap;
}

body.checkout-cart-index .cart.items tbody tr {
  border-bottom: 1px solid var(--cart-border);
  transition: background 0.15s;
}

body.checkout-cart-index .cart.items tbody tr:last-child { border-bottom: none; }
body.checkout-cart-index .cart.items tbody tr:hover { background: #fafafa; }

body.checkout-cart-index .cart.items .col {
  padding: 18px 16px; vertical-align: middle;
  font-size: 14px; color: var(--cart-text);
}

body.checkout-cart-index .cart.items .col.image { width: 110px; padding: 12px; }

body.checkout-cart-index .product-item-photo .product-image-photo {
  width: 86px !important; height: 86px !important;
  object-fit: cover; border-radius: var(--cart-radius); display: block;
}

body.checkout-cart-index .product-item-name a {
  font-size: 14px; font-weight: 700; color: var(--cart-text);
  text-decoration: none; line-height: 1.4; transition: color 0.15s;
}
body.checkout-cart-index .product-item-name a:hover { color: var(--cart-blue); }

body.checkout-cart-index .item-options { margin: 6px 0 0; font-size: 12px; color: var(--cart-text-light); }
body.checkout-cart-index .item-options dt { font-weight: 600; float: left; margin-right: 4px; }
body.checkout-cart-index .item-options dd { margin: 0 0 2px; }

body.checkout-cart-index .col.price .price,
body.checkout-cart-index .col.subtotal .price {
  font-size: 14px; font-weight: 700; color: var(--cart-text);
}
body.checkout-cart-index .col.price .old-price .price {
  font-size: 12px; font-weight: 400; color: var(--cart-text-muted); text-decoration: line-through;
}

/* QTY col — stepper + update btn */
body.checkout-cart-index .col.qty .field.qty {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 100px;
}

body.checkout-cart-index .col.qty .pt-addtocart__qty-btn {
  width: 28px; height: 28px; border: 1px solid var(--cart-border);
  background: var(--cart-bg); color: var(--cart-text); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background 0.15s;
}
body.checkout-cart-index .col.qty .pt-addtocart__qty-btn:hover { background: var(--cart-bg-light); }

body.checkout-cart-index .col.qty .pt-addtocart__qty-input {
  width: 44px; height: 28px; text-align: center;
  border: 1px solid var(--cart-border); border-left: none; border-right: none;
  font-size: 13px; font-weight: 600; color: var(--cart-text); background: var(--cart-bg);
  -moz-appearance: textfield;
}
body.checkout-cart-index .col.qty .pt-addtocart__qty-input::-webkit-inner-spin-button,
body.checkout-cart-index .col.qty .pt-addtocart__qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }

body.checkout-cart-index .pt-cart-item-update {
  font-size: 11px; padding: 5px 12px; white-space: nowrap;
  border: 1px solid var(--cart-border); background: var(--cart-bg-light);
  color: var(--cart-text); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  cursor: pointer; transition: background 0.15s, border-color 0.15s; border-radius: var(--cart-radius);
}
body.checkout-cart-index .pt-cart-item-update:hover { background: #e7e7e7; border-color: #ccc; }

/* REMOVE col */
body.checkout-cart-index .col.remove { width: 40px; text-align: center; }

body.checkout-cart-index .action.action-delete {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%; transition: background 0.15s; text-decoration: none;
}
body.checkout-cart-index .action.action-delete:hover { background: #fff0f0; }
body.checkout-cart-index .action.action-delete::before {
  content: '\00D7'; font-size: 20px; font-weight: 300; color: var(--cart-text-muted); line-height: 1;
}
body.checkout-cart-index .action.action-delete:hover::before { color: var(--cart-danger); }
body.checkout-cart-index .action.action-delete span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ============================================================
   5. CART ACTIONS
   ============================================================ */
body.checkout-cart-index .cart.main.actions {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--cart-border); align-items: center;
}

body.checkout-cart-index .action.continue {
  display: inline-flex; align-items: center;
  padding: 11px 24px; background: var(--cart-bg-light); color: var(--cart-text);
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  text-decoration: none; border: 1px solid var(--cart-border); border-radius: var(--cart-radius);
  cursor: pointer; transition: background 0.2s, border-color 0.2s;
}
body.checkout-cart-index .action.continue:hover { background: #e7e7e7; border-color: #ccc; }

body.checkout-cart-index .action.update {
  display: inline-flex; align-items: center;
  padding: 11px 24px; background: var(--cart-text); color: var(--cart-bg);
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  border: 1px solid var(--cart-text); border-radius: var(--cart-radius);
  cursor: pointer; transition: background 0.2s, color 0.2s;
}
body.checkout-cart-index .action.update:hover { background: var(--cart-blue); border-color: var(--cart-blue); color: #fff; }

/* ============================================================
   5b. DISCOUNT CODE — positioned in left column, below cart actions
       (Fix 5: discount is already in checkout.cart.form / left col by
        Magento default; these rules ensure it renders below main.actions)
   ============================================================ */
body.checkout-cart-index .checkout-cart-index .block.discount,
body.checkout-cart-index .block.discount {
  margin-top: 20px;
  padding: 16px;
  background: var(--cart-bg);
  border: 1px solid var(--cart-border);
  border-radius: var(--cart-radius);
}

body.checkout-cart-index .block.discount .title strong {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--cart-text); cursor: pointer;
}
body.checkout-cart-index .block.discount .field .label { font-size: 12px; color: var(--cart-text-light); margin-bottom: 6px; display: block; }
body.checkout-cart-index .block.discount .field input {
  height: 40px; border: 1px solid var(--cart-border); border-radius: var(--cart-radius) 0 0 var(--cart-radius);
  padding: 0 12px; font-size: 13px; color: var(--cart-text); width: 200px;
}
body.checkout-cart-index .block.discount .actions-toolbar .primary button {
  height: 40px; padding: 0 18px; background: var(--cart-blue); color: #fff;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  border: none; border-radius: 0 var(--cart-radius) var(--cart-radius) 0; cursor: pointer;
}
body.checkout-cart-index .block.discount .actions-toolbar .primary button:hover { background: var(--cart-blue-dark); }

/* Hide any discount block that ends up inside the summary panel */
body.checkout-cart-index .cart-summary .block.discount { display: none !important; }

/* ============================================================
   6. CART SUMMARY PANEL
   ============================================================ */
body.checkout-cart-index .cart-summary {
  background: var(--cart-bg); border: 1px solid var(--cart-border);
  border-radius: var(--cart-radius); padding: 0;
  position: sticky; top: 20px; overflow: hidden;
}

body.checkout-cart-index .cart-summary > .title {
  font-size: 14px; font-weight: 700; color: var(--cart-text);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 18px 20px; margin: 0;
  background: var(--cart-bg-light); border-bottom: 1px solid var(--cart-border);
}

body.checkout-cart-index .cart-totals { padding: 16px 20px; }
body.checkout-cart-index .cart-totals table { width: 100%; }

body.checkout-cart-index .cart-totals .totals th,
body.checkout-cart-index .cart-totals .totals td {
  padding: 7px 0; font-size: 13px; color: var(--cart-text); vertical-align: middle;
}
body.checkout-cart-index .cart-totals .totals th { font-weight: 600; }
body.checkout-cart-index .cart-totals .totals td { text-align: right; font-weight: 700; }
body.checkout-cart-index .cart-totals .totals td .price { font-size: 13px; font-weight: 700; }

body.checkout-cart-index .cart-totals .grand .mark {
  font-size: 16px; font-weight: 600 !important; color: var(--cart-text);
  border-top: 2px solid var(--cart-border-dark); padding-top: 12px;
}
body.checkout-cart-index .cart-totals .grand .amount {
  font-size: 16px; font-weight: 700; color: var(--cart-text);
  border-top: 2px solid var(--cart-border-dark); padding-top: 12px;
}
body.checkout-cart-index .cart-totals .grand .amount { text-align: right; }
body.checkout-cart-index .cart-totals .grand .amount .price { font-size: 22px !important; font-weight: 700 !important; color: #222529 !important; }

body.checkout-cart-index .checkout-methods-items {
  list-style: none; margin: 0; padding: 16px 20px 20px; border-top: 1px solid var(--cart-border);
}

body.checkout-cart-index .checkout-methods-items .action.primary.checkout {
  display: block; width: 100%; padding: 14px 20px;
  background: var(--cart-text); color: #fff;
  font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  text-align: center; border: 2px solid var(--cart-text); border-radius: var(--cart-radius);
  cursor: pointer; transition: background 0.2s, border-color 0.2s;
}
body.checkout-cart-index .checkout-methods-items .action.primary.checkout:hover {
  background: var(--cart-blue); border-color: var(--cart-blue);
}

/* ============================================================
   7. SHIPPING ESTIMATE (collapsible in summary)
   ============================================================ */
body.checkout-cart-index .cart-summary .block.shipping .title {
  padding: 14px 20px; cursor: pointer; border-top: 1px solid var(--cart-border);
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--cart-text); display: flex; align-items: center; justify-content: space-between;
}
body.checkout-cart-index .cart-summary .block.shipping .title::after {
  content: '\25BE'; font-size: 14px; color: var(--cart-text-light); transition: transform 0.2s;
}
body.checkout-cart-index .cart-summary .block.shipping._open .title::after { transform: rotate(180deg); }
body.checkout-cart-index .cart-summary .block.shipping .content { padding: 0 20px 16px; }
body.checkout-cart-index .cart-summary .block.shipping .field .label { font-size: 12px; color: var(--cart-text-light); margin-bottom: 5px; display: block; }
body.checkout-cart-index .cart-summary .block.shipping .field .control select,
body.checkout-cart-index .cart-summary .block.shipping .field .control input {
  width: 100%; height: 36px; border: 1px solid var(--cart-border); border-radius: var(--cart-radius);
  padding: 0 10px; font-size: 13px; color: var(--cart-text); background: var(--cart-bg);
}
body.checkout-cart-index .cart-summary .block.shipping .actions-toolbar .primary button {
  width: 100%; padding: 10px; background: var(--cart-bg-light); color: var(--cart-text);
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  border: 1px solid var(--cart-border); border-radius: var(--cart-radius); cursor: pointer; margin-top: 10px;
}
body.checkout-cart-index .cart-summary .block.shipping .actions-toolbar .primary button:hover { background: #e7e7e7; }

/* ============================================================
   8. EMPTY CART STATE
   ============================================================ */
body.checkout-cart-index .cart-empty {
  text-align: center; padding: 80px 40px; background: var(--cart-bg);
}


/* R168: Porto Demo 1 empty cart shows a porto-icon-bag-2 icon (100px, #d3d3d4) above the message.
   R214: @font-face now declared at top of this file (not home-clean.css) to ensure font loads on direct cart visits. */
body.checkout-cart-index .cart-empty::before {
  content: '\e87f';
  font-family: 'porto-icons';
  font-size: 100px;
  color: #d3d3d4;
  display: block;
  line-height: 1;
  margin-bottom: 16px;
}

body.checkout-cart-index .cart-empty p { font-size: 15px; color: var(--cart-text-light); margin-bottom: 28px; }

/* R168: Revert R166 — reference Porto Demo 1 empty cart uses a dark #222529 filled button (not light bordered).
   Reference `.btn-go-shop { background-color: #222529; color: #fff; min-width: 200px; padding: 16px 0;
   font-size: 15px; font-weight: 700; text-transform: uppercase }`. R166 was wrong about the reference.
   !important at (0,4,1) beats porto.css `html body .cart-empty .action.continue` at (0,3,2). */
body.checkout-cart-index .cart-empty .action.continue {
  margin-top: 4px;
  background: var(--cart-border-dark) !important;
  color: #fff !important;
  border: 1px solid var(--cart-border-dark) !important;
  padding: 16px 30px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  min-width: 200px;
  display: inline-block !important;
}
body.checkout-cart-index .cart-empty .action.continue:hover {
  background: #0088cc !important;
  border-color: #0088cc !important;
  color: #fff !important;
}

/* ============================================================
   9. CROSS-SELL
   ============================================================ */
body.checkout-cart-index .block.crosssell { margin: 40px 0; }
body.checkout-cart-index .block.crosssell .block-title strong {
  font-size: 20px; font-weight: 700; color: var(--cart-text);
  border-bottom: 2px solid var(--cart-blue); padding-bottom: 10px; display: inline-block;
}

/* ============================================================
   10. RESPONSIVE
   ============================================================ */
@media (max-width: 1023px) {
  body.checkout-cart-index .cart-container { grid-template-columns: 1fr; }
  body.checkout-cart-index .cart-summary { position: static; }
}

@media (max-width: 767px) {
  body.checkout-cart-index .page-main { padding: 0 12px !important; }
  body.checkout-cart-index .cart.items thead { display: none; }
  body.checkout-cart-index .cart.items .col { display: block; padding: 6px 12px; }
  body.checkout-cart-index .cart.items .col.image { width: 100%; text-align: center; padding-top: 16px; }
  body.checkout-cart-index .cart.items tbody tr { display: block; padding: 10px 0; }
  body.checkout-cart-index .cart.items .col.qty .field.qty { flex-direction: row; align-items: center; flex-wrap: wrap; }
  body.checkout-cart-index .cart.main.actions { flex-direction: column; align-items: stretch; }
  body.checkout-cart-index .action.continue,
  body.checkout-cart-index .action.update { width: 100%; justify-content: center; }
}
