/*-----------------------------------*\
  #CART PAGE
\*-----------------------------------*/

.cart-section {
  padding-top: 100px;
  padding-bottom: var(--section-space);
  min-height: 100vh;
}

.cart-section .section-title {
  margin-bottom: 20px;
}

.cart-count-text {
  max-width: 640px;
  margin: 0 auto 40px;
  color: var(--quick-silver);
  font-size: 1.5rem;
  line-height: var(--lineHeight-4);
}

.cart-count-text strong {
  color: var(--gold-crayola);
}

/* CART ALERT */

.cart-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--eerie-black-2);
  border: 1px solid var(--gold-crayola);
  border-radius: var(--radius-24);
  padding: 16px 20px;
  margin-bottom: 30px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.cart-alert ion-icon {
  color: var(--gold-crayola);
  font-size: 2.2rem;
  flex-shrink: 0;
}

.cart-alert p {
  font-size: 1.4rem;
  color: var(--white);
  margin: 0;
}

/* CART EMPTY */

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px;
}

.cart-empty ion-icon {
  font-size: 100px;
  color: var(--gold-crayola);
}

.cart-empty .headline-2 {
  margin-top: 20px;
}

.cart-empty .body-4 {
  color: var(--quick-silver);
  margin: 10px 0 30px;
}

/* CART WRAPPER */

.cart-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  text-align: left;
}

@media (min-width: 992px) {
  .cart-wrapper {
    grid-template-columns: 2fr 1fr;
    align-items: start;
  }
}

/* CART ITEMS */

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cart-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  grid-template-areas:
    "image info"
    "image actions";
  gap: 10px 14px;
  align-items: start;
  background: linear-gradient(135deg, hsla(210,4%,11%,1), hsla(210,4%,9%,1));
  border: 1px solid hsla(0,0%,100%,0.07);
  border-radius: 16px;
  padding: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cart-item:hover {
  border-color: hsla(38,61%,73%,0.45);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.cart-item-actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .cart-item {
    grid-template-columns: 80px 1fr auto auto auto;
    grid-template-areas: "image info quantity subtotal remove";
    align-items: center;
    gap: 10px 18px;
    padding: 16px 20px;
    border-radius: 14px;
  }

  .cart-item-actions { display: contents; }
}

/* ITEM IMAGE */

.item-image {
  grid-area: image;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  background-color: var(--smoky-black-3);
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .item-image {
    width: 80px;
    height: 80px;
    border-radius: 10px;
  }
}

.item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ITEM INFO */

.item-info {
  grid-area: info;
  min-width: 0;
}

.item-name {
  font-family: var(--fontFamily-forum);
  font-size: 1.45rem;
  font-weight: var(--weight-bold);
  letter-spacing: 0.05em;
  color: var(--white);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 768px) {
  .item-name { font-size: 1.55rem; white-space: normal; }
}

.item-price {
  font-size: 1.2rem;
  color: var(--quick-silver);
  margin-bottom: 8px;
}

/* COMMENT */

.comment-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: hsla(210,4%,9%,1);
  border: 1px solid hsla(0,0%,100%,0.08);
  border-radius: 50px;
  padding: 5px 10px;
  max-width: 200px;
  transition: border-color 0.2s ease;
}

.comment-wrapper:focus-within {
  border-color: hsl(38,61%,73%);
}

.comment-wrapper ion-icon {
  color: hsl(38,61%,73%);
  font-size: 1.4rem;
  flex-shrink: 0;
}

.comment-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--white);
  font-family: var(--fontFamily-dm_sans);
  font-size: 1.2rem;
  min-width: 0;
}

.comment-input::placeholder { color: hsla(0,0%,65%,0.5); }

.comment-counter {
  font-size: 1rem;
  color: hsla(0,0%,65%,0.45);
  flex-shrink: 0;
}

/* COMMENT */

.comment-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--eerie-black-1);
  border: 1px solid var(--white-alpha-10);
  border-radius: var(--radius-24);
  padding: 8px 14px;
  max-width: 260px;
  transition: var(--transition-1);
}

.comment-wrapper:focus-within {
  border-color: var(--gold-crayola);
}

.comment-wrapper ion-icon {
  color: var(--gold-crayola);
  font-size: 1.6rem;
  flex-shrink: 0;
}

.comment-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--white);
  font-family: var(--fontFamily-dm_sans);
  font-size: 1.3rem;
  min-width: 0;
}

.comment-input::placeholder {
  color: var(--quick-silver);
}

.comment-counter {
  font-size: 1.1rem;
  color: var(--quick-silver);
  flex-shrink: 0;
}

/* QUANTITY */

.quantity-form {
  grid-area: quantity;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
}

@media (min-width: 768px) {
  .quantity-form { justify-self: center; }
}

.qty-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsla(38,61%,73%,0.1);
  border: 1px solid hsla(38,61%,73%,0.3);
  border-radius: 50%;
  color: hsl(38,61%,73%);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.5rem;
}

.qty-btn:hover {
  background: hsl(38,61%,73%);
  color: hsl(40,12%,5%);
  border-color: hsl(38,61%,73%);
}

