/* ==========================================================================
   LAZADA / SHOPEE MOBILE PDP STYLESHEET
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap');

:root {
  --color-primary: #f53d2d; /* Lazada Pink/Red */
  --color-lazada: #0f136d; 
  --color-bg-gray: #f5f5f5;
  --color-text-main: #222;
  --color-text-sub: #757575;
  --color-white: #fff;
  --color-border: #f0f0f0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: #e5e5e5;
  color: var(--color-text-main);
  line-height: 1.4;
}

/* Mobile App Container Constraint */
.app-layout {
  max-width: 500px;
  margin: 0 auto;
  background-color: var(--color-bg-gray);
  min-height: 100vh;
  position: relative;
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
  overflow-x: hidden;
}

/* Common Section Block */
.section-block {
  background-color: var(--color-white);
  margin-bottom: 8px;
  padding: 12px;
}

/* 1. Header Transparent */
.app-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 15px;
  z-index: 10;
}

.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.4);
  color: white;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.1rem;
  cursor: pointer;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.badge-wrapper {
  position: relative;
}

.cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: var(--color-primary);
  color: white;
  font-size: 0.6rem;
  font-weight: bold;
  padding: 2px 5px;
  border-radius: 10px;
  border: 1px solid white;
}

/* 2. Gallery */
.product-gallery {
  width: 100%;
  position: relative;
  background-color: white;
}

.gallery-container {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none; /* Hide Firefox scrollbar */
  -ms-overflow-style: none; /* Hide IE scrollbar */
}

.gallery-container::-webkit-scrollbar {
  display: none; /* Hide Webkit scrollbar */
}

.gallery-item {
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: start;
}

.gallery-item img, .gallery-item video {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  display: block;
}

.gallery-counter {
  position: absolute;
  bottom: 15px;
  right: 15px;
  background-color: rgba(0,0,0,0.4);
  color: white;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
}

