/* ========================================
   IKITAI — Cart, Size Selector & Checkout
   ======================================== */

/* --- Size Selector Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  transition: all var(--duration-normal) var(--ease-out);
  pointer-events: none;
}

.modal-overlay--open {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  pointer-events: all;
}

.modal-box {
  background: var(--grey-dark);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: var(--space-xl);
  /* Wide enough for the 3:4 product gallery that now heads the modal. */
  max-width: 420px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(20px);
  opacity: 0;
  transition: all var(--duration-normal) var(--ease-out);
}

.modal-overlay--open .modal-box {
  transform: translateY(0);
  opacity: 1;
}

.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  font-size: 1.5rem;
  color: var(--grey-muted);
  transition: color var(--duration-fast);
}

.modal-close:hover {
  color: var(--white);
}

.modal-product {
  text-align: center;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-product__name {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: var(--space-xs);
}

.modal-product__meta {
  font-size: 0.75rem;
  color: var(--grey-muted);
  margin-bottom: var(--space-sm);
}

.modal-product__price {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.05em;
  color: var(--bone);
}

/* Sits between the price and the size buttons, which is the only place it can
   be read before the commitment it describes. */
.modal-preorder {
  margin: var(--space-md) 0;
  padding: var(--space-sm) var(--space-md);
  background: var(--grey-dark);
  border-left: 2px solid var(--red-bright);
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--grey-light);
}

.modal-preorder strong {
  color: var(--white);
  font-weight: 500;
}

.modal-sizes__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--grey-muted);
  margin-bottom: var(--space-md);
  text-align: center;
}

.modal-sizes__grid {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

.modal-size-btn {
  min-width: 50px;
  padding: var(--space-sm) var(--space-md);
  background: var(--black-soft);
  border: 1px solid var(--grey-mid);
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: all var(--duration-fast);
}

.modal-size-btn:hover {
  border-color: var(--red-bright);
  background: rgba(139, 26, 26, 0.15);
  color: var(--white);
}

.modal-size-guide {
  text-align: center;
  margin-top: var(--space-lg);
}

.modal-size-guide a {
  font-size: 0.7rem;
  color: var(--grey-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--duration-fast);
}

.modal-size-guide a:hover {
  color: var(--red-bright);
}

/* --- Cart Drawer --- */
.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
}

.cart-drawer--open {
  pointer-events: all;
}

.cart-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background var(--duration-normal) var(--ease-out);
}

.cart-drawer--open .cart-drawer__overlay {
  background: rgba(0, 0, 0, 0.7);
}

.cart-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 90vw;
  background: var(--black-soft);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  transform: translateX(100%);
  transition: transform var(--duration-normal) var(--ease-out);
  display: flex;
  flex-direction: column;
}

.cart-drawer--open .cart-drawer__panel {
  transform: translateX(0);
}

.cart-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cart-drawer__header h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.cart-drawer__close {
  font-size: 1.5rem;
  color: var(--grey-muted);
  transition: color var(--duration-fast);
}

.cart-drawer__close:hover {
  color: var(--white);
}

.cart-drawer__items {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md) var(--space-lg);
}

.cart-drawer__footer {
  padding: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Cart Empty */
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 300px;
  text-align: center;
}

.cart-empty__kanji {
  font-family: var(--font-accent);
  font-size: 4rem;
  color: rgba(139, 26, 26, 0.2);
  margin-bottom: var(--space-md);
}

.cart-empty__text {
  color: var(--grey-muted);
  font-size: 0.9rem;
}

/* Cart Item */
.cart-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.cart-item__image {
  width: 70px;
  height: 70px;
  background: var(--grey-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cart-item__kanji {
  font-family: var(--font-accent);
  font-size: 1.5rem;
  color: rgba(139, 26, 26, 0.4);
}

.cart-item__details {
  flex: 1;
}

.cart-item__name {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 2px;
}

.cart-item__size {
  font-size: 0.7rem;
  color: var(--grey-muted);
  margin-bottom: var(--space-sm);
}

.cart-item__qty {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--grey-mid);
}

.cart-item__qty button {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--grey-light);
  transition: all var(--duration-fast);
}

.cart-item__qty button:hover {
  background: var(--grey-mid);
  color: var(--white);
}

.cart-item__qty span {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 500;
  border-left: 1px solid var(--grey-mid);
  border-right: 1px solid var(--grey-mid);
}

.cart-item__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-sm);
}

.cart-item__price {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.03em;
}

.cart-item__remove {
  font-size: 0.65rem;
  color: var(--grey-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--duration-fast);
}

.cart-item__remove:hover {
  color: var(--red-bright);
}

/* Cart Footer */

/* .cart-shipping / .cart-shipping--free lived here and styled the
   "you're ₹X away from free shipping" banner. Both the threshold and the banner
   are gone — shipping is a flat stated cost — and the rules are deleted rather
   than left unused so nothing can quietly revive the offer. */

/* The first line of the cart footer. Everything below it is money; this is the
   one fact that changes what the money means. */
.cart-preorder-line {
  margin-bottom: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--grey-dark);
  border-left: 2px solid var(--red-bright);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--grey-light);
}

