/* ===================================================
   BASE & RESET
   =================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --orange:    #FF6900;
  --orange-dk: #e05e00;
  --blue:      #1565c0;
  --blue-lt:   #1976d2;
  --green:     #2e7d32;
  --green-lt:  #43a047;
  --pix:       #32bcad;
  --star:      #f5a623;
  --text:      #333;
  --muted:     #777;
  --border:    #e0e0e0;
  --bg:        #f5f5f5;
  --white:     #fff;
  --radius:    8px;
  --shadow:    0 2px 8px rgba(0,0,0,.10);
  --shadow-lg: 0 4px 20px rgba(0,0,0,.15);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  padding-bottom: 80px; /* sticky bar */
}

a { color: var(--blue-lt); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul { list-style: none; padding: 0; }

/* ===================================================
   HEADER
   =================================================== */
.header {
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}

.header-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-logo { display: flex; align-items: center; }
.header-logo img { height: 38px; width: auto; object-fit: contain; }

.header-icons {
  display: flex;
  gap: 4px;
}
.header-icons button {
  padding: 6px;
  color: var(--text);
}
.header-icons button:hover { color: var(--orange); }
.header-icons svg { width: 22px; height: 22px; }

/* ===================================================
   BREADCRUMB
   =================================================== */
.breadcrumb {
  max-width: 800px;
  margin: 0 auto;
  padding: 10px 16px;
  font-size: .75rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--blue-lt); }
.breadcrumb span:last-child { color: var(--text); font-weight: 500; }

/* ===================================================
   CONTAINER
   =================================================== */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 0 32px;
}

/* ===================================================
   CAROUSEL
   =================================================== */
.carousel-section {
  background: var(--white);
  position: relative;
  overflow: hidden;
}

.carousel {
  position: relative;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}

.carousel-slide {
  min-width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  overflow: hidden;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.85);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.4rem;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  z-index: 2;
  transition: background .2s;
}
.carousel-btn:hover { background: var(--white); }
.carousel-btn-prev { left: 8px; }
.carousel-btn-next { right: 8px; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 0 6px;
  background: var(--white);
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  transition: background .2s, transform .2s;
}
.dot.active { background: var(--orange); transform: scale(1.3); }

.wishlist-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--white);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  z-index: 2;
}
.wishlist-btn svg { width: 18px; height: 18px; }
.wishlist-btn.active svg { fill: #e53935; stroke: #e53935; }

/* ===================================================
   PRODUCT INFO
   =================================================== */
.product-info {
  background: var(--white);
  padding: 16px;
  margin-top: 8px;
}

.rating-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.stars { display: flex; gap: 1px; }
.stars svg { width: 14px; height: 14px; }
.rating-value { font-weight: 700; font-size: .9rem; }
.rating-count { color: var(--muted); font-size: .8rem; }

.product-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: 6px;
}

.sold-by {
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: 14px;
}
.sold-by a { color: var(--blue-lt); font-weight: 500; }

/* Price */
.price-box { margin-bottom: 16px; }

.price-original {
  font-size: .85rem;
  color: var(--muted);
  text-decoration: line-through;
  margin-bottom: 2px;
}

.price-pix-badge {
  display: inline-block;
  background: #e8f5e9;
  color: var(--green);
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.price-pix {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  flex-wrap: wrap;
}
.price-pix .currency { font-size: .9rem; margin-top: 4px; }
.price-pix .value   { font-size: 2rem; }
.price-pix .cents   { font-size: 1.1rem; }
.price-pix .pix-label { font-size: .85rem; font-weight: 400; color: var(--muted); margin-left: 4px; }

.price-installments {
  font-size: .85rem;
  color: var(--text);
  margin-top: 4px;
}

.price-options-link {
  font-size: .8rem;
  color: var(--blue-lt);
  display: inline-block;
  margin-top: 6px;
}

/* Shipping */
.shipping-box {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 16px;
}
.pin-icon { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; }
.shipping-form { flex: 1; }
.shipping-form label { font-size: .8rem; font-weight: 600; color: var(--blue); display: block; margin-bottom: 6px; }
.shipping-input-row { display: flex; gap: 8px; }
.shipping-input-row input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: .85rem;
  outline: none;
}
.shipping-input-row input:focus { border-color: var(--blue-lt); }
.shipping-input-row button {
  background: var(--blue-lt);
  color: var(--white);
  border-radius: 6px;
  padding: 7px 14px;
  font-size: .85rem;
  font-weight: 600;
  transition: background .2s;
}
.shipping-input-row button:hover { background: var(--blue); }
.shipping-result { margin-top: 8px; font-size: .82rem; color: var(--green); min-height: 18px; }

/* CTAs */
.cta-buttons { display: flex; flex-direction: column; gap: 10px; }

