﻿/*
Filename:      style-store.css
Created by:    Kris Korsmo
Organization:  Leading Edge Digital Media - www.leadingedge.net
Purpose:       Storefront - catalogue, product, cart, checkout
Last Updated:  08/26/2026
*/

/* ------------------------------------------------------------------
   Shared
   ------------------------------------------------------------------ */
#store .eg-sub {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.85em;
}

#store .eg-fluid { width: 100%; }

#store .eg-breadcrumb {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.9em;
  margin-bottom: 1rem;
}
#store .eg-breadcrumb a { color: rgba(255, 255, 255, 0.7); }
#store .eg-breadcrumb a:hover { color: var(--accent-store); }

#store .eg-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Placeholder that keeps a card the same height whether or not it has a photo,
   so a grid of mixed products does not stagger. */
#store .eg-product-noimage {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.2);
  font-size: 2rem;
}
#store .eg-noimage-large { font-size: 4rem; border-radius: 0.35rem; }
#store .eg-noimage-sm    { width: 60px; height: 60px; font-size: 1.2rem; border-radius: 0.25rem; }

/* ------------------------------------------------------------------
   Catalogue
   ------------------------------------------------------------------ */
#store .eg-member-nudge { margin-bottom: 1.5rem; }

#store .eg-store-filters { position: sticky; top: 1rem; }

#store .eg-cat-list { display: flex; flex-direction: column; gap: 0.15rem; }
#store .eg-cat {
  color: rgba(255, 255, 255, 0.7);
  padding: 0.35rem 0.5rem;
  border-radius: 0.25rem;
  display: flex;
  justify-content: space-between;
}
#store .eg-cat:hover  { background: rgba(255, 255, 255, 0.06); color: #fff; }
#store .eg-cat.active { background: rgba(212, 164, 55, 0.15); color: var(--accent-store); }
#store .eg-cat .eg-count { color: rgba(255, 255, 255, 0.35); font-size: 0.85em; }

#store .eg-product-card { height: 100%; display: flex; flex-direction: column; }
#store .eg-product-card .content { flex: 1 1 auto; }

#store .eg-product-image { position: relative; display: block; overflow: hidden; }
#store .eg-product-image img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform 0.35s ease;
}
#store .eg-product-card:hover .eg-product-image img { transform: scale(1.04); }

#store .eg-badge { position: absolute; top: 0.6rem; left: 0.6rem; }
#store .eg-badge-right { left: auto; right: 0.6rem; }

#store .eg-price { font-size: 1.15em; font-weight: 700; color: var(--accent-store); }
#store .eg-rating { margin-left: 0.75rem; color: rgba(255, 255, 255, 0.6); }

/* An unavailable product stays visible and readable - dimming it to the point
   of illegibility just makes people think the page is broken. */
#store .eg-product-card.is-unavailable .eg-product-image img { opacity: 0.4; }
#store .eg-state-note {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.9em;
  text-align: center;
  padding: 0.4rem 0;
}

#store .eg-pager { margin-top: 2rem; }

/* ------------------------------------------------------------------
   Product detail
   ------------------------------------------------------------------ */
#store .eg-product-title { margin-bottom: 0.35rem; }
#store .eg-rating-row { color: rgba(255, 255, 255, 0.6); margin-bottom: 0.75rem; }

#store .eg-price-block { margin: 1rem 0; }
#store .eg-price-main  { font-size: 2rem; font-weight: 700; color: var(--accent-store); }
#store .eg-price-note  { font-size: 0.85em; color: rgba(255, 255, 255, 0.45); margin-top: 0.25rem; }
#store .eg-price-note a { color: var(--accent-store); }

#store .eg-lede { color: rgba(255, 255, 255, 0.75); font-size: 1.05em; }

#store .eg-gallery-main { position: relative; }
#store .eg-zoom-btn { position: absolute; bottom: 1rem; right: 1rem; opacity: 0.85; }
#store .eg-zoom-btn:hover { opacity: 1; }
#store #egMainImage { cursor: zoom-in; }
#store #egMainImage[data-haszoom="false"] { cursor: default; }

#store .eg-gallery-strip {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
#store .eg-gallery-thumb {
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s ease;
  width: 90px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
#store .eg-gallery-thumb:hover,
#store .eg-gallery-thumb.active { opacity: 1; }
#store .eg-gallery-thumb.active { box-shadow: 0 0 0 2px var(--accent-store); }

