/* ============================================
   COD Store — Mobile-First Responsive Styles
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: #1a1a2e;
  background: #ffffff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; font: inherit; }
input { font: inherit; }

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* --- Announcement Bar --- */
.announcement-bar {
  background: #000;
  color: #fff;
  text-align: center;
  padding: 10px 0;
  font-size: 0.88rem;
  font-weight: 500;
  position: sticky;
  top: 0;
  z-index: 110;
}

.announcement-bar p { margin: 0; }

.announcement-bar strong {
  color: #ffd700;
  font-weight: 800;
}

/* --- Header --- */
.header {
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  padding: 14px 0;
  position: sticky;
  top: 38px;
  z-index: 100;
  transition: transform 0.3s ease;
}

.header.hidden {
  transform: translateY(-150%);
}

.header .container {
  display: flex;
  justify-content: center;
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: #e74c3c;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.logo-img {
  max-height: 40px;
  max-width: 160px;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}

/* --- Product Layout (mobile = single column) --- */
.product-page { padding: 20px 0; }

.product-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* --- Gallery --- */
.main-image {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e9ecef;
}

.main-image img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.thumbnails {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.thumb {
  width: 68px;
  height: 68px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s;
}

.thumb.active,
.thumb:hover {
  border-color: #e74c3c;
}

/* --- Product Tags --- */
.product-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.tag-new {
  background: #e8f5e9;
  color: #27ae60;
}

.tag-discount {
  background: #fde8e8;
  color: #e74c3c;
}

/* --- Product Info --- */
.product-title {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.3;
  color: #1a1a2e;
}

.rating-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 0.9rem;
}

