/* =========================================================
   cart.css
   Dipakai untuk halaman: cart.html (MAIN ONLY)
   ========================================================= */


/* =========================================================
   1) PAGE WRAPPER + TITLE
   ========================================================= */
.cart-page {
  padding-top: .8rem;
}

.cart-title {
  text-align: center;
  font-family: "Calistoga", serif;
  color: var(--primary);
  font-size: 1.50rem;
  letter-spacing: 1px;
  margin: 1.2rem 0 2.2rem;
  text-transform: uppercase;
}


/* =========================================================
   2) TABLE WRAPPER
   ========================================================= */
.cart-table {
  margin-bottom: 1.2rem;
}


/* =========================================================
   3) TABLE HEADER (CHECK ALL + COLUMN LABELS + TOTAL CART)
   ========================================================= */
.cart-head-row {
  display: grid;
  grid-template-columns: 1fr 240px;
  /* SAMA kayak .cart-body-grid */
  column-gap: 36px;
  /* SAMA kayak .cart-body-grid */
  align-items: center;
  margin-bottom: .9rem;
}

/* ===== Header: Left Columns ===== */
.cart-head-left {
  display: grid;
  grid-template-columns: 36px 130px 1.2fr 0.95fr 1fr 0.9fr 70px;
  align-items: center;
  column-gap: 25px;
  justify-items: center;
}

/* ===== Header: Right (Total Cart) ===== */
.cart-head-right {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ===== Header Text Style ===== */
.c-h {
  font-family: "Viga", serif;
  color: var(--primary);
  font-size: 1.35rem;
  text-align: center;
  margin-left: 0;
  justify-self: center;
}

/* ===== Column Alignments ===== */
.c-name {
  justify-self: start;
  text-align: left;
}

.c-unit,
.c-total,
.c-trash,
.c-totalcart,
.c-qty {
  text-align: center;
}

/* ===== Header: Product Label Placement ===== */
.h-product {
  grid-column: 3;
}


/* =========================================================
   4) CHECK ALL (HEADER)
   ========================================================= */
.c-checkall {
  grid-column: 1 / 3;
  display: flex;
  align-items: center;
  gap: .6rem;
  justify-content: flex-start;
  width: 100%;
}

/* ===== Button/Toggle Function : Check All ===== */
.checkall {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: var(--primary);
  font-weight: 800;
}

.checkall input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}


/* =========================================================
   5) BODY GRID (LEFT LIST + RIGHT SUMMARY)
   ========================================================= */
.cart-body-grid {
  display: grid;
  grid-template-columns: 1fr 240px;
  column-gap: 36px;
  align-items: start;
}


/* =========================================================
   6) CART LIST (ROWS WRAPPER)
   ========================================================= */
.cart-list {
  border-top: 1px solid rgba(139, 30, 30, .40);
}


/* =========================================================
   7) CART ROW ITEM
   ========================================================= */
.cart-row {
  display: grid;
  grid-template-columns: 36px 130px 1.2fr 0.95fr 1fr 0.9fr 70px;
  align-items: center;
  column-gap: 25px;
  padding: 22px 0;
  border-bottom: 1px solid rgba(139, 30, 30, .40);
}

/* ===== Checkbox Function: Per Row ===== */
.c-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* ===== Product Image ===== */
.cart-imgbox {
  width: 120px;
  height: 120px;
  border-radius: 10px;
  border: 2px solid rgba(139, 30, 30, .65);
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  object-fit: cover;
}

.cart-imgbox img {
  width: 100%;
  height: 100%;
  object-fit: fill;
}

/* ===== Product Name ===== */
.cart-name {
  color: var(--primary);
  font-weight: 900;
  font-size: 1.15rem;
  line-height: 1.2;
  max-width: 100%;
}

/* ===== Price Text (Unit & Total) ===== */
.cart-price {
  color: var(--primary);
  font-weight: 900;
  font-size: 1.05rem;
}

/* Cart Detail Product (Category Size Motif) */
.cart-meta {
  margin-top: 4px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: #000000;
  font-weight: 700;
}

.cart-meta span {
  position: relative;
  padding-right: 8px;
}

.cart-meta span:not(:last-child)::after {
  content: "•";
  position: absolute;
  right: 0;
  color: var(--primary);
  font-weight: 900;
}


/* =========================================================
   8) QTY CONTROL
   ========================================================= */
.qty {
  display: inline-flex;
  align-items: center;
  background: var(--primary);
  border-radius: 8px;
  overflow: hidden;
  height: 34px;
}

