/* ========================================
   FILE: frontend/css/product.css
   Redesigned product detail page styles
   ======================================== */

.product-page    { padding: 24px 0 80px; }
.product-layout  { display: grid; grid-template-columns: 1fr; gap: 28px; max-width: 760px; margin: 0 auto; }

/* Main image */
.product-main-image { border-radius: 10px; overflow: hidden; background: #f5f5f5; aspect-ratio: 3/4; }
.product-main-image img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.2s ease; }

/* Thumbnails — horizontal strip of 4 */
.product-thumbnails { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.product-thumbnails::-webkit-scrollbar { display: none; }
.product-thumb { flex-shrink: 0; width: 70px; height: 90px; border-radius: 6px; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: #f0f0f0; transition: border-color 0.15s ease; }
.product-thumb.active { border-color: #111; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Title + price */
.product-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.product-title { font-size: 22px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; color: #111; line-height: 1.2; margin-bottom: 0; }
.product-wishlist-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: #111;
  cursor: pointer;
  flex-shrink: 0;
  padding: 2px;
  position: relative;
  z-index: 10;
  pointer-events: all;
  transition: transform 0.15s ease;
}
.product-wishlist-btn:hover { transform: scale(1.15); }
.product-wishlist-btn.active { color: #e8192c; }
.product-wishlist-btn.active i { font-weight: 900; }

.product-price-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.product-compare-price { font-size: 16px; color: #999; text-decoration: line-through; }
.product-sale-price { font-size: 18px; font-weight: 700; color: #e8192c; }
.product-save-badge { background: #e8192c; color: white; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 4px; letter-spacing: 0.04em; }
.product-shipping-note { font-size: 12px; color: #999; margin-bottom: 18px; }
.product-shipping-note span { text-decoration: underline; cursor: pointer; }

/* Guarantee banner */
.product-guarantee { display: flex; align-items: center; gap: 12px; background: #f5f5f5; border-radius: 8px; padding: 14px 18px; margin-bottom: 22px; }
.product-guarantee i { font-size: 22px; color: #111; flex-shrink: 0; }
.product-guarantee strong { font-size: 13px; font-weight: 700; color: #111; margin-right: 6px; }
.product-guarantee span { font-size: 13px; color: #555; }

/* Size selector */
.size-section { margin-bottom: 20px; }
.size-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.size-label { font-size: 13px; font-weight: 700; color: #111; }
.size-measurement-pill { display: inline-flex; align-items: center; gap: 8px; background: white; border: 1px solid #ddd; border-radius: 6px; padding: 5px 12px; font-size: 11px; color: #444; }
.size-measurement-pill i { color: #555; font-size: 12px; }
.size-measurement-sep { color: #ccc; }
.size-guide-link {
  cursor: pointer;
  pointer-events: all;
  position: relative;
  z-index: 5;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 12px;
  color: #555;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
}
.size-guide-link:hover { color: #111; }
.size-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.size-pill { width: 70px; height: 50px; border: 1.5px solid #ddd; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: #111; cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease; background: white; }
.size-pill:hover:not(.unavailable) { border-color: #999; }
.size-pill.selected { border: 2px solid #111; background: white; }
.size-pill.unavailable { opacity: 0.35; text-decoration: line-through; cursor: not-allowed; }

/* Color thumbnails */
.color-section { margin-bottom: 22px; }
.color-label { font-size: 13px; font-weight: 700; color: #111; margin-bottom: 10px; }
.color-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.color-thumb { width: 70px; height: 90px; border-radius: 6px; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: #f0f0f0; transition: border-color 0.15s ease; flex-shrink: 0; }
.color-thumb.selected { border-color: #111; }
.color-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Quantity + CTA */
.product-qty-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.qty-box { display: flex; align-items: center; border: 1.5px solid #ddd; border-radius: 8px; overflow: hidden; }
.qty-box button { width: 44px; height: 50px; background: none; border: none; font-size: 20px; color: #111; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.15s; }
.qty-box button:hover { background: #f5f5f5; }
.qty-box span { width: 44px; text-align: center; font-size: 15px; font-weight: 600; color: #111; }

.btn-add-to-cart { width: 100%; padding: 16px; background: white; border: 1.5px solid #111; color: #111; border-radius: 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; transition: background 0.2s ease, color 0.2s ease; font-family: inherit; }
.btn-add-to-cart:hover { background: #f5f5f5; }

.btn-buy-now { width: 100%; padding: 16px; background: #111; border: none; color: white; border-radius: 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; margin-top: 10px; transition: background 0.2s ease; font-family: inherit; }
.btn-buy-now:hover { background: #333; }

/* Size error */
.size-error-msg { color: #e8192c; font-size: 12px; display: none; margin-top: 6px; }

/* Stock info */
.stock-info { font-size: 12px; color: #999; margin-top: 4px; }

/* Product actions wrapper */
.product-actions { margin-top: 8px; }

/* Accordion */
.accordion-item { border-top: 1px solid #eee; }
.accordion-trigger { width: 100%; padding: 16px 0; background: none; border: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 600; color: #111; font-family: inherit; }
.accordion-trigger .icon { transition: transform 0.2s ease; font-size: 12px; color: #666; }
.accordion-item.open .accordion-trigger .icon { transform: rotate(45deg); }
.accordion-body { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.accordion-body-inner { padding: 0 0 16px; font-size: 13px; color: #555; line-height: 1.6; }

/* Sticky mobile bar */
.product-sticky-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: white;
  border-top: 1px solid #eee;
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  z-index: 200;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
}

@media (min-width: 1024px) {
  .product-layout { grid-template-columns: 55% 1fr; gap: 48px; max-width: var(--max-width); }
  .product-sticky-bar { display: none !important; }
}


/* ── Size Guide Modal ────────────────────────────────────── */
.sg-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 600;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.sg-overlay.open { opacity: 1; pointer-events: all; }

.sg-box {
  background: #fff;
  border-radius: 12px;
  width: 100%; max-width: 860px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s ease;
}
.sg-overlay.open .sg-box {
  transform: translateY(0) scale(1);
}

.sg-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #eee;
  position: sticky; top: 0; background: #fff; z-index: 1;
  border-radius: 12px 12px 0 0;
}
.sg-title {
  font-size: 14px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: #111; text-align: center; flex: 1;
}
.sg-close {
  background: none; border: none; font-size: 20px; color: #555;
  cursor: pointer; padding: 4px 8px; line-height: 1;
  transition: color 0.15s;
}
.sg-close:hover { color: #111; }

.sg-body {
  display: flex; gap: 0;
  min-height: 400px;
}

.sg-img-col {
  width: 35%; flex-shrink: 0;
  background: #f5f5f5;
  border-radius: 0 0 0 12px;
  overflow: hidden;
}
.sg-img-col img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

.sg-content-col {
  flex: 1; padding: 24px;
  overflow-y: auto;
}

.sg-table-heading {
  text-align: center; font-size: 13px; color: #555;
  margin-bottom: 14px;
}

.sg-table {
  width: 100%; border-collapse: collapse;
  margin-bottom: 14px;
  font-size: 13px;
}
.sg-table th, .sg-table td {
  border: 1px solid #e0e0e0;
  padding: 11px 8px;
  text-align: center;
}
.sg-table thead th {
  background: #fff; font-weight: 600; color: #111;
}
.sg-table .sg-label {
  background: #2d3748 !important;
  color: #fff !important;
  font-weight: 700;
}

.sg-tip {
  font-size: 13px; color: #333; margin-bottom: 20px;
  line-height: 1.5;
}

.sg-measure-title {
  font-size: 20px; font-weight: 900; text-align: center;
  color: #111; margin: 0 0 16px; text-transform: uppercase;
  letter-spacing: 0.02em;
}

.sg-measure-text p {
  font-size: 14px; color: #444; line-height: 1.7; margin-bottom: 8px;
}
.sg-final-line {
  font-style: italic; font-weight: 700 !important;
  color: #111 !important; margin-top: 12px !important;
}

.sg-diagram {
  display: flex; justify-content: center;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

@media (max-width: 640px) {
  .sg-body { flex-direction: column; }
  .sg-img-col { width: 100%; height: 220px; border-radius: 0; }
  .sg-content-col { padding: 16px; }
  .sg-table { font-size: 11px; }
  .sg-table th, .sg-table td { padding: 8px 4px; }
}