.btn-cart {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--white);
  color: var(--orange);
  border: 2px solid var(--orange);
  border-radius: 8px;
  padding: 13px;
  font-size: .95rem;
  font-weight: 700;
  transition: background .2s, color .2s;
}
.btn-cart svg { width: 18px; height: 18px; stroke: var(--orange); }
.btn-cart:hover { background: var(--orange); color: var(--white); }
.btn-cart:hover svg { stroke: var(--white); }

.btn-buy {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--orange);
  color: var(--white);
  border-radius: 8px;
  padding: 13px;
  font-size: .95rem;
  font-weight: 700;
  transition: background .2s;
}
.btn-buy:hover { background: var(--orange-dk); }

/* ===================================================
   GUARANTEES
   =================================================== */
.guarantees {
  background: var(--white);
  margin-top: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.guarantee-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.guarantee-item svg { width: 22px; height: 22px; flex-shrink: 0; margin-top: 2px; }
.guarantee-item strong { font-size: .88rem; display: block; }
.guarantee-item p { font-size: .78rem; color: var(--muted); margin-top: 2px; }

/* ===================================================
   DESCRIPTION
   =================================================== */
.description-section {
  background: var(--white);
  margin-top: 8px;
  padding: 16px;
}
.description-section h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.product-code {
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.description-text {
  font-size: .88rem;
  line-height: 1.65;
  color: var(--text);
  max-height: 160px;
  overflow: hidden;
  transition: max-height .4s ease;
  position: relative;
}
.description-text.expanded { max-height: 9999px; }
.description-text:not(.expanded)::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 48px;
  background: linear-gradient(transparent, var(--white));
}
.description-text p { margin-bottom: 10px; }
.description-text h3 { font-size: .9rem; margin: 14px 0 6px; font-weight: 700; }
.description-text ul { padding-left: 4px; }
.description-text ul li {
  padding: 4px 0 4px 16px;
  position: relative;
  border-bottom: 1px solid var(--bg);
}
.description-text ul li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--orange);
  font-weight: 700;
}

/* Specs table */
.specs-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: .83rem;
}
.specs-table tr:nth-child(even) { background: var(--bg); }
.specs-table th, .specs-table td {
  padding: 7px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.specs-table th {
  font-weight: 600;
  color: var(--muted);
  width: 45%;
}

/* See more button */
.see-more-btn {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 12px;
  color: var(--blue-lt);
  font-size: .85rem;
  font-weight: 600;
  padding: 8px;
  border-radius: 6px;
  transition: background .2s;
}
.see-more-btn:hover { background: #e3f2fd; }

/* ===================================================
   FEATURES GALLERY
   =================================================== */
.features-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
  padding: 0 8px;
}
.feature-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  padding-bottom: 12px;
}
.feature-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}
.feature-card h4 {
  font-size: .78rem;
  font-weight: 700;
  padding: 8px 10px 2px;
  color: var(--text);
}
.feature-card p {
  font-size: .72rem;
  color: var(--muted);
  padding: 0 10px;
  line-height: 1.4;
}

/* ===================================================
   EXTRA IMAGES
   =================================================== */
.extra-images {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
}
.extra-images img {
  border-radius: var(--radius);
  width: 100%;
  object-fit: cover;
  background: var(--white);
}

/* ===================================================
   REVIEWS
   =================================================== */
.reviews-section {
  background: var(--white);
  margin-top: 8px;
  padding: 16px;
}
.reviews-section h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 14px;
}

/* Summary */
.reviews-summary {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.reviews-big-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 80px;
}
.big-number {
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1;
}
.big-stars { display: flex; gap: 2px; }
.big-stars svg { width: 16px; height: 16px; }
.reviews-total { font-size: .8rem; font-weight: 600; }
.reviews-comments { font-size: .75rem; color: var(--muted); }

.reviews-bars { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  color: var(--muted);
}
.bar-row > span:first-child { width: 10px; text-align: right; }
.bar-row > span:last-child  { width: 26px; }
.bar-track {
  flex: 1;
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--star);
  border-radius: 3px;
  transition: width .6s ease;
}

/* Review items */
.reviews-list { display: flex; flex-direction: column; gap: 16px; }

.review-item {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--bg);
}
.review-item:last-child { border-bottom: none; }

.review-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.reviewer-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blue-lt);
  color: var(--white);
  font-weight: 700;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.reviewer-name { font-size: .88rem; font-weight: 600; display: block; }
.review-stars { display: flex; gap: 2px; margin-top: 2px; }
.review-stars svg { width: 13px; height: 13px; }

.review-body { font-size: .85rem; line-height: 1.6; color: var(--text); margin-bottom: 6px; }
.review-date { font-size: .75rem; color: var(--muted); }

/* ===================================================
   STORE INFO
   =================================================== */
