/* Enhanced Product Page Styles - OpenCart 3.x ReMarket Theme */

/* ===== RESPONSIVE BREAKPOINTS ===== */
:root {
  --breakpoint-xs: 0;
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 992px;
  --breakpoint-xl: 1200px;
  --breakpoint-xxl: 1360px;
  
  /* Spacing System */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-xxl: 40px;
  
  /* Colors */
  --primary-color: #007bff;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  
  /* Typography */
  --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-size-base: 1rem;
  --line-height-base: 1.5;
  
  /* Shadows */
  --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
  
  /* Transitions */
  --transition-base: all 0.15s ease-in-out;
  --transition-fast: all 0.1s ease-in-out;
  --transition-slow: all 0.3s ease-in-out;
}

/* ===== BASE STYLES ===== */
.product-page {
  font-family: var(--font-family-base);
  line-height: var(--line-height-base);
  color: var(--dark-color);
}

/* ===== LAYOUT & GRID ===== */
.product-row {
  max-width: 1360px;
  margin: 0 auto;
}

/* Column widths and gaps */
@media (min-width: 1200px) {
  .product-row > .col-lg-7 {
    flex: 0 0 60%;
    max-width: 60%;
  }
  
  .product-row > .col-lg-5 {
    flex: 0 0 40%;
    max-width: 40%;
  }
  
  .product-row {
    gap: var(--spacing-xxl);
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .product-row {
    gap: var(--spacing-lg);
  }
}

@media (max-width: 991px) {
  .product-row {
    gap: var(--spacing-md);
  }
}

/* Horizontal padding */
@media (max-width: 767px) {
  .container-fluid {
    padding-left: var(--spacing-lg);
    padding-right: var(--spacing-lg);
  }
}

@media (min-width: 768px) {
  .container-fluid {
    padding-left: var(--spacing-xl);
    padding-right: var(--spacing-xl);
  }
}

@media (min-width: 1200px) {
  .container-fluid {
    padding-left: var(--spacing-xxl);
    padding-right: var(--spacing-xxl);
  }
}

/* ===== GALLERY SECTION ===== */
.product-gallery {
  background: var(--light-color);
  border-radius: 8px;
  padding: var(--spacing-md);
}

.main-image-container {
  position: relative;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 4/5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: var(--transition-base);
}

.zoom-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition-base);
  cursor: pointer;
}

.main-image-container:hover .zoom-overlay {
  opacity: 1;
}

.thumbnail-gallery {
  margin-top: var(--spacing-md);
}

.thumbnail-btn {
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  transition: var(--transition-base);
  aspect-ratio: 1;
}

.thumbnail-btn:hover {
  border-color: var(--primary-color);
  transform: scale(1.05);
}

.thumbnail-btn.active {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

.thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-base);
}

/* ===== PRODUCT INFO SECTION ===== */
.product-header {
  margin-bottom: var(--spacing-xl);
}

.product-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
}

@media (max-width: 767px) {
  .product-title {
    font-size: 1.5rem;
  }
}

.product-model {
  font-size: 0.875rem;
  color: var(--secondary-color);
}

.brand a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: var(--transition-base);
}

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

.stock-status .badge {
  font-size: 0.875rem;
  padding: var(--spacing-sm) var(--spacing-md);
}

/* ===== PRICING SECTION ===== */
.pricing-section {
  margin-bottom: var(--spacing-xl);
}

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

.original-price {
  font-size: 1.25rem;
  color: var(--secondary-color);
}

.savings-badge .badge {
  font-size: 0.875rem;
  padding: var(--spacing-sm) var(--spacing-md);
}

.tax-info {
  font-size: 0.875rem;
  color: var(--secondary-color);
}

/* ===== COUNTDOWN TIMER ===== */
.countdown-timer {
  background: var(--light-color);
  border-radius: 8px;
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.timer-label {
  font-weight: 600;
  color: var(--dark-color);
  margin-bottom: var(--spacing-md);
}

.timer-display {
  background: white;
  border-radius: 6px;
  padding: var(--spacing-md);
}

.timer-unit {
  text-align: center;
}

.timer-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--danger-color);
  background: var(--light-color);
  border-radius: 4px;
  padding: var(--spacing-sm);
  margin-bottom: var(--spacing-xs);
}

.timer-label.small {
  font-size: 0.75rem;
  color: var(--secondary-color);
  text-transform: uppercase;
  font-weight: 600;
}

/* ===== PRODUCT OPTIONS ===== */
.product-options {
  margin-bottom: var(--spacing-xl);
}

.option-group {
  margin-bottom: var(--spacing-lg);
}

.option-group label {
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  color: var(--dark-color);
}