.qty-input {
  width: 36px;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--white);
  font-family: var(--fontFamily-dm_sans);
  font-size: 1.4rem;
  font-weight: var(--weight-bold);
  padding: 4px 0;
}

/* SUBTOTAL */

.item-subtotal {
  grid-area: subtotal;
  font-family: var(--fontFamily-forum);
  font-size: 1.5rem;
  font-weight: var(--weight-bold);
  color: hsl(38,61%,73%);
  justify-self: start;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .item-subtotal {
    justify-self: center;
    min-width: 80px;
    text-align: center;
    font-size: 1.6rem;
  }
}

/* REMOVE */

.remove-form {
  grid-area: remove;
  justify-self: start;
}

@media (min-width: 768px) { .remove-form { justify-self: center; } }

.btn-remove {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid hsla(0,0%,100%,0.08);
  border-radius: 50%;
  color: hsla(0,0%,65%,0.5);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.5rem;
}

.btn-remove:hover {
  background: hsla(0,60%,45%,0.15);
  color: hsl(0,60%,65%);
  border-color: hsla(0,60%,45%,0.4);
}

/* CART SUMMARY */

.cart-summary {
  background: linear-gradient(160deg, hsla(210,4%,11%,1), hsla(210,4%,9%,1));
  border: 1px solid hsla(38,61%,73%,0.2);
  border-radius: 18px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 100px;
}

.cart-summary::before {
  content: '';
  display: block;
  height: 2px;
  width: 40px;
  background: hsl(38,61%,73%);
  border-radius: 2px;
  margin-bottom: 4px;
}

.cart-summary .title-2 {
  font-family: var(--fontFamily-forum);
  letter-spacing: 0.08em;
  font-size: 1.9rem;
  margin-bottom: 4px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.4rem;
  color: hsla(0,0%,65%,0.8);
}

.total-row.final {
  font-size: 1.8rem;
  font-weight: var(--weight-bold);
  color: var(--white);
  border-top: 1px solid hsla(38,61%,73%,0.15);
  padding-top: 12px;
  margin-top: 4px;
}

.total-row.final span:last-child {
  color: hsl(38,61%,73%);
  font-family: var(--fontFamily-forum);
}

/* BUTTONS */

.btn-checkout {
  width: 100%;
  justify-content: center;
  margin-top: 6px;
  border-radius: 50px;
  font-size: 1.3rem;
  padding: 12px 24px;
}

.btn-continue {
  width: 100%;
  justify-content: center;
  border-radius: 50px;
  font-size: 1.3rem;
  padding: 12px 24px;
}

.clear-cart-form {
  display: flex;
  justify-content: center;
}

.link-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  color: hsla(0,0%,65%,0.4);
  font-family: var(--fontFamily-dm_sans);
  font-size: 1.2rem;
  cursor: pointer;
  margin-top: 2px;
  transition: color 0.2s ease;
}

.link-clear:hover { color: hsl(0,60%,55%); }

/* RESPONSIVE MOBILE */

@media (max-width: 480px) {
  .cart-section { padding-top: 80px; }

  .cart-items { gap: 10px; }

  .cart-item {
    grid-template-columns: 64px 1fr;
    padding: 12px;
    gap: 8px 12px;
    border-radius: 14px;
  }

  .cart-item-actions {
    gap: 8px;
  }

  .item-image { width: 64px; height: 64px; border-radius: 10px; }

  .item-name { font-size: 1.35rem; }

  .item-price { font-size: 1.15rem; margin-bottom: 6px; }

  .qty-btn { width: 28px; height: 28px; font-size: 1.4rem; }

  .qty-input { width: 30px; font-size: 1.3rem; }

  .item-subtotal { font-size: 1.4rem; }

  .btn-remove { width: 28px; height: 28px; font-size: 1.3rem; }

  .comment-wrapper { max-width: 160px; padding: 4px 8px; }

  .cart-summary {
    padding: 18px 16px;
    position: static;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .cart-summary .title-2 { font-size: 1.7rem; }

  .total-row { font-size: 1.3rem; }

  .total-row.final { font-size: 1.6rem; }

  .btn-checkout,
  .btn-continue { 
    font-size: 1.2rem; 
    padding: 11px 20px;
    width: 100% !important;
    max-width: none;
    text-align: center;
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 6px 0;
  }
}

/* FONDO CON PROFUNDIDAD */

.cart-section {
  position: relative;
  overflow: hidden;
  background-color: var(--smoky-black-1, #0d0d0d);
  background-image:
    radial-gradient(circle at 15% 20%, hsla(36, 73%, 53%, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 85% 75%, hsla(36, 73%, 53%, 0.06) 0%, transparent 50%),
    repeating-linear-gradient(
      135deg,
      hsla(0, 0%, 100%, 0.015) 0px,
      hsla(0, 0%, 100%, 0.015) 1px,
      transparent 1px,
      transparent 60px
    );
  background-attachment: fixed;
}

.cart-section::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse 600px 300px at 50% 0%, hsla(36, 73%, 53%, 0.05), transparent 70%);
  z-index: 0;
}

.cart-section .container {
  position: relative;
  z-index: 1;
}