/* 3. Product Info */
.product-info-block {
  padding-top: 15px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.price-main {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.price-current {
  color: var(--color-primary);
  font-size: 1.8rem;
  font-weight: 700;
}

.price-old {
  color: var(--color-text-sub);
  text-decoration: line-through;
  font-size: 0.9rem;
}

.discount-badge {
  background-color: #feebe8;
  color: var(--color-primary);
  font-size: 0.75rem;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 500;
}

.action-icons i {
  font-size: 1.4rem;
  color: var(--color-text-sub);
}

.product-title {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mall-badge {
  background-color: #d1121d;
  color: white;
  font-size: 0.65rem;
  padding: 2px 4px;
  border-radius: 2px;
  font-weight: bold;
  vertical-align: middle;
  margin-right: 4px;
}

.product-stats {
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  color: var(--color-text-sub);
}

.rating {
  display: flex;
  align-items: center;
  color: #ffc107;
}

.rating span {
  color: var(--color-text-sub);
  margin-left: 5px;
}

.sold-count {
  margin-left: 8px;
}

/* 4. Promo Row (Voucher, Variant, Shipping) */
.promo-row {
  display: flex;
  align-items: flex-start;
  font-size: 0.9rem;
}

.promo-label {
  color: var(--color-text-sub);
  width: 100px;
  flex-shrink: 0;
}

.voucher-tags {
  flex-grow: 1;
  display: flex;
  gap: 8px;
}

.tag-outline {
  border: 1px solid #f5a623;
  color: #f5a623;
  background-color: #fff9ed;
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 0.75rem;
}

.arrow-icon {
  color: #ccc;
  font-size: 0.9rem;
  margin-top: 2px;
}

.variant-block {
  cursor: pointer;
}

.selected-variant {
  flex-grow: 1;
  color: var(--color-text-main);
  font-weight: 500;
}

.variant-thumbnails {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  padding-left: 100px;
}

.variant-thumb-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 4px;
  background-color: var(--color-white);
  width: 50px;
}

.variant-thumb-item.active {
  border-color: var(--color-primary);
}

.variant-thumb-item img {
  width: 36px;
  height: 36px;
  border-radius: 2px;
  object-fit: cover;
  border: none;
}

.variant-thumb-item span {
  font-size: 0.65rem;
  color: var(--color-text-main);
  margin-top: 2px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.shipping-info {
  flex-grow: 1;
}

.shipping-info p {
  color: var(--color-text-main);
  margin-bottom: 2px;
}

.shipping-info .sub-text {
  color: var(--color-text-sub);
  font-size: 0.8rem;
}

/* 5. Shop Info */
.shop-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shop-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
}

.shop-name {
  flex-grow: 1;
}

.shop-name h4 {
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

.official-badge {
  color: #0f136d;
}

.shop-name p {
  font-size: 0.75rem;
  color: var(--color-text-sub);
  margin-top: 2px;
}

.btn-visit-shop {
  background: none;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  padding: 4px 12px;
  border-radius: 2px;
  font-size: 0.85rem;
  cursor: pointer;
}

/* 6. Reviews */
.reviews-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.reviews-header h4 {
  font-size: 0.95rem;
}

.view-all {
  color: var(--color-primary);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

.rating-summary {
  margin-bottom: 15px;
}

.rating-score .big-score {
  font-size: 1.5rem;
  font-weight: bold;
}

.rating-score .stars {
  color: #ffc107;
  font-size: 0.8rem;
  display: inline-block;
  margin-left: 5px;
}

.review-images {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.review-img-box {
  position: relative;
  width: 80px;
  flex-shrink: 0;
}

.review-img-box img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
}

.review-user {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0,0,0,0.5);
  color: white;
  font-size: 0.6rem;
  text-align: center;
  padding: 2px 0;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}

.review-item {
  border-top: 1px solid #f2f2f2;
  padding: 16px 0;
}

.review-item:last-child {
  padding-bottom: 0;
}

.reviewer {
  font-size: 0.85rem;
  color: #222;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  font-weight: 500;
}

.reviewer i {
  font-size: 1.1rem;
  margin-right: 6px;
  color: #555;
}

.verified-purchase {
  color: #1eb858;
  font-size: 0.7rem;
  margin-left: 8px;
  font-weight: 400;
}

.review-item .stars {
  color: #000;
  font-size: 0.85rem;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.review-text {
  font-size: 0.9rem;
  margin: 0 0 8px 0;
  line-height: 1.5;
  color: #333;
}

.review-meta {
  font-size: 0.75rem;
  color: #888;
}

/* 7. Details */
.section-title {
  font-size: 1rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.details-content {
  font-size: 0.95rem;
  color: #444;
}

.details-content p {
  margin-bottom: 10px;
}

.details-content img {
  width: 100%;
  border-radius: 4px;
  margin-bottom: 10px;
}

.details-content ul {
  padding-left: 20px;
  margin-bottom: 10px;
}

.details-content li {
  margin-bottom: 5px;
}

/* 8. Sticky Bottom Bar */
.bottom-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: white;
  display: flex;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  z-index: 99;
}

/* Inside app-layout limit */
@media (min-width: 501px) {
  .bottom-action-bar {
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
  }
}

.action-btn-small {
  flex: 1;
  background: white;
  border: none;
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  color: var(--color-text-main);
  cursor: pointer;
}

.action-btn-small i {
  font-size: 1.2rem;
  color: var(--color-text-sub);
}

.action-btn-small span {
  font-size: 0.65rem;
}

.action-btn-large {
  flex: 2;
  border: none;
  color: white;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.btn-add-cart {
  background-color: #ffb500; /* Shopee Cart / Lazada Add to Cart */
}

.btn-buy-now {
  background-color: var(--color-primary); /* Lazada Pink/Red */
}

/* 9. BOTTOM SHEET (Lead Gen Checkout) */
.bottom-sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
}

.bottom-sheet-overlay.active {
  opacity: 1;
  visibility: visible;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: white;
  z-index: 1001;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  transform: translateY(calc(100% + 50px));
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

@media (min-width: 501px) {
  .bottom-sheet {
    left: 50%;
    margin-left: -250px;
    width: 500px;
  }
}

.bottom-sheet.active {
  transform: translateY(0);
}

.sheet-header {
  padding: 15px;
  display: flex;
  gap: 15px;
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

.sheet-img {
  width: 80px;
  height: 80px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid #ddd;
  margin-top: -30px; /* Overlap effect like Shopee */
  background: white;
}

.sheet-info {
  flex-grow: 1;
}

.sheet-price {
  color: var(--color-primary);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.sheet-stock, .sheet-selected {
  font-size: 0.8rem;
  color: var(--color-text-sub);
}

.btn-close-sheet {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--color-text-sub);
  cursor: pointer;
}

.sheet-body {
  padding: 15px;
  overflow-y: auto;
}

.variant-selector h4, .quantity-selector h4 {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 10px;
}

.variant-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.variant-btn {
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  background: var(--color-bg-gray);
  color: var(--color-text-main);
  transition: 0.2s;
}

.variant-btn.active {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(245, 61, 45, 0.05);
}

.quantity-selector {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.qty-controls {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
}

.qty-controls button {
  width: 32px;
  height: 32px;
  background: white;
  border: none;
  cursor: pointer;
  color: var(--color-text-sub);
}

.qty-controls span {
  width: 40px;
  text-align: center;
  font-size: 0.9rem;
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  line-height: 32px;
}

/* Checkout Form Input */
.input-row {
  display: flex;
  gap: 10px;
}

.input-row input {
  flex: 1;
}

.checkout-form input {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
}

.checkout-form input:focus {
  border-color: var(--color-primary);
}

.btn-confirm-order {
  width: 100%;
  padding: 14px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: bold;
  margin-top: 15px;
  cursor: pointer;
}

/* Toast Notification */
.toast-msg {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 15px 25px;
  border-radius: 8px;
  font-size: 0.95rem;
  z-index: 9999;
  text-align: center;
  opacity: 0;
  transition: 0.3s;
  pointer-events: none;
}
.toast-msg.show {
  opacity: 1;
}

/* 10. Fullscreen Viewer */
.fullscreen-viewer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: black;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
}

.fullscreen-viewer.active {
  opacity: 1;
  visibility: visible;
}

.btn-close-fullscreen {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.viewer-content {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.viewer-content img, .viewer-content video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