.stars { color: #f39c12; font-size: 1.05rem; letter-spacing: 1px; }
.rating-value { font-weight: 700; }
.review-count { color: #6c757d; }
.rating-sep { color: #adb5bd; }
.sales-count { color: #1a1a2e; font-weight: 700; }

.price-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 12px;
}

.price-compare {
  text-decoration: line-through;
  color: #666666;
  font-size: 1rem;
  font-weight: 500;
}

.price-current {
  font-size: 1.6rem;
  font-weight: 800;
  color: #dc2626;
  line-height: 1;
}

.product-description {
  margin-top: 12px;
  color: #495057;
  font-size: 0.95rem;
  line-height: 1.7;
}

/* --- Features --- */
.features-list {
  list-style: none;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.features-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #2d3436;
}

.feature-emoji { font-size: 1.2rem; }

/* --- Order Section (bordered) --- */
.order-section {
  margin-top: 24px;
  border: 2px solid #e74c3c;
  border-radius: 14px;
  padding: 20px 16px;
  background: #fff;
}

.section-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 14px;
  text-align: center;
}

/* --- Bundles --- */
.bundles { display: flex; flex-direction: column; gap: 10px; }

.bundle-wrap { position: relative; }

.bundle-wrap.has-popular-badge { margin-top: 10px; }

.popular-badge {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  background: #E84B3A;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 2;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.bundle-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  background: #fff;
}

.bundle-card:hover { border-color: #ccc; }

.bundle-card.selected {
  border-color: #e74c3c;
  background: #fff5f5;
}

.bundle-radio {
  width: 20px;
  height: 20px;
  accent-color: #e74c3c;
  flex-shrink: 0;
}

.bundle-body {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.bundle-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.bundle-name {
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
}

.bundle-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.bundle-pricing {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  margin-inline-start: auto;
}

.old-price {
  text-decoration: line-through;
  color: #adb5bd;
  font-size: 0.8rem;
  line-height: 1.2;
}

.new-price {
  font-weight: 800;
  font-size: 1.1rem;
  color: #1a1a2e;
  line-height: 1.2;
}

/* --- Urgency --- */
.urgency-bar {
  margin-top: 16px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 10px;
  padding: 12px 14px;
}

.countdown-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
}

.urgency-icon { font-size: 1.2rem; }
.countdown-label { color: #6c757d; }

.countdown-timer {
  color: #e74c3c;
  font-weight: 800;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

.stock-warning {
  margin-top: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #e74c3c;
}

.stock-bar {
  margin-top: 6px;
  height: 6px;
  background: #ffccbc;
  border-radius: 3px;
  overflow: hidden;
}

.stock-fill {
  height: 100%;
  width: 18%;
  background: #e74c3c;
  border-radius: 3px;
  animation: pulse-stock 2s infinite;
}

@keyframes pulse-stock {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* --- Order Form --- */
.order-form { margin-top: 18px; }

.form-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 14px;
  text-align: center;
}

.form-group { margin-bottom: 12px; }

.input-wrap {
  display: flex;
  align-items: center;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.2s;
  overflow: hidden;
}

.input-wrap:focus-within {
  border-color: #e74c3c;
}

.input-wrap.error {
  border-color: #e74c3c;
  background: #fff5f5;
}

.input-emoji {
  padding-inline-start: 14px;
  font-size: 1.15rem;
  flex-shrink: 0;
  line-height: 1;
}

.input-wrap input {
  width: 100%;
  padding: 14px 14px;
  border: none;
  font-size: 1rem;
  background: transparent;
  outline: none;
}

.field-error {
  display: none;
  color: #e74c3c;
  font-size: 0.8rem;
  margin-top: 4px;
  padding-inline-start: 4px;
}

.field-error.visible {
  display: block;
}

/* --- CTA Button --- */
.cta-button {
  width: 100%;
  padding: 16px 24px;
  background: #e74c3c;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
  border: none;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
  transition: background 0.2s, transform 0.1s;
  box-shadow: 0 4px 14px rgba(231, 76, 60, 0.35);
}

.cta-button--main {
  flex-direction: column;
  gap: 4px;
  padding: 14px 24px;
}

.cta-main-text {
  font-size: 1.15rem;
  font-weight: 800;
}

.cta-sub-text {
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.9;
}

.cta-button:hover { background: #c0392b; }
.cta-button:active { transform: scale(0.98); }

.cta-button.loading {
  pointer-events: none;
  opacity: 0.7;
}

/* --- Trust Badges --- */
.trust-badges {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  gap: 8px;
  margin-top: 16px;
}

.trust-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #1a1a2e;
  padding: 8px 4px;
  flex: 1;
}

.trust-icon { font-size: 1.4rem; }

/* --- Product Description (rich HTML from admin editor) --- */
.product-description-section {
  padding: 8px 0 10px;
  background: #fff;
}

.product-description-inline {
  margin-top: 20px;
}

.description-content {
  margin-top: 0;
  color: #2d3436;
  font-size: 15px;
  line-height: 1.7;
}

.description-content img,
.description-content video,
.description-content iframe {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  margin: 16px auto;
}

.description-content h1,
.description-content h2,
.description-content h3,
.description-content h4 {
  color: #1a1a2e;
  margin-top: 24px;
  margin-bottom: 10px;
  line-height: 1.3;
}

.description-content h1 { font-size: 1.5rem; }
.description-content h2 { font-size: 1.3rem; }
.description-content h3 { font-size: 1.15rem; }
.description-content h4 { font-size: 1.05rem; }

.description-content p { margin: 10px 0; }

.description-content ul,
.description-content ol {
  padding-inline-start: 22px;
  margin: 10px 0;
}

.description-content li { margin: 6px 0; }

.description-content a {
  color: #7C3AED;
  text-decoration: underline;
}

.description-content blockquote {
  border-inline-start: 3px solid #7C3AED;
  margin: 16px 0;
  padding: 4px 14px;
  color: #495057;
  background: #f8f7ff;
  border-radius: 4px;
}

.description-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.description-content table th,
.description-content table td {
  border: 1px solid #e6e8eb;
  padding: 8px 12px;
  text-align: start;
}

.description-content table th {
  background: #f6f8fa;
  font-weight: 700;
}

.description-content pre {
  background: #1e1e1e;
  color: #e4e4e7;
  padding: 14px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 13px;
}

.description-content code {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, monospace;
}

/* --- Reviews --- */
.reviews-section {
  padding: 40px 0;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 6px;
}

.section-subtitle {
  text-align: center;
  color: #6c757d;
  font-size: 0.92rem;
  margin-bottom: 24px;
}

.reviews-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.review-card {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #e9ecef;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-stars { color: #f39c12; font-size: 0.9rem; letter-spacing: 1px; }
.review-text { color: #495057; font-size: 0.92rem; line-height: 1.6; flex: 1; }

.review-footer {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reviewer-avatar {
  width: 40px;
  height: 40px;
  background: #f0a0a0;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.reviewer-name { font-weight: 700; font-size: 0.9rem; }
.reviewer-location { color: #6c757d; font-size: 0.78rem; }
.verified-badge { color: #27ae60; font-size: 0.75rem; font-weight: 600; }

/* --- FAQ --- */
.faq-section {
  padding: 40px 0;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 700px;
  margin: 0 auto;
}

.faq-item {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 16px;
  background: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: start;
  color: #1a1a2e;
}

.faq-arrow {
  font-size: 0.7rem;
  transition: transform 0.3s;
  color: #6c757d;
}

.faq-item.open .faq-arrow { transform: rotate(180deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.open .faq-answer {
  max-height: 300px;
}

.faq-answer p {
  padding: 0 16px 16px;
  color: #495057;
  font-size: 0.9rem;
  line-height: 1.7;
}

/* --- Footer --- */
.footer {
  background: #1a1a2e;
  color: #adb5bd;
  padding: 30px 0;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.88rem;
  transition: color 0.2s;
}

.footer-links a:hover { color: #fff; }

.footer-copy {
  font-size: 0.8rem;
  opacity: 0.7;
}

/* --- Sticky CTA --- */
.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  padding: 10px 16px;
  border-top: 1px solid #e9ecef;
  z-index: 200;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}

.sticky-cta.visible {
  transform: translateY(0);
}

.sticky-cta-btn {
  max-width: 600px;
  margin: 0 auto;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  padding: 20px;
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  max-width: 380px;
  width: 100%;
  transform: scale(0.9);
  transition: transform 0.3s;
}

.modal-overlay.visible .modal-box {
  transform: scale(1);
}

.modal-icon { font-size: 3rem; margin-bottom: 12px; }
.modal-message { font-size: 1rem; font-weight: 600; color: #1a1a2e; margin-bottom: 20px; }

.modal-close {
  padding: 10px 40px;
  background: #e74c3c;
  color: #fff;
  font-weight: 700;
  border-radius: 8px;
  font-size: 1rem;
}

/* ============================================
   Desktop (min-width: 768px)
   ============================================ */
@media (min-width: 768px) {
  .container { padding: 0 24px; }

  .product-layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 40px;
  }

  .product-gallery {
    flex: 1;
    position: sticky;
    top: 118px;
  }

  .product-info { flex: 1; }

  .product-title { font-size: 1.6rem; }

  .thumbnails { justify-content: flex-start; }

  .thumb { width: 80px; height: 80px; }

  .trust-badges {
    flex-direction: row;
    justify-content: center;
  }

  .reviews-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .sticky-cta { display: none; }
}