.cart-preorder-line strong {
  color: var(--white);
  font-weight: 500;
}

.cart-subtotal {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Shipping is now always a real charge, so it reads like the subtotal's quieter
   sibling rather than a win. */
.cart-subtotal--ship {
  color: var(--grey-light);
  font-weight: 400;
}

/* A line was removed from the cart because the shopper's market doesn't sell it.
   Amber rather than red: nothing has gone wrong, but the total just changed
   without them touching it, so it has to be impossible to miss. */
.cart-notice {
  margin-bottom: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: rgba(196, 150, 30, 0.1);
  border-left: 2px solid rgba(214, 170, 60, 0.7);
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--bone);
}

/* Quiet on purpose. It only has to be there when someone looks for the tax,
   and competing with the checkout button would be the wrong trade. */
.cart-tax-note,
.checkout__tax-note {
  margin-top: var(--space-sm);
  font-size: 0.65rem;
  line-height: 1.5;
  color: var(--grey-muted);
  text-align: center;
}

.checkout__tax-note {
  text-align: right;
  padding-top: var(--space-sm);
}

/* --- Checkout Page --- */
.checkout {
  padding-top: calc(var(--header-height) + 40px);
  min-height: 100vh;
  background: var(--black);
}

.checkout__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-lg);
  margin-bottom: var(--space-xl);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.checkout__back {
  font-size: 0.75rem;
  color: var(--grey-light);
  transition: color var(--duration-fast);
}

.checkout__back:hover {
  color: var(--red-bright);
}

.checkout__grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}

.checkout__section-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: var(--space-lg);
}

/* Form */
.form-group {
  margin-bottom: var(--space-md);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.form-input {
  width: 100%;
  padding: var(--space-md);
  background: var(--grey-dark);
  border: 1px solid var(--grey-mid);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--duration-fast);
  appearance: none;
  -webkit-appearance: none;
}

.form-input::placeholder {
  color: var(--grey-muted);
}

.form-input:focus {
  border-color: var(--red-muted);
}

select.form-input {
  color: var(--grey-muted);
}

select.form-input:valid {
  color: var(--white);
}

/* Says in words what the red borders only hint at. role="alert" on the element
   means a screen reader hears it the moment it appears. */
.checkout__error {
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: rgba(196, 30, 30, 0.1);
  border-left: 2px solid var(--red-bright);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--white);
}

.checkout__error[hidden] {
  display: none;
}

.checkout__trust {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
  font-size: 0.7rem;
  color: var(--grey-muted);
}

/* Order Summary */
.checkout__summary {
  background: var(--grey-dark);
  padding: var(--space-xl);
  border: 1px solid rgba(255, 255, 255, 0.04);
  height: fit-content;
  position: sticky;
  top: calc(var(--header-height) + 40px);
}

.checkout-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.checkout-item__image {
  width: 50px;
  height: 50px;
  background: var(--black-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.checkout-item__image span {
  font-family: var(--font-accent);
  font-size: 1.2rem;
  color: rgba(139, 26, 26, 0.4);
}

.checkout-item__details {
  flex: 1;
}

.checkout-item__details strong {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 2px;
}

.checkout-item__details span {
  font-size: 0.7rem;
  color: var(--grey-muted);
}

.checkout-item__price {
  font-family: var(--font-display);
  font-size: 0.95rem;
}

.checkout__totals {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.checkout__total-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--grey-light);
  margin-bottom: var(--space-sm);
}

.checkout__total-row--final {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: var(--space-sm);
}

.checkout__gift {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: rgba(139, 26, 26, 0.08);
  border: 1px solid rgba(139, 26, 26, 0.15);
}

.checkout__gift strong {
  font-size: 0.8rem;
  display: block;
  margin-bottom: 4px;
}

.checkout__gift p {
  font-size: 0.75rem;
  color: var(--grey-light);
}

/* The last thing between the shopper and the pay button. Red-edged and above
   the guarantee, because "this does not exist yet" is the single fact most
   likely to cause a refund request later if it was missed here. */
.checkout__preorder {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: var(--grey-dark);
  border-left: 2px solid var(--red-bright);
}

.checkout__preorder strong {
  display: block;
  font-size: 0.8rem;
  color: var(--white);
  margin-bottom: var(--space-xs);
}

.checkout__preorder p {
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--grey-light);
}

.checkout__preorder p + p {
  margin-top: var(--space-xs);
}

.checkout__preorder p strong {
  display: inline;
  font-size: inherit;
  margin: 0;
}

.checkout__guarantee {
  margin-top: var(--space-md);
  padding: var(--space-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.checkout__guarantee strong {
  font-size: 0.8rem;
  display: block;
  margin-bottom: 4px;
}

.checkout__guarantee p {
  font-size: 0.75rem;
  color: var(--grey-light);
}

/* Responsive */
@media (max-width: 768px) {
  .checkout__grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .checkout__summary {
    position: static;
    order: -1;
  }

  .checkout__trust {
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .cart-drawer__panel {
    width: 100%;
    max-width: 100vw;
  }
}