.option-values {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.form-check {
  margin-bottom: 0;
}

.option-image {
  border-radius: 4px;
  border: 1px solid var(--light-color);
}

/* ===== ACTIONS SECTION ===== */
.actions-section {
  margin-bottom: var(--spacing-xl);
}

.quantity-section {
  margin-bottom: var(--spacing-lg);
}

.quantity-section label {
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
}

.input-group {
  max-width: 200px;
}

.input-group .btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.input-group .form-control {
  height: 44px;
  text-align: center;
  font-weight: 600;
}

.action-buttons .btn {
  transition: var(--transition-base);
}

.action-buttons .btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ===== ADVANTAGES SECTION ===== */
.product-advantages {
  margin-bottom: var(--spacing-xl);
}

.advantage-item {
  background: white;
  border: 1px solid var(--light-color);
  transition: var(--transition-base);
}

.advantage-item:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

.advantage-title {
  font-size: 0.875rem;
  margin-bottom: var(--spacing-xs);
}

.advantage-text {
  font-size: 0.75rem;
  line-height: 1.4;
}

/* ===== TABS & ACCORDION ===== */
.product-tabs {
  margin-top: var(--spacing-xl);
}

/* Desktop Tabs */
.nav-tabs {
  border-bottom: 2px solid var(--light-color);
}

.nav-tabs .nav-link {
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: var(--spacing-md) var(--spacing-lg);
  font-weight: 600;
  color: var(--secondary-color);
  transition: var(--transition-base);
}

.nav-tabs .nav-link:hover {
  border-color: var(--light-color);
  color: var(--dark-color);
}

.nav-tabs .nav-link.active {
  border-bottom-color: var(--primary-color);
  color: var(--primary-color);
  background: transparent;
}

.tab-content {
  background: white;
  border: 1px solid var(--light-color);
  border-top: none;
  border-radius: 0 0 8px 8px;
}

.tab-pane {
  padding: var(--spacing-xl);
}

/* Mobile Accordion */
.accordion-button {
  background: white;
  border: 1px solid var(--light-color);
  font-weight: 600;
  color: var(--dark-color);
  padding: var(--spacing-md) var(--spacing-lg);
}

.accordion-button:not(.collapsed) {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.accordion-button:focus {
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.accordion-body {
  padding: var(--spacing-lg);
  background: white;
  border: 1px solid var(--light-color);
  border-top: none;
}

/* ===== ATTRIBUTES TABLE ===== */
.attributes-list {
  margin-bottom: var(--spacing-lg);
}

.attribute-group {
  margin-bottom: var(--spacing-xl);
}

.attribute-group h6 {
  color: var(--dark-color);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: var(--spacing-sm);
}

.table {
  margin-bottom: 0;
}

.table td {
  padding: var(--spacing-md);
  vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.02);
}

/* ===== TAGS ===== */
.product-tags {
  margin-top: var(--spacing-xl);
}

.tag-cloud .badge {
  font-size: 0.75rem;
  padding: var(--spacing-xs) var(--spacing-sm);
  margin: var(--spacing-xs);
  transition: var(--transition-base);
}

.tag-cloud .badge:hover {
  background: var(--primary-color);
  color: white;
  transform: scale(1.05);
}

/* ===== RELATED PRODUCTS & ARTICLES ===== */
.related-products,
.bought-together,
.related-articles {
  margin-top: var(--spacing-xl);
}

.product-card,
.article-card {
  background: white;
  border: 1px solid var(--light-color);
  border-radius: 8px;
  transition: var(--transition-base);
  height: 100%;
}

.product-card:hover,
.article-card:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.product-card .product-image,
.article-card .article-image {
  border-radius: 6px 6px 0 0;
  overflow: hidden;
}

.product-card .product-info,
.article-card .article-info {
  padding: var(--spacing-md);
}

.product-card .product-name,
.article-card .article-title {
  font-weight: 600;
  line-height: 1.3;
}

.product-card .product-price {
  margin-bottom: var(--spacing-md);
}

.article-card .article-date {
  color: var(--secondary-color);
  font-size: 0.875rem;
}

.article-card .article-description {
  line-height: 1.4;
}

/* ===== MOBILE STICKY BAR ===== */
.mobile-sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid var(--light-color);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  padding: var(--spacing-sm) 0;
}

.mobile-sticky-bar .mobile-price {
  padding-left: var(--spacing-sm);
}

.mobile-sticky-bar .btn {
  border-radius: 6px;
  font-weight: 600;
}

/* ===== MODALS ===== */
.modal-content {
  border-radius: 8px;
  border: none;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  border-bottom: 1px solid var(--light-color);
  padding: var(--spacing-lg);
}

.modal-body {
  padding: var(--spacing-lg);
}

.modal-footer {
  border-top: 1px solid var(--light-color);
  padding: var(--spacing-lg);
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles */
.btn:focus,
.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
  outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .btn {
    border-width: 2px;
  }
  
  .table td {
    border-width: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .mobile-sticky-bar,
  .zoom-overlay,
  .btn,
  .nav-tabs,
  .accordion-button {
    display: none !important;
  }
  
  .product-page {
    color: black;
  }
  
  .product-row {
    display: block;
  }
  
  .col-lg-7,
  .col-lg-5 {
    width: 100%;
    max-width: 100%;
    flex: none;
  }
}

/* ===== UTILITY CLASSES ===== */
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.aspect-ratio-4-5 {
  aspect-ratio: 4/5;
}

.aspect-ratio-1-1 {
  aspect-ratio: 1/1;
}

/* ===== LOADING STATES ===== */
.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ===== RESPONSIVE UTILITIES ===== */
@media (max-width: 575px) {
  .d-xs-none {
    display: none !important;
  }
  
  .d-xs-block {
    display: block !important;
  }
  
  .text-xs-center {
    text-align: center !important;
  }
}

@media (min-width: 576px) and (max-width: 767px) {
  .d-sm-none {
    display: none !important;
  }
  
  .d-sm-block {
    display: block !important;
  }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

/* ===== CUSTOM SCROLLBAR ===== */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: var(--light-color);
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--secondary-color);
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--dark-color);
}
