/**
 * Condalab Cart Page CSS
 * Figma design: 2/3 product table + 1/3 sticky summary
 */

/* ===== PS DEFAULT OVERRIDES ===== */
#cart #wrapper {
  padding-top: 0;
  background: #f8f8f8;
}
#cart #wrapper > .container {
  max-width: 1320px;
  padding: 32px 16px;
}
#cart #content-wrapper {
  padding: 0;
  width: 100%;
  flex: 0 0 100%;
  max-width: 100%;
}
#cart #content {
  border: none;
  box-shadow: none;
  background: transparent;
}
#cart #main {
  padding: 0;
  margin: 0;
}
#cart #left-column,
#cart #right-column {
  display: none;
}
#cart .card {
  border: none;
  box-shadow: none;
  background: transparent;
}

/* ===== CART HEADER ===== */
.cdl-cart-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.cdl-cart-header__icon {
  width: 48px;
  height: 48px;
  background: #1a1a1a;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cdl-cart-header__icon i.material-icons {
  font-size: 24px;
  color: #fff;
}

.cdl-cart-header__text h1 {
  font-family: 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: #1a1a1a;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.cdl-cart-header__count {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #888;
  margin: 0;
}

/* ===== CART GRID ===== */
.cdl-cart-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}

/* ===== PRODUCT TABLE ===== */
.cdl-cart-products {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  overflow: hidden;
}

