/**
 * ====================================================================
 * Rapid Extreme - Cart Page Stylesheet (cart.css)
 * Figma Nodes: 48:9946 (without promo code) & 48:10171 (with promocode)
 * High-performance, bespoke tactical styling matching brand guidelines
 * ====================================================================
 */

/* ====================================================================
   Cart Container & Layout
   ==================================================================== */
.cart-main {
  width: 100%;
  min-height: calc(100vh - 128px);
  background-color: var(--color-black-surface, #101310);
  padding: 48px 64px 72px 64px;
}

.cart-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ====================================================================
   1. Cart Header Bar (Title & Continue Shopping)
   ==================================================================== */
.cart-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  width: 100%;
  gap: 20px;
}

.cart-title-wrapper {
  display: flex;
  flex-direction: column;
}

.cart-title {
  font-family: 'Barlow Condensed', -apple-system, sans-serif;
  font-weight: 800;
  font-size: 64px;
  line-height: 58.88px;
  letter-spacing: 0.32px;
  text-transform: uppercase;
  color: var(--color-text-primary, #f4f3ee);
  margin: 0;
}

.cart-title__count {
  color: var(--color-accent-lime, #c6ff00);
}

.cart-continue-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #bfbfbf;
  font-family: var(--font-family-base, 'Barlow', sans-serif);
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
  padding-bottom: 6px;
}

.cart-continue-link:hover {
  color: var(--color-accent-lime, #c6ff00);
  transform: translateX(-3px);
}

.cart-continue-link svg {
  transition: transform 0.2s ease;
}

.cart-continue-link:hover svg {
  transform: translateX(-2px);
}

/* ====================================================================
   2. Main Two-Column Grid
   ==================================================================== */
.cart-grid {
  display: flex;
  align-items: flex-start;
  gap: 48px;
  width: 100%;
}

/* ====================================================================
   3. Left Column: Cart Items List
   ==================================================================== */
.cart-items-column {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.cart-items-list {
  width: 100%;
  border-top: 1px solid #2e332f;
  display: flex;
  flex-direction: column;
}

/* Individual Cart Item */
.cart-item {
  width: 100%;
  border-bottom: 1px solid #2e332f;
  padding: 24px 0 25px 0;
  display: flex;
  align-items: center;
  gap: 24px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.cart-item--removing {
  opacity: 0;
  transform: translateX(-20px);
  pointer-events: none;
}

/* Thumbnail Box (120x120px) */
.cart-item__thumb {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  border: 1px solid var(--color-accent-lime, #c6ff00);
  background-color: #141714;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  text-decoration: none;
}

.cart-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.cart-item__thumb:hover img {
  transform: scale(1.05);
}

/* Vector icon thumbnail modifier (for accessories & refills) */
.cart-item__thumb--icon {
  background-color: #101310;
  border-color: #2e332f;
}

.cart-item__thumb--icon img,
.cart-item__img--icon {
  width: 58px;
  height: 58px;
  max-width: 60%;
  max-height: 60%;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
  transition: transform 0.25s ease;
}

.cart-item__thumb--icon:hover img,
.cart-item__thumb--icon:hover .cart-item__img--icon {
  transform: scale(1.1);
}

/* Details info block */
.cart-item__info {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cart-item__series {
  font-family: var(--font-family-base, 'Barlow', sans-serif);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  line-height: normal;
  display: block;
}

.cart-item__series--discovery {
  color: var(--color-accent-lime, #c6ff00);
}

.cart-item__series--nomad {
  color: var(--color-accent-cyan, #29dce8);
}

.cart-item__title {
  font-family: 'Barlow Condensed', -apple-system, sans-serif;
  font-weight: 800;
  font-size: 32px;
  line-height: 29.44px;
  letter-spacing: 0.16px;
  text-transform: uppercase;
  margin: 0;
}

.cart-item__title a {
  color: var(--color-text-primary, #f4f3ee);
  text-decoration: none;
  transition: color 0.2s ease;
}

.cart-item__title a:hover {
  color: var(--color-accent-lime, #c6ff00);
}

.cart-item__config {
  font-family: var(--font-family-base, 'Barlow', sans-serif);
  font-weight: 400;
  font-size: 14px;
  color: var(--color-text-secondary, #a3a8a2);
  line-height: 1.4;
  margin: 0;
  margin-top: 2px;
}

.cart-item__meta {
  font-family: var(--font-family-base, 'Barlow', sans-serif);
  font-weight: 400;
  font-size: 13px;
  color: var(--color-text-secondary, #a3a8a2);
  line-height: 1.4;
  margin: 0;
  margin-top: 1px;
}

/* Stepper Box (Height 50px) */
.cart-item__stepper {
  border: 1px solid #2e332f;
  background-color: transparent;
  display: flex;
  align-items: center;
  height: 50px;
  flex-shrink: 0;
  padding: 1px;
}

.cart-stepper__btn {
  width: 44px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--color-text-primary, #f4f3ee);
  font-family: var(--font-family-base, 'Barlow', sans-serif);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  user-select: none;
}

.cart-stepper__btn:hover {
  background-color: #222722;
  color: var(--color-accent-lime, #c6ff00);
}

.cart-stepper__btn:active {
  background-color: #2e332f;
}

.cart-stepper__val {
  width: 40px;
  text-align: center;
  font-family: var(--font-family-base, 'Barlow', sans-serif);
  font-weight: 700;
  font-size: 16px;
  color: var(--color-text-primary, #f4f3ee);
  user-select: none;
}

/* Price Column */
.cart-item__price-col {
  width: 150px;
  padding-left: 30px;
  text-align: right;
  flex-shrink: 0;
}

.cart-item__price {
  font-family: 'Barlow Condensed', -apple-system, sans-serif;
  font-weight: 800;
  font-size: 26px;
  line-height: 23.92px;
  letter-spacing: 0.13px;
  text-transform: uppercase;
  color: var(--color-text-primary, #f4f3ee);
  display: block;
  white-space: nowrap;
}

/* Remove Item Button (40x40px) */
.cart-item__remove-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 1px solid #2e332f;
  background-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-secondary, #a3a8a2);
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.cart-item__remove-btn:hover {
  border-color: #e5342b;
  color: #e5342b;
  background-color: rgba(229, 52, 43, 0.08);
}

/* Empty State Card */
.cart-empty-state {
  border-top: 1px solid #2e332f;
  border-bottom: 1px solid #2e332f;
  padding: 64px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: rgba(26, 30, 27, 0.3);
}

.cart-empty-icon {
  width: 64px;
  height: 64px;
  border: 1px dashed #2e332f;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent-lime, #c6ff00);
  margin-bottom: 8px;
}

.cart-empty-title {
  font-family: 'Barlow Condensed', -apple-system, sans-serif;
  font-weight: 800;
  font-size: 36px;
  text-transform: uppercase;
  color: var(--color-text-primary, #f4f3ee);
  letter-spacing: 0.18px;
  margin: 0;
}

.cart-empty-desc {
  font-family: var(--font-family-base, 'Barlow', sans-serif);
  font-size: 15px;
  color: var(--color-text-secondary, #a3a8a2);
  max-width: 420px;
  margin: 0;
}

.cart-empty-btn {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-accent-lime, #c6ff00);
  color: #101310;
  font-family: var(--font-family-base, 'Barlow', sans-serif);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1.12px;
  text-transform: uppercase;
  padding: 14px 28px;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.cart-empty-btn:hover {
  background-color: #d4ff33;
  transform: translateY(-2px);
}

/* ====================================================================
   4. Right Column: Order Summary Card (Width: 440px)
   ==================================================================== */
.cart-summary {
  width: 440px;
  flex-shrink: 0;
  background-color: #1a1e1b;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 21.9px;
  position: sticky;
  top: 32px;
}

.cart-summary__heading {
  font-family: 'Barlow Condensed', -apple-system, sans-serif;
  font-weight: 800;
  font-size: 36px;
  line-height: 33.12px;
  letter-spacing: 0.18px;
  text-transform: uppercase;
  color: var(--color-text-primary, #f4f3ee);
  margin: 0;
}

/* Promo Code Box */
.cart-promo {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.cart-promo__field {
  display: flex;
  width: 100%;
}

.cart-promo__input {
  flex: 1 1 0%;
  min-width: 0;
  height: 48px;
  background-color: #101310;
  border: 1px solid #2e332f;
  padding: 14px 16px;
  font-family: var(--font-family-base, 'Barlow', sans-serif);
  font-size: 15px;
  color: #ffffff;
  outline: none;
  transition: border-color 0.2s ease;
}

.cart-promo__input::placeholder {
  color: #757575;
}

.cart-promo__input:focus {
  border-color: var(--color-accent-lime, #c6ff00);
}

.cart-promo__btn {
  height: 48px;
  background-color: #101310;
  border-top: 1px solid #2e332f;
  border-right: 1px solid #2e332f;
  border-bottom: 1px solid #2e332f;
  border-left: none;
  padding: 0 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}

.cart-promo__btn:hover {
  background-color: #151915;
}

.cart-promo__btn-text {
  font-family: var(--font-family-base, 'Barlow', sans-serif);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--color-accent-lime, #c6ff00);
  white-space: nowrap;
}

.cart-promo__btn-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: transform 0.2s ease;
}

.cart-promo__btn-remove:hover {
  transform: scale(1.1);
}

/* Promo Status Success */
.cart-promo__status {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.cart-promo__check-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.cart-promo__status-text {
  font-family: var(--font-family-base, 'Barlow', sans-serif);
  font-weight: 400;
  font-size: 15px;
  color: var(--color-accent-lime, #c6ff00);
  line-height: normal;
}

.cart-promo__error {
  font-family: var(--font-family-base, 'Barlow', sans-serif);
  font-size: 13px;
  color: #ff6b6b;
  line-height: 1.4;
}

.cart-promo__error strong {
  color: #ffffff;
  letter-spacing: 0.5px;
}

.cart-promo-hint {
  font-family: var(--font-family-base, 'Barlow', sans-serif);
  font-size: 12px;
  color: #6e756e;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-promo-hint code {
  color: var(--color-accent-lime, #c6ff00);
  cursor: pointer;
  background: rgba(198, 255, 0, 0.1);
  padding: 1px 6px;
  border: 1px solid rgba(198, 255, 0, 0.2);
}

.cart-promo-hint code:hover {
  background: rgba(198, 255, 0, 0.2);
}

/* Cost Breakdown Lines */
.cart-breakdown {
  border-top: 1px solid #2e332f;
  padding-top: 21px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.cart-breakdown__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 18px;
}

.cart-breakdown__label {
  font-family: var(--font-family-base, 'Barlow', sans-serif);
  font-weight: 400;
  font-size: 15px;
  color: var(--color-text-secondary, #a3a8a2);
  line-height: normal;
  white-space: nowrap;
}

.cart-breakdown__val {
  font-family: var(--font-family-base, 'Barlow', sans-serif);
  font-weight: 400;
  font-size: 15px;
  color: var(--color-text-primary, #f4f3ee);
  line-height: normal;
  white-space: nowrap;
}

.cart-breakdown__row--promo .cart-breakdown__label {
  color: var(--color-text-secondary, #a3a8a2);
}

.cart-breakdown__val--discount {
  color: var(--color-text-primary, #f4f3ee);
  font-weight: 500;
}

/* Total Row */
.cart-total-row {
  border-top: 1px solid #2e332f;
  padding-top: 21px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  width: 100%;
  white-space: nowrap;
}

.cart-total-label {
  font-family: 'Barlow Condensed', -apple-system, sans-serif;
  font-weight: 800;
  font-size: 28px;
  line-height: 25.76px;
  letter-spacing: 0.14px;
  text-transform: uppercase;
  color: var(--color-text-primary, #f4f3ee);
}

.cart-total-val {
  font-family: 'Barlow Condensed', -apple-system, sans-serif;
  font-weight: 800;
  font-size: 35px;
  line-height: 36.8px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: var(--color-accent-lime, #c6ff00);
}

/* Proceed to Checkout CTA */
.cart-checkout-btn {
  background-color: var(--color-accent-lime, #c6ff00);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 28px;
  width: 100%;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.cart-checkout-btn span {
  font-family: var(--font-family-base, 'Barlow', sans-serif);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #101310;
  line-height: normal;
  white-space: nowrap;
}

.cart-checkout-btn svg {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.cart-checkout-btn:hover {
  background-color: #d4ff33;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(198, 255, 0, 0.25);
}

.cart-checkout-btn:hover svg {
  transform: translateX(4px);
}

.cart-checkout-btn:active {
  transform: translateY(0);
}

/* We Accept Block */
.cart-we-accept {
  border-top: 1px solid #2e332f;
  padding-top: 17px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.cart-we-accept__title {
  font-family: var(--font-family-base, 'Barlow', sans-serif);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--color-text-secondary, #a3a8a2);
  line-height: normal;
}

.cart-we-accept__list {
  font-family: var(--font-family-base, 'Barlow', sans-serif);
  font-weight: 400;
  font-size: 14px;
  color: #c9ccc6;
  line-height: 1.4;
  margin: 0;
}

/* ====================================================================
   5. Responsive Breakpoints
   ==================================================================== */
@media (max-width: 1200px) {
  .cart-main {
    padding: 40px 40px 64px 40px;
  }

  .cart-grid {
    gap: 36px;
  }

  .cart-summary {
    width: 380px;
    padding: 24px;
  }
}

@media (max-width: 992px) {
  .cart-main {
    padding: 32px 24px 56px 24px;
  }

  .cart-grid {
    flex-direction: column;
    gap: 40px;
  }

  .cart-summary {
    width: 100%;
    position: static;
  }

  .cart-title {
    font-size: 48px;
    line-height: 46px;
  }
}

@media (max-width: 640px) {
  .cart-main {
    padding: 24px 16px 48px 16px;
  }

  .cart-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .cart-title {
    font-size: 36px;
    line-height: 34px;
  }

  .cart-item {
    display: grid;
    grid-template-columns: 88px 1fr auto;
    row-gap: 16px;
    column-gap: 14px;
    align-items: start;
    position: relative;
    padding: 20px 0;
  }

  .cart-item__thumb {
    grid-column: 1;
    grid-row: 1;
    width: 88px;
    height: 88px;
  }

  .cart-item__info {
    grid-column: 2;
    grid-row: 1;
    padding-right: 8px;
    width: 100%;
  }

  .cart-item__remove-btn {
    grid-column: 3;
    grid-row: 1;
    width: 36px;
    height: 36px;
    position: static;
  }

  .cart-item__title {
    font-size: 24px;
    line-height: 22px;
  }

  .cart-item__stepper {
    grid-column: 1 / 3;
    grid-row: 2;
    height: 44px;
    width: fit-content;
    margin-left: 0;
  }

  .cart-stepper__btn {
    width: 38px;
    height: 40px;
  }

  .cart-stepper__val {
    width: 34px;
    font-size: 15px;
  }

  .cart-item__price-col {
    grid-column: 3;
    grid-row: 2;
    width: auto;
    padding-left: 0;
    align-self: center;
    text-align: right;
  }

  .cart-item__price {
    font-size: 22px;
  }

  .cart-summary {
    padding: 20px;
  }

  .cart-summary__heading {
    font-size: 30px;
  }

  .cart-total-val {
    font-size: 30px;
  }
}
