/* Noon-style Product Page Specifics */
:root {
  --noon-yellow: #FEE500;
  --noon-black: #404553;
  --noon-blue: #3866DF;
  --noon-gray-bg: #F7F7FA;
  --noon-text-gray: #7E859B;
  --noon-border: #E2E5F1;
  /* Product Card Vars */
  --ribbon-bg: #FFF7D6;
  --ribbon-text: #2A2727;
  --mega-bg: #facc15;
  --mega-text: #2A2727;
  --main-blue: #3866DF;
}

body {
  background-color: var(--noon-gray-bg);
  color: var(--noon-black);
  font-family: 'Proxima Nova', 'Inter', sans-serif; /* Fallback to Inter if Proxima not available */
}

.main-container {
  max-width: 95%; /* Increased width */
  margin: 0 auto;
  padding: 0 32px; /* Adjusted padding */
}

@media (max-width: 1024px) {
  .main-container {
    padding: 0 16px;
  }
}

/* Breadcrumbs */
.breadcrumb {
  font-size: 12px;
  color: var(--noon-text-gray);
  padding: 16px 0;
}
.breadcrumb a {
  color: var(--noon-text-gray);
  text-decoration: none;
}
.breadcrumb a:hover {
  text-decoration: underline;
}

/* Product Layout Grid */
.product-grid {
  display: grid;
  grid-template-columns: 1fr 340px; /* Main content vs Buy Box */
  gap: 24px;
  align-items: start;
}

@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}

.product-main-content {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  display: grid;
  grid-template-columns: 50% 50%; /* Image vs Details */
}

@media (max-width: 768px) {
  .product-main-content {
    grid-template-columns: 1fr;
  }
}

/* Image Gallery - Thumbnails Below */
.gallery-container {
  padding: 16px;
  display: flex;
  flex-direction: column; /* Stack vertically */
  gap: 16px;
  height: auto;
}

.main-image-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 400px;
}

.thumbnails-strip {
  display: flex;
  flex-direction: row; /* Horizontal strip */
  gap: 12px;
  width: 100%;
  overflow-x: auto;
  justify-content: center;
  padding-bottom: 4px;
}

.thumbnail {
  width: 60px;
  height: 60px;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.7;
  transition: all 0.2s;
}

.thumbnail:hover, .thumbnail.active {
  border-color: var(--noon-blue);
  opacity: 1;
}

/* Product Details - Center */
.product-details-area {
  padding: 24px;
  border-left: 1px solid var(--noon-border);
}

.brand-link {
  color: var(--noon-text-gray);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  display: block;
}

.product-title {
  font-size: 22px;
  font-weight: 400; /* Noon uses regular weight often for titles */
  line-height: 1.4;
  color: var(--noon-black);
  margin-bottom: 12px;
}

.model-number {
  font-size: 12px;
  color: var(--noon-text-gray);
  margin-bottom: 12px;
}

.rating-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.rating-badge {
  background: #38AE04; /* Green rating */
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.rating-count {
  font-size: 13px;
  color: var(--noon-text-gray);
}

.price-section {
  margin-bottom: 24px;
}

.current-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--noon-black);
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.currency {
  font-size: 14px;
  font-weight: 400;
}

.vat-text {
  font-size: 12px;
  color: var(--noon-text-gray);
  margin-left: 4px;
}

.old-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 14px;
}

.old-price {
  text-decoration: line-through;
  color: var(--noon-text-gray);
}

.discount-badge {
  color: #38AE04;
  font-weight: 700;
  background: #EBF8E7;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.noon-express-badge {
  background-color: var(--noon-yellow);
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 4px;
  font-style: italic;
  font-weight: 800;
  font-size: 11px;
  gap: 4px;
  margin-bottom: 16px;
}

.noon-express-logo {
  height: 14px;
  width: auto;
}

/* Buy Box - Right Side */
.buy-box {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  padding: 16px;
  position: sticky;
  top: 16px;
}

.delivery-info {
  margin-bottom: 16px;
  font-size: 14px;
}

