/* ========================================================================== */
/*  CART & CHECKOUT STYLES                                                    */
/*  Header cart badge, cart modal layout and checkout summary blocks.         */
/* ========================================================================== */


/* ==========================================================================
   HEADER CART BADGE
   Small circular badge on the cart icon showing item count.
   ========================================================================== */

.cart-count {
    display: none;                  /* hidden by default; toggled via JS */
    position: absolute;
    top: -6px;
    right: -6px;
    background: #d00;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px #fff;
}

/* Visible state for the cart badge */
.cart-count.visible {
    display: flex;
}


/* ==========================================================================
   CART MODAL
   Centered overlay displaying cart contents and total.
   ========================================================================== */

/* Modal overlay background */
.cart-modal {
    display: none;                  /* toggled to flex via JS */
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

/* Modal panel */
.cart-modal-content {
    background: #ffffff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 550px;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 25px;
    font-family: 'Playfair Display', serif;
}

/* Modal heading */
.cart-modal-content h2 {
    font-size: 2.2rem;
    font-weight: 100;
    color: #1c1c1c;
    margin-bottom: 15px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Close icon in the modal header */
.close-cart {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999999;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-cart:hover {
    color: #b89d5f;
}


/* ==========================================================================
   CART ITEMS LIST
   Shared cart row layout used in the cart modal and checkout summary.
   ========================================================================== */

/* Scrollable list of cart items */
.cart-items {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f5f5f5;
    text-align: left;              /* align rows to left inside modal */
}

/* Single cart row */
.cart-items .cart-item {
    display: grid;
    grid-template-columns: 110px 1fr auto;  /* image | details | actions */
    column-gap: 16px;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.3s ease;
}

.cart-items .cart-item:last-child {
    border-bottom: none;
}

/* Hover feedback for entire row */
.cart-items .cart-item:hover {
    background: #f9f9f9;
}

/* Thumbnail container */
.cart-item-image {
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Thumbnail image */
.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 8px;
    border: 1px solid #ddd;
}

/* Hover effect for thumbnail */
.cart-item-image:hover {
    transform: scale(1.03);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

/* Main details column */
.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Legacy name class (kept for compatibility) */
.cart-item-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 4px;
    color: #333;
}

/* Structured title/meta block inside details */
.cart-item-title .name,
.cart-item-details .name {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #111;
    margin: 0 0 6px;
}

/* Additional metadata (e.g. framed / NFT info) */
.cart-item-title .meta,
.cart-item-details .meta {
    margin-top: 2px;
    font-size: 0.85rem;
    color: #777;
    letter-spacing: 0.01em;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Optional variations for metadata emphasis */
.cart-item-details .meta-framed {
    color: #444;
}

.cart-item-details .meta-nft {
    color: #7a7a7a;
}

/* Right column: price + remove action */
.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    min-width: 110px;
}

/* Price text inside cart row */
.cart-item-price {
    margin: 0;
    font-weight: 600;
    font-size: 15px;
    color: #555;
}

/* Legacy price styling (for older markup) */
.cart-item .cart-item-price {
    margin-bottom: 0;
}

/* Remove item button */
.remove-from-cart {
    background: transparent;
    border: none;
    color: #a36a22;
    font-size: 12px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    padding: 0;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.3s ease;
}

.remove-from-cart:hover {
    color: #9d7c48;
    text-decoration: underline;
}


/* ==========================================================================
   CART TOTALS & CTA
   Total line, supporting note and primary checkout button.
   ========================================================================== */

/* Total value row inside cart modal */
.cart-total {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1c1c1c;
    text-align: center;
    margin: 20px 0 10px;
}

/* Concierge/info note inside cart modal */
.concierge-note {
    margin: 14px 0 18px;
    padding: 14px 16px;
    background: #fffdf6;
    border: 1px solid #e6c76d;
    border-radius: 10px;
    text-align: center;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #3a3a3a;
}

.concierge-note::before {
    content: "";
    display: block;
    width: 40px;
    height: 2px;
    background: #b89d5f;
    margin: 0 auto 10px;
}

/* Primary checkout button inside cart modal */
.checkout-button {
    background: linear-gradient(to right, #000, #333);
    color: #ffffff;
    border: none;
    padding: 15px 35px;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 100;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.checkout-button:hover {
    background: linear-gradient(to right, #333, #555);
}

.checkout-button:active {
    transform: translateY(1px);
}


/* ==========================================================================
   CUSTOM SCROLLBAR
   Subtle scrollbar styling for cart item lists (WebKit-based browsers only).
   ========================================================================== */

.cart-items::-webkit-scrollbar {
    width: 8px;
}

.cart-items::-webkit-scrollbar-thumb {
    background: #b89d5f;
    border-radius: 4px;
}

.cart-items::-webkit-scrollbar-thumb:hover {
    background: #a07d47;
}


/* ==========================================================================
   CHECKOUT SUMMARY
   Compact summary block used in the checkout modal/page.
   ========================================================================== */

/* Summary container (wraps cart items + totals) */
.checkout-summary {
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background: #f9f9f9;
}

/* Short list of items inside summary */
.checkout-items {
    list-style: none;
    padding: 0;
    margin: 0 0 10px 0;
    max-height: 150px;
    overflow-y: auto;
    border-bottom: 1px solid #ddd;
}

/* Name/price line inside checkout summary */
.checkout-items li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.95rem;
}

/* Totals block (subtotal, tax, shipping, total) */
.checkout-subtotal,
.checkout-tax,
.checkout-shipping,
.checkout-total {
    font-size: 1.1rem;
    margin: 5px 0;
    text-align: right;
}

/* Highlighted total numeric value */
.total-value {
    font-weight: bold;
    color: #b89d5f;
}


/* ==========================================================================
   RESPONSIVE LAYOUT
   Ensure the cart modal and rows look refined on small screens.
   ========================================================================== */

@media (max-width: 600px) {
  .cart-modal-content {
    padding: 22px 18px 24px;
    border-radius: 12px;
  }

  .cart-modal-content h2 {
    font-size: 1.6rem;   /* enne 2.2rem */
    letter-spacing: 0.06em;
  }

  /* Keep image | details | price layout even on small screens,
     just make everything slightly more compact. */
  .cart-items .cart-item {
    grid-template-columns: 90px 1fr auto;   /* image | details | actions */
    column-gap: 12px;
    align-items: flex-start;
    padding: 14px 0;
  }

  .cart-item-image {
    width: 90px;
    height: 90px;
    margin: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,.08);
  }

  .cart-item-details {
    align-items: flex-start;
    text-align: left;
  }

  .cart-item-title .name,
  .cart-item-details .name,
  .cart-item-name {
    font-size: 0.95rem;
  }

  .cart-item-title .meta,
  .cart-item-details .meta {
    font-size: 0.8rem;
  }

  .cart-item-actions {
    align-items: flex-end;
    gap: 4px;
    min-width: 80px;
  }

  .cart-item-price {
    font-size: 0.9rem;
  }

  .remove-from-cart {
    font-size: 0.7rem;
  }

  .cart-total {
    font-size: 1.25rem;
  }

  .checkout-button {
    max-width: 100%;
    font-size: 1.05rem;
  }
}

/* Truncated description + "See more" */

.cart-item-description {
  font-size: 0.85rem;        /* sama mis .meta, vajadusel timmi */
  line-height: 1.4;
  max-height: 3.6em;         /* ~2,5 rida → osa tekstist peidus */
  overflow: hidden;
}

.cart-item-description--expanded,
.cart-item-description--full {
  max-height: none;
}

.cart-item-toggle {
  margin-top: 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  color: #b4843c; /* sinu kuldne toon */
}

/* Desktop: näita alati kõike, nupp peidetud */
@media (min-width: 900px) {
  .cart-item-description {
    max-height: none;
  }

  .cart-item-toggle {
    display: none;
  }
}