/* ===== Button Function: Minus / Plus ===== */
.qty-btn {
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Value Display ===== */
.qty-num {
  width: 38px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--primary);
  font-weight: 900;
}


/* =========================================================
   9) DELETE / TRASH
   ========================================================= */

/* ===== Button Function: Remove Item ===== */
.trash-btn {
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trash-btn:hover {
  opacity: .75;
}


/* =========================================================
   10) CART SUMMARY (RIGHT SIDE)
   ========================================================= */
.cart-summary {
  padding-top: 72px;
  text-align: center;
}

.sum-amount {
  color: var(--primary);
  font-weight: 900;
  font-size: 1.35rem;
  margin-bottom: 16px;
}

/* ===== Button Function: Checkout ===== */
.sum-btn {
  padding: .55rem 1.25rem;
  border-radius: 10px;
  font-size: .78rem;
  min-width: 150px;
  letter-spacing: .6px;
}

/* =========================================================
   11) RESPONSIVE
   ========================================================= */
/* ===== Tablet & Device (<= 991px) ===== */
/* @media (max-width: 991px) {
} */

/* ===== Mobile (<= 575px) ===== */
@media (max-width: 575px) {
  /* ===== Title ===== */
  .cart-title {
    font-size: 1.65rem;
    margin: 1rem 0 1.4rem;
  }

  /* ===== Header ===== */
  .cart-head-left .c-h,
  .cart-head-right {
    display: none !important;
  }

  .cart-head-row {
    margin-bottom: .4rem;
  }

  /* ===== Body Grid ===== */
  .cart-body-grid {
    grid-template-columns: 1fr;
    row-gap: 18px;
  }

  .cart-list {
    border-top: 0;
  }

  /* ===== Align Text ===== */
  .c-unit,
  .c-total,
  .c-qty {
    justify-self: start;
    text-align: left;
  }

  /* ===== Trash Delete ===== */
  .c-del {
    grid-area: name;
    justify-self: end;
    align-self: center;
    margin-left: 10px;
  }

  /* nama produk gak ketabrak trash */
  .c-name {
    padding-right: 34px;
  }

  /* ===== Button State Function : Disabled Checkout ===== */
  .sum-btn.disabled {
    pointer-events: none;
    opacity: .5;
  }


  /* =======================================================
     CARD ITEM (MOBILE GRID AREAS)
     ======================================================= */
  .cart-row {
    grid-template-columns: 26px 110px 1fr;
    grid-template-areas:
      "check img name"
      "check img unit"
      "check img total"
      "check img qty"
      "check img del";
    column-gap: 14px;
    row-gap: 8px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(139, 30, 30, .28);
  }

  /* ===== Checkbox Center ===== */
  .c-check {
    grid-area: check;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0;
    align-self: stretch;
  }

  /* tweak: geser sedikit biar center image */
  .c-check input {
    transform: translateY(6px);
    /* naik/turun : 4-10px */
  }

  .c-img  { grid-area: img; }
  .c-name { grid-area: name; }
  .c-unit { grid-area: unit; }
  .c-total{ grid-area: total; }
  .c-qty  { grid-area: qty; }

  .cart-imgbox {
    width: 110px;
    height: 150px;
    border-radius: 10px;
  }

  .cart-name {
    font-size: 1.02rem;
    line-height: 1.25;
  }

  .cart-price {
    font-size: .95rem;
  }

  /* ===== Qty ===== */
  .qty {
    height: 32px;
    border-radius: 8px;
  }

  .qty-btn {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .qty-num {
    width: 36px;
    height: 32px;
  }

  /* =======================================================
     SUMMARY (MOBILE)
     ======================================================= */
  .cart-summary {
    padding-top: 14px;
    border-top: 1px solid rgba(139, 30, 30, .28);
    text-align: center;
  }

  .sum-amount {
    font-size: 1.25rem;
    margin-bottom: 12px;
  }

  .sum-btn {
    width: 100%;
    min-width: 0;
    padding: .70rem 1rem;
    font-size: .85rem;
    border-radius: 12px;
  }

  /* =======================================================
     Category Desktipsi Size Motif
     ======================================================= */
  .c-name {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .cart-name {
    font-size: 0.85rem;
    line-height: 1.25;
  }

  .cart-meta {
    margin-top: 6px;
    font-size: 0.68rem;
    color: #000000;
    gap: 8px;
  }

  .cart-meta span {
    padding-right: 10px;
  }

  .cart-meta span:not(:last-child)::after {
    right: 2px;
  }

  .c-img {
    margin-right: 3px;
  }

  .cart-imgbox {
    width: 110px;
    height: 150px;
  }
}