.delivery-date {
  font-weight: 700;
  color: #262626;
}

.delivery-subtext {
  color: var(--noon-text-gray);
  font-size: 12px;
}

.quantity-selector {
  margin-bottom: 16px;
}

.qty-dropdown {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--noon-border);
  border-radius: 4px;
  background: #fff;
  font-size: 14px;
  color: var(--noon-black);
  cursor: pointer;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-add-to-cart {
  background-color: var(--noon-blue, #3866DF); /* Fallback to Blue */
  color: #fff;
  font-weight: 700;
  border: none;
  padding: 12px;
  border-radius: 12px; /* Updated to match Buy Now rounded-xl */
  width: 100%;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s;
  display: block; /* Ensure it's block */
  text-align: center;
}

.btn-add-to-cart:hover {
  background-color: #2E54B5;
}

.btn-buy-now {
  background-color: #fff;
  color: var(--noon-blue, #3866DF); /* Fallback */
  font-weight: 700;
  border: 1px solid var(--noon-blue, #3866DF); /* Fallback */
  padding: 12px;
  border-radius: 4px;
  width: 100%;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s;
  display: block;
  text-align: center;
}

.btn-buy-now:hover {
  background-color: #F0F4FF;
}

.seller-info {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--noon-border);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.seller-name {
  font-weight: 700;
  color: var(--noon-blue);
}

.trust-badges-row {
  display: flex;
  justify-content: space-around;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--noon-border);
}

.trust-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.trust-badge img {
  width: 32px;
  height: 32px;
}

.trust-badge span {
  font-size: 10px;
  color: var(--noon-text-gray);
}

/* Sticky Bottom Bar (Mobile & Desktop) */
.sticky-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  padding: 12px 16px;
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sticky-bottom-bar.visible {
  transform: translateY(0);
}

/* 
@media (min-width: 1024px) {
  .sticky-bottom-bar { 
    display: none !important; 
  }
} 
*/

/* Mobile Gallery Adjustments */
@media (max-width: 768px) {
  .gallery-container {
    flex-direction: column;
    height: auto;
    padding: 0;
  }
  
  .main-image-area {
    height: 350px; /* Limit height on mobile */
  }
  
  .thumbnails-strip {
    flex-direction: row;
    width: 100%;
    height: auto;
    overflow-x: auto;
    padding: 10px;
    order: 2; /* Put thumbs below image on mobile */
  }
  
  .thumbnail {
    flex-shrink: 0;
  }
}

/* --- PRODUCT CARD STYLES (Ported from Productcard.php) --- */

.noon-products-container { display: flex; flex-wrap: wrap; gap: 20px; margin: 20px 0; overflow-x: hidden; }
/* Widths overridden by parent container in single product page, but keeping defaults */
.noon-product-wrapper { position: relative; width: 100%; max-width: 280px; min-width: 180px; flex: 0 0 auto; font-family: 'Proxima Nova', 'Inter', sans-serif; box-sizing: border-box; }

.noon-product-link { text-decoration: none; color: inherit; display: block; }
.noon-product-box { background: #fff; border-radius: 12px; overflow: visible; transition: all 0.3s ease; border: 1px solid #e5e5e5; height: 100%; }
.noon-product-box:hover { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); transform: translateY(-4px); }
.noon-image-section { position: relative; background: #ffffff; padding-top: 100%; border-radius: 12px 12px 0 0; overflow: hidden; }
.noon-image-inner { position: absolute; top: 0; left: 0; right: 0; bottom: 0; }
.noon-image-carousel { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; }
.noon-product-image { max-width: 100%; max-height: 100%; object-fit: contain; }
.noon-image-header { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: flex-start; z-index: 2; }
.noon-mega-deal { background: var(--mega-bg); color: var(--mega-text); padding: 2px 8px; border-radius: 6px; font-weight: 700; font-size: 10px; display: inline-flex; align-items: center; gap: 4px; box-shadow: 0 2px 8px rgba(254, 238, 0, 0.25); }
.noon-mega-deal img { width: 12px; height: 12px; object-fit: contain; flex-shrink: 0; }

.noon-details-section { padding: 16px; }
.noon-product-title { font-size: 16px; font-weight: 600; color: #2a2a2a; margin: 0 0 8px 0; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; min-height: 2.7em; }
@media (max-width: 768px) { .noon-product-title { height: auto; min-height: 0; overflow: visible; display: block; -webkit-line-clamp: unset; } }
.noon-rating { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.noon-selling-price { font-size: clamp(16px, 1.4vw, 18px); font-weight: 700; color: #2a2a2a; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.noon-currency img { height: 16px; width: auto; vertical-align: middle; margin-right: 2px; }
.noon-old-price { font-size: 14px; color: #999; text-decoration: line-through; display: flex; align-items: center; }
.noon-discount-badge { background: #FF6B00; color: white; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.noon-nudges { height: 24px; overflow: hidden; margin-bottom: 12px; }
.noon-nudges-wrapper { display: flex; flex-direction: column; gap: 8px; animation: nudgeSlide 6s infinite; }
@keyframes nudgeSlide { 0%, 33% { transform: translateY(0); } 40%, 73% { transform: translateY(-32px); } 80%, 100% { transform: translateY(-64px); } }
.noon-nudge { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #666; height: 24px; }

/* Superfast Ribbon */
.noon-superfast-ribbon { background: var(--ribbon-bg); color: var(--ribbon-text); padding: 8px 12px; border-radius: 10px; display: flex; align-items: center; gap: 8px; line-height: 1.2; width: 100%; box-sizing: border-box; box-shadow: 0 2px 10px rgba(0,0,0,0.06); border: 1px solid rgba(0,0,0,0.06); cursor: pointer; }
.noon-superfast-text { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.2px; }
.noon-superfast-text b { font-weight: 800; }

/* Horizontal Scroll Container Override for Product Page */
.noon-horizontal-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  scroll-snap-type: x mandatory;
}
.noon-horizontal-scroll .noon-product-wrapper {
  scroll-snap-align: start;
  flex: 0 0 220px !important; /* Force fixed width */
  width: 220px !important;
  min-width: 220px !important;
  max-width: 220px !important;
}

/* Ensure the card content doesn't stretch weirdly */
.noon-product-box {
    height: auto;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.noon-details-section {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Fix for broken images in horizontal scroll if any */
.noon-currency img {
    display: inline-block;
}

/* Payment & Delivery Slider */
.noon-payment-options-container {
  margin-top: 16px;
  margin-bottom: 24px;
  border-top: 1px solid var(--noon-border);
  padding-top: 16px;
}

.noon-section-subtitle {
  font-size: 14px;
  font-weight: 700;
  color: var(--noon-black);
  margin-bottom: 12px;
}

.noon-slider-wrapper {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px; /* For scrollbar space if needed */
}

.noon-slide-element {
  flex: 0 0 auto;
  width: 320px; /* Adjust as needed */
  max-width: 85vw;
}

.noon-bnpl-container {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--noon-border);
  border-radius: 8px;
  padding: 12px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: box-shadow 0.2s;
}

.noon-bnpl-container:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.noon-icon-left img {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.noon-bnpl-container p {
  font-size: 12px;
  color: var(--noon-black);
  margin: 0;
  line-height: 1.4;
}

.noon-learn-more {
  color: var(--noon-blue);
  font-weight: 600;
  margin-left: 4px;
  font-size: 11px;
}

/* Wishlist Button */
.noon-wishlist-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #fff;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  cursor: pointer;
  z-index: 10;
  color: #7E859B;
}

/* Image Footer (Quick ATC) */
.noon-image-footer {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 10;
}

.noon-quick-atc {
  background: #fff;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  cursor: pointer;
  color: #404553;
  transition: transform 0.2s;
}

.noon-quick-atc:hover {
  transform: scale(1.1);
  color: var(--noon-blue);
}