/* Variant picker: big enough to hit on a phone, and clearly stateful. */
#store .eg-variant-options { display: flex; flex-wrap: wrap; gap: 0.5rem; }
#store .eg-variant {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.3rem;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  min-width: 5rem;
  text-align: center;
}
#store .eg-variant input { display: none; }
#store .eg-variant:hover { border-color: rgba(255, 255, 255, 0.45); }
#store .eg-variant.selected { border-color: var(--accent-store); background: rgba(212, 164, 55, 0.12); }
#store .eg-variant.is-out { opacity: 0.4; cursor: not-allowed; text-decoration: line-through; }
#store .eg-variant-name { display: block; font-weight: 600; }
#store .eg-variant-note { display: block; font-size: 0.75em; color: rgba(255, 255, 255, 0.5); }
#store .eg-variant-note.eg-low { color: #e0a030; }

#store .eg-qty-row { align-items: flex-end; margin-top: 1.25rem; }
#store .eg-qty-field { max-width: 6rem; }
#store .eg-lowstock-note { color: #e0a030; font-size: 0.9em; margin-top: 0.5rem; }
#store .eg-unavailable, #store .eg-preorder { margin-top: 1rem; }
#store .eg-description { color: rgba(255, 255, 255, 0.75); white-space: pre-line; }

/* ------------------------------------------------------------------
   Cart and checkout
   ------------------------------------------------------------------ */
#store .eg-cart-table td { vertical-align: middle; }

/* Matches .eg-noimage-sm exactly, so a line with a photo and a line without
   line up instead of one being 60px and the other 150px. */
#store .eg-cart-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 0.25rem;
  display: block;
}
#store .eg-cart-name { color: #fff; font-weight: 600; }
#store .eg-cart-name:hover { color: var(--accent-store); }
#store .eg-qty-input input { width: 4.5rem; text-align: center; }

#store .eg-line-out { opacity: 0.5; }
#store .eg-line-note { color: #e06c6c; font-size: 0.85em; margin-top: 0.2rem; }

#store .eg-summary { position: sticky; top: 1rem; }
#store .eg-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  color: rgba(255, 255, 255, 0.8);
}
#store .eg-summary-row.eg-discount { color: #6cbf6c; }
#store .eg-summary-row.eg-total {
  font-size: 1.25em;
  font-weight: 700;
  color: #fff;
}
#store .eg-summary-items { max-height: 16rem; overflow-y: auto; }
#store .eg-summary-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 0;
  font-size: 0.9em;
  color: rgba(255, 255, 255, 0.75);
}

#store .eg-code-form { margin: 1rem 0; }
#store .eg-checkout-btn { margin-top: 0.5rem; }
#store .eg-keep-shopping {
  display: block;
  text-align: center;
  margin-top: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9em;
}

#store .eg-ship-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.3rem;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
}
#store .eg-ship-option:hover { border-color: rgba(255, 255, 255, 0.35); }
#store .eg-ship-option.selected { border-color: var(--accent-store); background: rgba(212, 164, 55, 0.1); }
#store .eg-ship-label { flex: 1 1 auto; }
#store .eg-ship-price { font-weight: 600; color: var(--accent-store); }

/* Square renders the card fields in its own iframe; this only reserves space
   so the layout does not jump when it attaches. */
#store .eg-card-container {
  min-height: 90px;
  margin-bottom: 1rem;
}

#store .eg-pay-error {
  color: #e06c6c;
  min-height: 1.2em;
  margin-bottom: 0.5rem;
  font-size: 0.9em;
}

#store .eg-secure-note {
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8em;
  margin-top: 0.75rem;
}

/* ------------------------------------------------------------------
   Confirmation
   ------------------------------------------------------------------ */
#store .eg-confirm-head { padding: 2.5rem 1rem; margin-bottom: 2rem; }
#store .eg-serial {
  color: var(--accent-store);
  font-size: 0.85em;
  font-variant-numeric: tabular-nums;
}
#store .eg-address { color: rgba(255, 255, 255, 0.75); line-height: 1.6; }

/* ------------------------------------------------------------------
   Full-size viewer
   Never scales past the image's natural size - a "full size" view that
   upscales is exactly what this is meant to avoid.
   ------------------------------------------------------------------ */
#egZoomModal .eg-zoom-content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
#egZoomModal .eg-zoom-img {
  max-width: 96vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.25rem;
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.6);
  cursor: zoom-out;
}
#egZoomModal .eg-zoom-hint {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85em;
  padding-top: 0.6rem;
}

/* ------------------------------------------------------------------
   Small screens
   ------------------------------------------------------------------ */
@media only screen and (max-width: 767px) {
  #store .eg-store-filters,
  #store .eg-summary { position: static; }

  #store .eg-price-main { font-size: 1.6rem; }
  #store .eg-gallery-thumb { width: 70px; }

  /* The image column keeps a sensible height instead of filling the phone. */
  #store .eg-product-detail .eg-gallery-main img { max-height: 60vh; object-fit: contain; }
}
