/**
 * Custom Styles - WeSale Solar
 * Brand CI: Solar Orange & Navy
 * Primary: #F76F05, Secondary: #1B214B, Accent: #EA9137
 */

/* ==================== FONTS ==================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&family=Prompt:wght@300;400;500;600;700;800&display=swap');

/* Base font */
body {
  font-family: 'Poppins', 'Prompt', sans-serif;
  color: #1B214B;
  background: #FAFAFC;
}

/* Headings: Poppins */
h1, h2, h3, h4, h5, h6,
.font-heading {
  font-family: 'Poppins', 'Prompt', sans-serif;
  letter-spacing: -0.02em;
}

/* ==================== BANNER SLIDER ==================== */
.banner-slider {
  position: relative;
  overflow: hidden;
}

.banner-slider .slides {
  position: relative;
  width: 100%;
}

.banner-slider .slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  pointer-events: none;
}

.banner-slider .slide.active {
  position: relative;
  opacity: 1;
  pointer-events: all;
}

.banner-slider .slide img {
  width: 100%;
  height: auto;
  max-height: 700px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

@media (max-width: 767px) {
  .banner-slider .slide img {
    height: auto;
    max-height: 500px;
    object-fit: contain;
  }
}

.banner-slider .slide-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 3rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.5));
  color: white;
  text-align: center;
}

.banner-slider .slide-content h2 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.banner-dots {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0;
}

.banner-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all 0.3s;
  border: 1px solid rgba(255,255,255,0.8);
}

.banner-dots .dot.active {
  background: white;
  width: 10px;
  border-radius: 50%;
}

/* ==================== PRODUCT CARD ==================== */
.product-card {
  transition: transform 0.2s, box-shadow 0.2s;
  border: none !important;
  box-shadow: none;
  border-radius: 0 !important;
  overflow: hidden;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.product-card .sold-out-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-card .favorite-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.2s;
}

.product-card .favorite-btn:hover {
  transform: scale(1.1);
}

/* ==================== IMAGE GALLERY ==================== */
.image-gallery {
  position: relative;
}

.image-gallery .main-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  cursor: zoom-in;
}

.image-gallery .thumbnails {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  overflow-x: auto;
}

.image-gallery .thumbnail {
  width: 60px;
  height: 60px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}

.image-gallery .thumbnail.active {
  border-color: #F76F05;
}

/* ==================== MODAL ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: white;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.3s;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

/* ==================== ORDER TIMELINE ==================== */
.order-timeline {
  position: relative;
  padding-left: 2rem;
}

.order-timeline::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e5e5e5;
}

.order-timeline .timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
}

.order-timeline .timeline-item::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 0.25rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e5e5e5;
}

.order-timeline .timeline-item.active::before {
  background: #F76F05;
}

.order-timeline .timeline-item.completed::before {
  background: #F76F05;
}

/* ==================== ADMIN TABLE ==================== */
.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  background: #fafafa;
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666;
  border-bottom: 1px solid #e5e5e5;
}

.admin-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f0f0f0;
}

.admin-table tr:hover td {
  background: #fafafa;
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.animate-marquee {
  animation: marquee 25s linear infinite;
}

.animate-marquee:hover {
  animation-play-state: paused;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.skeleton {
  animation: pulse 1.5s infinite;
  background: #e5e5e5;
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* ==================== LUCIDE ICONS ==================== */
/* ให้ไอคอน Lucide inherit สีจาก parent */
[data-lucide] {
  stroke: currentColor;
}

/* ==================== HORIZONTAL SCROLL PRODUCTS ==================== */
#product-scroll .product-card {
  min-width: 220px;
  max-width: 260px;
  flex-shrink: 0;
  scroll-snap-align: start;
}

@media (min-width: 768px) {
  #product-scroll .product-card {
    min-width: 260px;
    max-width: 300px;
  }
}

/* Hide scrollbar but keep scroll */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* ==================== TOGGLE SWITCH ==================== */
.translate-x-4\.5 {
  transform: translateX(1.1rem);
}
.translate-x-0\.5 {
  transform: translateX(0.15rem);
}

/* ==================== ADMIN CONTENT SPACING ==================== */
/* เว้นที่ให้กระดิ่ง notification มุมขวาบน */
#admin-content > div:first-child {
  padding-right: 3rem;
}

/* ==================== GOOGLE TRANSLATE HIDE ==================== */
.goog-te-banner-frame, .goog-te-gadget, #goog-gt-tt { display: none !important; }
body { top: 0 !important; position: static !important; }
.goog-te-balloon-frame { display: none !important; }
.goog-tooltip { display: none !important; }
.skiptranslate { display: none !important; }
iframe.goog-te-banner-frame { display: none !important; }
#google_translate_element { display: none !important; }
