/* ─────────────────────────────────────────
   CART DRAWER INNER LAYOUT & STYLING
───────────────────────────────────────── */

/* Cart Items Scroll Container */
.cart-items-container {
  flex: 1;
  overflow-y: auto;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  padding-right: 0.25rem;
  display: flex;
  flex-direction: column;
}

/* Individual Cart Item Card */
.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1rem;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(2, 2, 2, 0.05);
  align-items: start;
}
.cart-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Product Image Box */
.cart-item-image {
  width: 80px;
  height: 80px;
  background: var(--light-grey);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Item details text */
.cart-item-details {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.cart-item-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.cart-item-name {
  font-family: var(--font-primary);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--black);
  line-height: 1.3;
  margin-right: 0.5rem;
}
.cart-item-price {
  font-family: var(--font-primary);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--black);
  white-space: nowrap;
}
.cart-item-size {
  font-family: var(--font-primary);
  font-size: 0.58rem;
  color: var(--light-faded);
  text-transform: uppercase;
  margin-top: -0.1rem;
}

/* Quantity controls & Remove link row */
.cart-item-qty-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.25rem;
}
.cart-item-quantity-controls {
  display: flex;
  align-items: center;
  border: 1px solid rgba(2, 2, 2, 0.12);
  height: 1.6rem;
}
.qty-adjust-btn {
  background: transparent;
  border: none;
  color: var(--black);
  width: 1.4rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 400;
  cursor: pointer;
  transition: background-color 0.2s;
  outline: none;
}
.qty-adjust-btn:hover {
  background-color: rgba(2, 2, 2, 0.04);
}
.qty-value-input {
  width: 1.8rem;
  height: 100%;
  border: none;
  border-left: 1px solid rgba(2, 2, 2, 0.12);
  border-right: 1px solid rgba(2, 2, 2, 0.12);
  background: transparent;
  text-align: center;
  font-family: var(--font-primary);
  font-size: 0.58rem;
  font-weight: 500;
  color: var(--black);
  -moz-appearance: textfield;
  outline: none;
}
.qty-value-input::-webkit-outer-spin-button,
.qty-value-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.cart-item-remove-link {
  font-family: var(--font-primary);
  font-size: 0.58rem;
  color: var(--light-faded);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
}
.cart-item-remove-link:hover {
  color: var(--black);
  text-decoration: underline;
}

/* Cart Footer Panel */
.cart-footer {
  border-top: 1px solid rgba(2, 2, 2, 0.08);
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--white);
}
.cart-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cart-footer-label {
  font-family: var(--font-primary);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--black);
}
.cart-footer-value {
  font-family: var(--font-primary);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--black);
}
.shipping-calculated {
  color: var(--light-faded);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.cart-footer-divider {
  height: 1px;
  background: rgba(2, 2, 2, 0.08);
  margin: 0.2rem 0;
}
.cart-checkout-btn {
  width: 100%;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-primary);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 1.1rem;
  text-align: center;
  border: none;
  cursor: pointer;
  transition: opacity 0.3s;
}
.cart-checkout-btn:hover {
  opacity: 0.85;
}

/* Empty State centering overrides */
.cart-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 0;
}

/* Nav Cart Link Badge */
.nav-link-cart {
  position: relative;
}
.cart-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  background: var(--black);
  color: var(--white);
  font-size: 0.55rem;
  font-weight: 700;
  min-width: 13px;
  height: 13px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  line-height: 1;
}

/* ─────────────────────────────────────────
   CENTERED CHECKOUT MODAL OVERLAY
───────────────────────────────────────── */
.checkout-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 2, 2, 0.4);
  backdrop-filter: blur(1px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--margin);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.checkout-modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.checkout-modal {
  background: var(--white);
  border: 1px solid rgba(2, 2, 2, 0.08);
  padding: 2.5rem;
  max-width: 420px;
  width: 100%;
  position: relative;
  transform: scale(0.95);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.checkout-modal-overlay.show .checkout-modal {
  transform: scale(1);
}
.checkout-modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  font-size: 1.2rem;
  color: var(--light-faded);
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
  outline: none;
}
.checkout-modal-close-btn:hover {
  color: var(--black);
}
.checkout-modal-heading {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-style: italic;
  font-weight: 400;
  margin-bottom: 1.25rem;
  color: var(--black);
  line-height: 1.2;
}
.checkout-modal-text {
  font-family: var(--font-primary);
  font-size: 0.72rem;
  line-height: 1.7;
  color: rgba(2, 2, 2, 0.6);
  margin-bottom: 1.25rem;
}
.checkout-modal-text:last-of-type {
  margin-bottom: 2rem;
}
.checkout-modal-cta-btn {
  display: block;
  width: 100%;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-primary);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 1.1rem;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.3s;
}
.checkout-modal-cta-btn:hover {
  opacity: 0.85;
}

/* Conditional Rendering helper classes controlled by JS */
body.cart-has-items #cartEmptyState {
  display: none !important;
}
body.cart-has-items #cartItemsContainer,
body.cart-has-items #cartFooter {
  display: flex !important;
}
body:not(.cart-has-items) #cartItemsContainer,
body:not(.cart-has-items) #cartFooter {
  display: none !important;
}
body:not(.cart-has-items) #cartEmptyState {
  display: flex !important;
}

/* Mobile specific layout overrides */
@media (max-width: 480px) {
  .cart-drawer {
    max-width: 100% !important;
    border-left: none !important;
  }
}
