/* ==========================================================================
   MIYA Kids Fashion - Dedicated Product Detail Page Styles
   Optimized for High Conversion, Mobile Performance & SEO
   ========================================================================== */

:root {
  --primary: #f97316;
  --primary-hover: #ea580c;
  --primary-light: #fff7ed;
  --primary-border: #fed7aa;
  --whatsapp: #25d366;
  --whatsapp-hover: #22bf5b;
  --dark: #0f172a;
  --text-muted: #64748b;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 35px -10px rgba(15, 23, 42, 0.12);
}

body.product-page-body {
  background-color: var(--bg-page);
  color: var(--dark);
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  margin: 0;
  padding-bottom: 90px; /* Space for mobile sticky bar */
}

@media (min-width: 992px) {
  body.product-page-body {
    padding-bottom: 40px;
  }
}

/* --- Top Announcement Bar --- */
.product-top-bar {
  background: linear-gradient(90deg, #ea580c, #f97316);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 16px;
  text-align: center;
  letter-spacing: 0.3px;
}

/* --- Navigation Header --- */
.product-nav-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 12px 20px;
}

.product-nav-container {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.product-nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.product-nav-logo img {
  height: 42px;
  width: auto;
  object-fit: contain;
}

.product-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  transition: all 0.2s ease;
}

.product-nav-btn:hover {
  background: #f1f5f9;
  color: var(--primary);
  border-color: #cbd5e1;
}

.product-nav-btn.btn-cart-nav {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-border);
  position: relative;
}

.product-nav-btn.btn-cart-nav .cart-badge {
  background: var(--primary);
  color: white;
  border-radius: 9999px;
  font-size: 0.72rem;
  padding: 2px 6px;
  margin-left: 2px;
}

/* --- Breadcrumbs --- */
.product-breadcrumbs {
  max-width: 1240px;
  margin: 16px auto 0;
  padding: 0 20px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.product-breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.product-breadcrumbs a:hover {
  color: var(--primary);
}

.product-breadcrumbs .sep {
  font-size: 0.7rem;
  color: #94a3b8;
}

.product-breadcrumbs .active {
  color: #0f172a;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

/* --- Main Layout Grid --- */
.product-main-container {
  max-width: 1240px;
  margin: 20px auto;
  padding: 0 20px;
}

.product-layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 992px) {
  .product-layout-grid {
    grid-template-columns: 1.05fr 1fr;
    gap: 48px;
  }
}

/* --- Left Column: Gallery --- */
.product-gallery-wrap {
  position: relative;
}

@media (min-width: 992px) {
  .product-gallery-wrap {
    position: sticky;
    top: 90px;
  }
}

.product-main-img-box {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: #f1f5f9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid #e2e8f0;
}

.product-main-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product-main-img-box:hover img {
  transform: scale(1.03);
}

.product-badge-stack {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 2;
}

.product-tag-badge {
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.product-tag-badge.badge-sale {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.product-tag-badge.badge-trending {
  background: #f59e0b;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

.product-tag-badge.badge-stock {
  background: #10b981;
  color: #ffffff;
}

.product-thumbnails-row {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.product-thumb-btn {
  width: 76px;
  height: 90px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  padding: 0;
  background: #e2e8f0;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
}

.product-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-thumb-btn.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

/* --- Right Column: Details --- */
.product-info-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.product-category-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.84rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 9999px;
  width: fit-content;
  border: 1px solid var(--primary-border);
}

.product-headline-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--dark);
  margin: 0;
}

@media (min-width: 768px) {
  .product-headline-title {
    font-size: 2.2rem;
  }
}

.product-rating-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.product-stars {
  color: #f59e0b;
  display: flex;
  gap: 2px;
}

.product-review-count {
  color: var(--text-muted);
  font-weight: 600;
}

/* Pricing Card */
.product-pricing-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
}

.product-price-current {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 900;
  color: #0f172a;
}

.product-price-original {
  font-size: 1.2rem;
  color: #94a3b8;
  text-decoration: line-through;
  font-weight: 600;
}

.product-price-save-badge {
  background: #dcfce7;
  color: #15803d;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid #bbf7d0;
}

.product-pricing-note {
  width: 100%;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: -4px;
}

/* Variants: Colors */
.variant-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.variant-label {
  font-size: 0.92rem;
  font-weight: 800;
  color: #1e293b;
}

.color-swatches-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.color-swatch-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  border-radius: 9999px;
  border: 2px solid #e2e8f0;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.88rem;
  font-weight: 700;
  color: #334155;
}

.color-swatch-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.color-swatch-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

/* Variants: Age / Sizes */
.size-pills-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.size-pill-btn {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  font-weight: 800;
  font-size: 0.95rem;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 64px;
}

.size-pill-btn:hover {
  border-color: var(--primary);
}

.size-pill-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.size-pill-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: line-through;
  background: #f1f5f9;
  border-color: #e2e8f0;
}

/* Action Buttons Container */
.product-cta-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.btn-whatsapp-order {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--whatsapp);
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 800;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn-whatsapp-order:hover {
  background: var(--whatsapp-hover);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45);
}

.btn-add-cart-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--primary);
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 800;
  padding: 15px 24px;
  border-radius: var(--radius-md);
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.3);
  transition: all 0.2s ease;
}

.btn-add-cart-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.4);
}

.btn-open-app-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #ffffff;
  color: #334155;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  text-decoration: none;
  border: 1px solid #cbd5e1;
  transition: all 0.2s ease;
}

.btn-open-app-outline:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: var(--primary);
}

/* Trust Badges Grid */
.product-trust-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  background: #ffffff;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trust-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.trust-text h4 {
  font-size: 0.86rem;
  font-weight: 800;
  margin: 0;
  color: #1e293b;
}

.trust-text p {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin: 2px 0 0;
}

/* Details Tabs / Accordions */
.product-tabs-section {
  max-width: 1240px;
  margin: 40px auto;
  padding: 0 20px;
}

.product-tab-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
  padding: 28px;
}

.product-tab-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0 0 16px;
  color: #0f172a;
}

.product-desc-content {
  font-size: 0.98rem;
  line-height: 1.7;
  color: #334155;
}

.product-desc-content ul {
  padding-left: 20px;
  margin: 14px 0;
}

.product-desc-content li {
  margin-bottom: 8px;
}

/* Related Outfits Section */
.product-related-section {
  max-width: 1240px;
  margin: 40px auto;
  padding: 0 20px;
}

.related-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.related-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (min-width: 768px) {
  .related-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
}

/* Sticky Bottom Mobile Bar */
.product-mobile-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid #e2e8f0;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 99;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
}

@media (min-width: 992px) {
  .product-mobile-bottom-bar {
    display: none;
  }
}

.mobile-bar-price-wrap {
  display: flex;
  flex-direction: column;
}

.mobile-bar-price {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 900;
  color: #0f172a;
}

.mobile-bar-orig {
  font-size: 0.8rem;
  text-decoration: line-through;
  color: #94a3b8;
}

.mobile-bar-actions {
  display: flex;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
}

.mobile-bar-wa-btn {
  background: var(--whatsapp);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.mobile-bar-cart-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

/* Toast Message */
.miya-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0f172a;
  color: white;
  padding: 12px 24px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
}

.miya-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
