/* Media Gallery Styles - Shopee-inspired */

.product-detail-container {
  display: flex;
  gap: 30px;
}

/* Media Gallery Section - 50% width */
.media-gallery-section {
  flex: 1;
  max-width: 50%;
}

/* Order Container Section - 50% width */
.order-container-section {
  flex: 1;
  max-width: 50%;
}

/* Main Display Area */
.media-main-display {
  width: 100%;
  height: 400px;
  background: #f5f5f5;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  margin-bottom: 15px;
  border: 1px solid #e0e0e0;
}

.media-main-display img,
.media-main-display video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.media-main-display video {
  background: #000;
}

/* Video Play Overlay */
.video-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  pointer-events: none;
}

.video-overlay.playing {
  opacity: 0;
}

.video-overlay i {
  color: white;
  font-size: 32px;
  margin-left: 5px;
}

/* Thumbnail List - Horizontal Scroll */
.media-thumbnail-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 0;
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
.media-thumbnail-list::-webkit-scrollbar {
  height: 6px;
}

.media-thumbnail-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.media-thumbnail-list::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.media-thumbnail-list::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Thumbnail Item */
.media-thumbnail-item {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  background: #f5f5f5;
}

.media-thumbnail-item:hover {
  border-color: #0066cc;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.media-thumbnail-item.active {
  border-color: #0066cc;
  box-shadow: 0 0 0 1px #0066cc;
}

.media-thumbnail-item img,
.media-thumbnail-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Video Thumbnail Indicator */
.media-thumbnail-item[data-type="video"]::after {
  content: "\f04b";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 20px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* Order Container Styling */
.add-to-cart-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  height: 400px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 25px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.add-to-cart-box .cart-options,
.add-to-cart-box .cart-quantity,
.add-to-cart-box .cart-price {
  margin-bottom: 20px;
}

.add-to-cart-box label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
}

.add-to-cart-box select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.quantity-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qty-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s ease;
}

.qty-btn:hover {
  background: #f5f5f5;
  border-color: #444444;
}

.qty-btn:active {
  transform: scale(0.95);
}

#quantity {
  width: 60px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px;
  font-size: 16px;
}

.cart-price {
  font-size: 24px;
  font-weight: 700;
  color: #d32f2f;
}

/* ========== MODERN ORDER CONTAINER ========== */

.modern-order-container {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  min-height: 480px;
  display: flex;
  flex-direction: column;
}

/* Tabs */
.order-tabs {
  display: flex;
  background: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
}

.order-tab {
  flex: 1;
  padding: 16px 20px;
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.order-tab:hover {
  background: #e9ecef;
  color: #333;
}

.order-tab.active {
  background: #444444;
  color: white;
  box-shadow: inset 0 -3px 0 #444444;
}

.order-tab i {
  font-size: 16px;
}

/* Tab Content */
.tab-content {
  display: none;
  flex: 1;
  padding: 24px;
}

.tab-content.active {
  display: block;
}

/* Slider Groups */
.slider-group {
  margin-bottom: 16px;
}

.slider-group label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  font-size: 14px;
}

.slider-container {
  position: relative;
  padding: 0 8px;
}

.slider-container input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e0e0e0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
  appearance: -webkit-slider-thumb;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0066cc;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 102, 204, 0.3);
}

.slider-container input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #444444;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 102, 204, 0.3);
}

.slider-value {
  display: flex;
  justify-content: center;
  margin-top: 8px;
  font-weight: 600;
  color: #444444;
  font-size: 14px;
}

/* Radio Groups */
.radio-group {
  margin-bottom: 24px;
}

.radio-group label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
  font-size: 14px;
}

.radio-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #fff;
  font-weight: normal !important;
  margin-bottom: 0 !important;
}

.radio-option:hover {
  border-color: #0066cc;
  background: #f8f9ff;
}

.radio-option input[type="radio"] {
  display: none;
}

.radio-custom {
  width: 16px;
  height: 16px;
  border: 2px solid #ddd;
  border-radius: 50%;
  position: relative;
  transition: all 0.3s ease;
}

.radio-option input[type="radio"]:checked + .radio-custom {
  border-color: #0066cc;
  background: #0066cc;
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
}

.radio-option input[type="radio"]:checked + .radio-custom + span {
  color: #0066cc;
  font-weight: 600;
}

/* Tolerance Group */

.tolerance-group label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  font-size: 14px;
}

.tolerance-group select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.tolerance-group select:focus {
  outline: none;
  border-color: #0066cc;
}

/* Order Summary */
.order-summary {
  background: #f8f9fa;
  padding: 24px;
  border-top: 1px solid #e0e0e0;
  margin-top: auto;
}

.quantity-section {
  margin-bottom: 20px;
}

.quantity-section label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
  font-size: 14px;
}

.quantity-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.quantity-selector .qty-btn {
  width: 40px;
  height: 40px;
  border: 2px solid #444444;
  background: #fff;
  color: #444444;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quantity-selector .qty-btn:hover {
  background: #444444;
  color: white;
  transform: scale(1.05);
}

.quantity-selector #quantity {
  width: 80px;
  height: 40px;
  text-align: center;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
}

.price-section {
  margin-bottom: 20px;
  text-align: center;
}

.price-display {
  padding: 16px;
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
}

.price-label {
  display: block;
  font-size: 14px;
  color: #666;
  margin-bottom: 4px;
}

.price-value {
  font-size: 28px;
  font-weight: 700;
  color: #d32f2f;
}

.modern-cart-btn,
.modern-login-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.modern-cart-btn:hover,
.modern-login-btn:hover {
  background: linear-gradient(135deg, #0052a3 0%, #003366 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
}

.modern-cart-btn:active,
.modern-login-btn:active {
  transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .radio-options {
    grid-template-columns: repeat(2, 1fr);
  }

  .order-tabs {
    flex-direction: column;
  }

  .modern-order-container {
    min-height: 520px;
  }
}

.btn-cart i,
.contact-btn i {
  margin-right: 8px;
}

/* Product Info Table - Full Width */
.product-info-table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
}

.product-info-table td {
  padding: 15px;
  border: 1px solid #e0e0e0;
  vertical-align: top;
}

.product-info-table td:first-child {
  width: 200px;
  background: #f9f9f9;
  font-weight: 600;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .media-main-display {
    height: 400px;
  }

  .media-thumbnail-item {
    width: 70px;
    height: 70px;
  }
}

@media (max-width: 768px) {
  /* Stack vertically on mobile */
  .product-detail-container {
    flex-direction: column;
  }

  .media-gallery-section,
  .order-container-section {
    max-width: 100%;
  }

  .media-main-display {
    height: 350px;
  }

  .media-thumbnail-item {
    width: 60px;
    height: 60px;
  }

  .add-to-cart-box {
    position: sticky;
    bottom: 0;
    z-index: 100;
    margin: 0 -15px;
    border-radius: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  }
}

@media (max-width: 480px) {
  .media-main-display {
    height: 280px;
  }

  .media-thumbnail-item {
    width: 50px;
    height: 50px;
  }

  .cart-price {
    font-size: 20px;
  }
}

/* Loading State */
.media-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #999;
}

.media-loading i {
  font-size: 48px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Empty State */
.media-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #999;
}

.media-empty i {
  font-size: 64px;
  margin-bottom: 15px;
  opacity: 0.3;
}

.media-empty p {
  font-size: 16px;
}
