/* ========================================
   PRODUCT PAGE CUSTOM STYLES
   Replaces Tailwind CSS utility classes
   ======================================== */

/* Product Wrapper - 2 Column Layout */
.product-wrapper {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 992px) {
  .product-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* Product Gallery */
.product-gallery {
  width: 100%;
  max-width: 600px;
}

.main-image-container {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  height: 500px;
  min-height: 500px;
  max-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.main-product-image {
  width: 100%;
  max-height: 500px !important;
  height: auto !important;
  object-fit: contain;
  transition: opacity 0.3s ease, transform 0.2s;
}

.image-zoom-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.no-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 16rem;
  color: #cbd5e1;
}

.no-image-placeholder i {
  font-size: 3rem;
}

/* Thumbnail Grid */
.thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin-top: 1rem;
}

.thumbnail {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.thumbnail:hover {
  border-color: #cbd5e1;
}

.thumbnail.active {
  border-color: var(--color-primary, #e31e24);
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Product Details */
.product-details {
  width: 100%;
}

.product-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.product-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
}

.wishlist-icon {
  font-size: 1.5rem;
  color: #cbd5e1;
  cursor: pointer;
  transition: color 0.2s;
}

.wishlist-icon:hover {
  color: #ef4444;
}

/* Price Section */
.product-price-section {
  margin-bottom: 1rem;
  margin-top: 0.5rem;
}

.product-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: #000;
}

.product-mrp {
  font-size: 0.875rem;
  color: #94a3b8;
  margin-left: 0.5rem;
  text-decoration: line-through;
}

.product-discount {
  font-size: 0.875rem;
  color: var(--color-error, #ef4444);
  font-weight: 700;
  margin-left: 0.5rem;
}

.tax-info {
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 0.25rem;
}

/* Offers Container Grid */
.offers-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 992px) {
  .offers-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .offers-container {
    grid-template-columns: 1fr;
  }

  .main-image-container{
    height: 200px;
    min-height: 200px;
    max-height: 200px;
  }
}

/* Offer Box */
.offer-box {
  background: #fef3c7;
  border: 1px solid #fde047;
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  height: 100%;
}

.offer-box.green {
  background: #dcfce7;
  border-color: #86efac;
}

.offer-box i {
  color: #ca8a04;
  margin-top: 0.25rem;
}

.offer-box.green i {
  color: #16a34a;
}

.offer-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #92400e;
}

.offer-box.green .offer-title {
  color: #14532d;
}

.offer-code {
  font-size: 0.75rem;
  color: #a16207;
}

.offer-box.green .offer-code {
  color: #15803d;
}

.offer-code strong {
  font-weight: 700;
}

/* Frame Dimensions */
.frame-dimensions {
  margin-bottom: 1.5rem;
}

.section-label {
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: block;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  background: #f8fafc;
  padding: 1rem;
  border-radius: 12px;
  text-align: center;
  border: 1px solid #f1f5f9;
}

.spec-item i {
  color: #94a3b8;
  margin-bottom: 0.25rem;
}

.spec-value {
  font-weight: 700;
  color: var(--color-accent, #1e293b);
}

.spec-label {
  font-size: 0.75rem;
  color: #64748b;
}

/* Trust Badges */
.trust-badges {
  margin-bottom: 1.5rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.trust-badge-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trust-badge-icon.green {
  background: #dcfce7;
  color: #16a34a;
}

.trust-badge-icon.blue {
  background: #dbeafe;
  color: #2563eb;
}

.trust-badge-text {
  font-weight: 600;
  font-size: 0.875rem;
}

/* Action Buttons */
.product-actions {
  margin-bottom: 1.5rem;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.btn-buy-now,
.btn-add-cart,
.btn-whatsapp,
.btn-disabled {
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  letter-spacing: 0.3px;
}

.btn-buy-now {
  background: var(--color-accent, #1e293b);
  color: #fff;
}

.btn-buy-now:hover {
  background: #0f172a;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.btn-buy-now:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-buy-now {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

.btn-buy-now:hover {
  background: #1e293b;
  border-color: #1e293b;
}

/* .btn-add-cart inherits global styles */

.btn-whatsapp {
  background: #25d366;
  color: #fff;
  grid-column: auto;
}

.btn-whatsapp i {
  font-size: 1.5rem;
  margin: 0;
}

.btn-whatsapp:hover {
  background: #1fb855;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.25);
}

.btn-whatsapp:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.15);
}

.btn-disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

/* Button Icons */
.btn-buy-now i,
.btn-add-cart i,
.btn-whatsapp i {
  font-size: 1.125rem;
}

/* Focus States for Accessibility */
.btn-buy-now:focus,
.btn-add-cart:focus,
.btn-whatsapp:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Professional Button Layout - All Side by Side */
.action-buttons-row {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 0.75rem;
  width: 100%;
}

.action-buttons-row > * {
  grid-column: auto !important;
}

.action-buttons-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.btn-primary-action {
  font-size: 1.125rem;
  padding: 1rem 1.5rem;
}

.secondary-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.secondary-actions-row .btn-whatsapp {
  grid-column: auto;
}

@media (max-width: 768px) {
  .action-grid {
    grid-template-columns: 1fr;
  }
  
  .action-buttons-row {
    grid-template-columns: 1fr 1fr 50px !important;
    gap: 0.5rem;
  }
  
  .product-actions {
    position: fixed;
    bottom: 65px; /* Above mobile bottom nav */
    left: 0;
    width: 100%;
    background: #fff;
    padding: 0.75rem 1rem;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 1000;
    margin-bottom: 0;
  }

  .btn-buy-now, .btn-add-cart {
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
  }

  .secondary-actions-row {
    grid-template-columns: 1fr;
  }
  
  .btn-primary-action {
    font-size: 1rem;
    padding: 0.875rem 1.5rem;
  }
  
  .btn-whatsapp {
    grid-column: auto;
    width: 50px;
    height: 100%;
    padding: 0;
  }
}


/* Description */
.product-description-section {
  margin-bottom: 1.5rem;
}

.product-description {
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.6;
}

/* Product Information */
.product-info-section {
  margin-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
  padding-top: 1rem;
}

.product-info-header {
  font-weight: 700;
  color: #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.product-info-header i {
  color: #94a3b8;
}

.feature-list {
  margin-top: 0.75rem;
  list-style: none;
  padding: 0;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #475569;
  margin-bottom: 0.5rem;
}

.feature-list li span:first-child {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--color-primary, #e31e24);
  margin-top: 0.375rem;
  flex-shrink: 0;
}

/* Color Variants */
.product-variants {
  margin-bottom: 1.5rem;
}

.variant-title {
  margin-bottom: 0.75rem;
  font-weight: 700;
  color: var(--color-accent, #1e293b);
}

.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.swatch-container {
  position: relative;
  cursor: pointer;
}

.swatch-container input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.swatch {
  display: block;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  transition: all 0.2s;
}

.swatch-container input:checked + .swatch {
  box-shadow: 0 0 0 2px var(--color-primary, #e31e24);
}

/* Utility Classes */
.relative {
  position: relative;
}

.overflow-hidden {
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Slider Controls (Added) */
.slider-controls {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
    transform: translateY(-50%);
    pointer-events: none; 
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.main-image-container:hover .slider-controls {
    opacity: 1;
}

.slider-arrow {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0,0,0,0.05);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    pointer-events: auto;
    color: #1e293b;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.slider-arrow:hover {
    background: white;
    transform: scale(1.1);
    color: var(--color-primary, #e31e24);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}