.cdl-cart-products .cart-items {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cdl-cart-products .cart-item {
  border-bottom: 1px solid #f0f0f0;
}

.cdl-cart-products .cart-item:last-child {
  border-bottom: none;
}

/* Product line row */
.cdl-cart-products .product-line-grid {
  display: grid;
  grid-template-columns: 80px 1fr auto auto auto;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  transition: background 0.1s;
}

.cdl-cart-products .product-line-grid:hover {
  background: #fafafa;
}

/* Image */
.cdl-cart-products .product-line-grid-left {
  width: 80px;
  padding: 0;
  float: none;
}

.cdl-cart-products .product-line-grid-left .product-image {
  display: block;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  background: #f5f5f5;
}

.cdl-cart-products .product-line-grid-left .product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Body */
.cdl-cart-products .product-line-grid-body {
  width: auto;
  padding: 0;
  float: none;
}

.cdl-cart-products .product-line-grid-body .product-line-info a.label {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  text-decoration: none;
  display: block;
  margin-bottom: 4px;
}

.cdl-cart-products .product-line-grid-body .product-line-info a.label:hover {
  color: #EBBE18;
}

.cdl-cart-products .product-line-grid-body .product-price {
  margin: 0;
}

.cdl-cart-products .product-line-grid-body .product-price .price {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #666;
}

.cdl-cart-products .product-line-grid-body .product-line-info:not(:first-child) {
  font-size: 12px;
  color: #888;
}

.cdl-cart-products .product-line-grid-body .product-line-info .label {
  font-size: 12px;
  color: #888;
  font-weight: 400;
  padding: 0;
  background: none;
}

.cdl-cart-products .product-line-grid-body .product-line-info .value {
  font-size: 12px;
  color: #666;
}

/* Right section: qty + price + delete */
.cdl-cart-products .product-line-grid-right {
  width: auto;
  padding: 0;
  float: none;
  display: contents;
}

.cdl-cart-products .product-line-grid-right .row {
  display: contents;
}

.cdl-cart-products .product-line-grid-right .row > div {
  width: auto;
  padding: 0;
  float: none;
}

/* Quantity input */
.cdl-cart-products .qty {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cdl-cart-products .js-cart-line-product-quantity {
  width: 56px;
  height: 36px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  background: #fff;
  outline: none;
  -moz-appearance: textfield;
}

.cdl-cart-products .js-cart-line-product-quantity::-webkit-outer-spin-button,
.cdl-cart-products .js-cart-line-product-quantity::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cdl-cart-products .js-cart-line-product-quantity:focus {
  border-color: #EBBE18;
  box-shadow: 0 0 0 2px rgba(235, 190, 24, 0.15);
}

/* Subtotal price */
.cdl-cart-products .product-line-grid-right .price .product-price {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  white-space: nowrap;
}

/* Delete button */
.cdl-cart-products .cart-line-product-actions {
  display: flex;
  align-items: center;
}

.cdl-cart-products .cart-line-product-actions .remove-from-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  transition: background 0.15s;
}

.cdl-cart-products .cart-line-product-actions .remove-from-cart:hover {
  background: #fff0f0;
}

.cdl-cart-products .cart-line-product-actions .remove-from-cart i.material-icons {
  font-size: 18px;
  color: #cc3333;
  float: none;
}

/* No items */
.cdl-cart-products .no-items {
  display: block;
  text-align: center;
  padding: 48px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #888;
}

/* Continue shopping link */
.cdl-cart-continue {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.15s;
}

.cdl-cart-continue:hover {
  color: #EBBE18;
  text-decoration: none;
}

.cdl-cart-continue i.material-icons {
  font-size: 18px;
}

/* ===== SUMMARY PANEL ===== */
.cdl-cart-summary {
  position: sticky;
  top: 120px;
}

.cdl-cart-summary .cart-summary {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  overflow: hidden;
}

.cdl-cart-summary .cart-summary .card-block {
  padding: 20px;
}

/* Summary title */
.cdl-cart-summary__title {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 16px 0;
  padding: 20px 20px 0;
}

/* Subtotal lines */
.cdl-cart-summary .cart-detailed-subtotals {
  padding: 0 20px 12px !important;
}

.cdl-cart-summary .cart-summary-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

.cdl-cart-summary .cart-summary-line .label {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #666;
  padding: 0;
  background: none;
}

.cdl-cart-summary .cart-summary-line .value {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
}

/* Total line */
.cdl-cart-summary .cart-summary-totals {
  border-top: 2px solid #f0f0f0;
  padding: 16px 20px !important;
}

.cdl-cart-summary .cart-summary-line.cart-total {
  padding: 0;
}

.cdl-cart-summary .cart-summary-line.cart-total .label {
  font-size: 16px;
  font-weight: 800;
  color: #1a1a1a;
  text-transform: uppercase;
}

.cdl-cart-summary .cart-summary-line.cart-total .value {
  font-size: 20px;
  font-weight: 800;
  color: #1a1a1a;
}

.cdl-cart-summary .cart-summary-line .label.sub {
  font-size: 12px;
  color: #999;
}

.cdl-cart-summary .cart-summary-line .value.sub {
  font-size: 12px;
  color: #999;
}

/* ===== VOUCHER / PROMO ===== */
.cdl-cart-summary .block-promo {
  padding: 0 20px 16px;
}

.cdl-cart-summary .cart-voucher {
  margin: 0;
}

.cdl-cart-summary .promo-code-button {
  margin: 0;
}

.cdl-cart-summary .promo-code-button a {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #EBBE18;
  text-decoration: none;
}

.cdl-cart-summary .promo-code-button a:hover {
  color: #c9a010;
}

.cdl-cart-summary .promo-code form {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.cdl-cart-summary .promo-input {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 8px 12px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}

.cdl-cart-summary .promo-input:focus {
  border-color: #EBBE18;
}

.cdl-cart-summary .promo-code .btn-primary {
  background: #1a1a1a;
  border: 1px solid #1a1a1a;
  border-radius: 8px;
  padding: 8px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.cdl-cart-summary .promo-code .btn-primary:hover {
  background: #333;
}

.cdl-cart-summary .promo-name {
  padding: 8px 0 !important;
  margin: 0;
  list-style: none;
}

.cdl-cart-summary .promo-name .cart-summary-line {
  font-size: 13px;
}

.cdl-cart-summary .cancel-promo {
  font-size: 12px;
  color: #999;
}

.cdl-cart-summary .js-error {
  font-size: 12px;
  margin: 4px 0;
  padding: 6px 10px;
  border-radius: 6px;
}

/* ===== CHECKOUT BUTTON ===== */
.cdl-cart-summary .cart-detailed-actions {
  padding: 0 20px 20px !important;
  border-top: none;
}

.cdl-cart-summary .cart-detailed-actions .btn-primary {
  display: block;
  width: 100%;
  background: #EBBE18;
  border: none;
  border-radius: 10px;
  padding: 14px 24px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-align: center;
  text-decoration: none;
}

.cdl-cart-summary .cart-detailed-actions .btn-primary:hover {
  background: #d4ab15;
  transform: translateY(-1px);
  text-decoration: none;
  color: #fff;
}

.cdl-cart-summary .cart-detailed-actions .btn-primary.disabled {
  background: #ddd;
  color: #999;
  cursor: not-allowed;
  transform: none;
}

.cdl-cart-summary .cart-detailed-actions .alert {
  font-size: 13px;
  border-radius: 8px;
  margin-bottom: 12px;
}

/* ===== EMPTY CART STATE ===== */
.cdl-cart-empty {
  text-align: center;
  padding: 64px 20px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
}

.cdl-cart-empty i.material-icons {
  font-size: 64px;
  color: #ddd;
  margin-bottom: 16px;
}

.cdl-cart-empty h2 {
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 8px;
}

.cdl-cart-empty p {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #888;
  margin: 0 0 24px;
}

.cdl-cart-empty__cta {
  display: inline-block;
  background: #EBBE18;
  color: #fff;
  padding: 12px 28px;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}

.cdl-cart-empty__cta:hover {
  background: #d4ab15;
  color: #fff;
  text-decoration: none;
}

/* ===== HOOK AREAS ===== */
.cdl-cart-hooks {
  margin-top: 16px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
  .cdl-cart-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .cdl-cart-summary {
    position: static;
  }
}

@media (max-width: 767px) {
  #cart #wrapper > .container {
    padding: 16px 12px;
  }

  .cdl-cart-header {
    margin-bottom: 20px;
  }

  .cdl-cart-header__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .cdl-cart-header__icon i.material-icons {
    font-size: 20px;
  }

  .cdl-cart-header__text h1 {
    font-size: 20px;
  }

  /* Stack product line on mobile */
  .cdl-cart-products .product-line-grid {
    display: flex !important;
    flex-wrap: wrap;
    gap: 0;
    padding: 14px 16px;
  }

  .cdl-cart-products .product-line-grid-left {
    width: 64px !important;
    max-width: 64px !important;
    flex: 0 0 64px !important;
    padding: 0 !important;
    float: none !important;
    margin-right: 12px;
  }

  .cdl-cart-products .product-line-grid-left .product-image {
    width: 56px;
    height: 56px;
  }

  .cdl-cart-products .product-line-grid-body {
    flex: 1 !important;
    max-width: calc(100% - 76px) !important;
    width: auto !important;
    padding: 0 !important;
    float: none !important;
  }

  .cdl-cart-products .product-line-grid-right {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    padding: 10px 0 0 !important;
    margin-top: 10px;
    border-top: 1px solid #f5f5f5;
    float: none !important;
    display: block !important;
  }

  .cdl-cart-products .product-line-grid-right .row {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    margin: 0 !important;
  }

  .cdl-cart-products .product-line-grid-right .row > div {
    width: auto !important;
    max-width: none !important;
    flex: none !important;
    padding: 0 !important;
    float: none !important;
  }

  .cdl-cart-products .product-line-grid-right .col-xs-4.hidden-md-up {
    display: none !important;
  }

  .cdl-cart-products .product-line-grid-right .col-md-10 {
    flex: 1 !important;
  }

  .cdl-cart-products .product-line-grid-right .col-md-10 .row {
    display: flex !important;
    align-items: center;
    gap: 16px;
  }

  .cdl-cart-products .product-line-grid-right .col-md-2 {
    flex: 0 0 auto !important;
  }

  .cdl-cart-products .clearfix {
    display: none;
  }

  .cdl-cart-summary__title {
    font-size: 15px;
    padding: 16px 16px 0;
  }

  .cdl-cart-summary .cart-detailed-subtotals {
    padding: 0 16px 8px !important;
  }

  .cdl-cart-summary .cart-summary-totals {
    padding: 12px 16px !important;
  }

  .cdl-cart-summary .block-promo {
    padding: 0 16px 12px;
  }

  .cdl-cart-summary .cart-detailed-actions {
    padding: 0 16px 16px !important;
  }
}