.store-info {
  background: var(--white);
  margin-top: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.store-logo img { height: 32px; object-fit: contain; }
.store-details strong { font-size: .9rem; }
.store-details p { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.store-rating-bar {
  height: 10px;
  background: linear-gradient(to right, #f44336, #ffeb3b, #4caf50);
  border-radius: 5px;
  position: relative;
}
.store-rating-fill {
  position: absolute;
  right: 8%;
  top: -4px;
  width: 18px;
  height: 18px;
  background: var(--white);
  border: 2px solid var(--green-lt);
  border-radius: 50%;
}
.store-rating-labels {
  display: flex;
  justify-content: space-between;
  font-size: .7rem;
  color: var(--muted);
}

/* ===================================================
   PAYMENT MODAL
   =================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--white);
  border-radius: 16px 16px 0 0;
  padding: 20px 20px 32px;
  width: 100%;
  max-width: 800px;
  max-height: 92vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  position: relative;
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 1.5rem;
  color: var(--muted);
  line-height: 1;
  padding: 4px 8px;
}
.modal h2 { font-size: 1.1rem; margin-bottom: 4px; }
.modal-product-name { font-size: .82rem; color: var(--muted); margin-bottom: 2px; }
.modal-price { font-size: 1.4rem; font-weight: 700; color: var(--text); margin-bottom: 16px; }

/* Form */
.form-group { margin-bottom: 12px; }
.form-group label { font-size: .8rem; font-weight: 600; color: var(--text); display: block; margin-bottom: 4px; }
.form-group input,
.form-group select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: .9rem;
  outline: none;
  transition: border-color .2s;
  font-family: inherit;
}
.form-group input:focus,
.form-group select:focus { border-color: var(--blue-lt); }

.form-row { display: flex; gap: 10px; }
.form-row .form-group { flex: 1; }

/* Payment method tabs */
.payment-methods { margin: 16px 0; }
.payment-methods h3 { font-size: .9rem; font-weight: 700; margin-bottom: 10px; }
.method-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.method-tab {
  flex: 1;
  padding: 9px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--muted);
  transition: all .2s;
}
.method-tab.active {
  border-color: var(--orange);
  color: var(--orange);
  background: #fff5ee;
}

.method-panel { animation: fadeIn .2s ease; }
.method-panel.hidden { display: none; }

.pix-info {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #e0f2f1;
  border-radius: 8px;
  padding: 14px;
}
.pix-info svg { width: 32px; height: 32px; flex-shrink: 0; }
.pix-info strong { font-size: 1.1rem; }
.pix-discount-label {
  background: #c8e6c9;
  color: var(--green);
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
}
.pix-description { font-size: .78rem; color: var(--muted); margin-top: 2px; }

/* Pay button */
.btn-pay {
  display: block;
  width: 100%;
  background: var(--orange);
  color: var(--white);
  border-radius: 8px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  margin-top: 16px;
  transition: background .2s;
}
.btn-pay:hover { background: var(--orange-dk); }

.secure-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: .75rem;
  color: var(--muted);
  margin-top: 10px;
}
.secure-label svg { width: 14px; height: 14px; }

/* Payment states */
.payment-loading,
.payment-success { text-align: center; padding: 40px 20px; }

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--border);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto 16px;
}

.payment-success svg { width: 64px; height: 64px; margin: 0 auto 16px; }
.payment-success h3 { font-size: 1.2rem; margin-bottom: 6px; color: var(--green); }
.payment-success p { font-size: .88rem; color: var(--muted); }

/* ===================================================
   STICKY BOTTOM BAR
   =================================================== */
.sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 -2px 12px rgba(0,0,0,.08);
}
.sticky-price { display: flex; flex-direction: column; }
.sticky-pix { font-size: 1rem; font-weight: 700; }
.sticky-installments { font-size: .72rem; color: var(--muted); }
.sticky-buy {
  flex: 1;
  max-width: 220px;
  padding: 12px;
  font-size: .9rem;
}

/* ===================================================
   UTILITIES
   =================================================== */
.hidden { display: none !important; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===================================================
   DESKTOP ADJUSTMENTS
   =================================================== */
@media (min-width: 640px) {
  .container { padding: 0 16px 32px; }

  .carousel-section {
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 8px;
    box-shadow: var(--shadow);
  }
  .carousel-slide { aspect-ratio: 16/9; }

  .product-info { border-radius: var(--radius); box-shadow: var(--shadow); margin-top: 8px; }
  .guarantees   { flex-direction: row; border-radius: var(--radius); box-shadow: var(--shadow); margin-top: 8px; }
  .description-section { border-radius: var(--radius); box-shadow: var(--shadow); margin-top: 8px; }
  .reviews-section { border-radius: var(--radius); box-shadow: var(--shadow); margin-top: 8px; }
  .store-info { border-radius: var(--radius); box-shadow: var(--shadow); margin-top: 8px; }

  .features-gallery { grid-template-columns: repeat(4, 1fr); padding: 0; margin-top: 8px; }

  .modal {
    border-radius: 12px;
    align-self: center;
    max-height: 90vh;
  }
  .modal-overlay { align-items: center; }

  body { padding-bottom: 0; }
  .sticky-bar { display: none; }

  .cta-buttons { flex-direction: row; }
  .btn-cart, .btn-buy { flex: 1; }
}
