/* styles.css */
/* Add any custom styles here. For RTL, Tailwind handles most, but you can add more if needed. */

/* Base Styles */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f3f4f6;
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --accent-color: #fbbf24;
  --border-color: #e5e7eb;
  --primary-color: #1e40af;
  --secondary-color: #3b82f6;
  --text-color: #1f2937;
  --background-color: #f3f4f6;
}

/* Global Persian Numbers */
html[lang="fa"] {
  font-feature-settings: "ss01" on, "tnum" on;
  -webkit-font-feature-settings: "ss01" on, "tnum" on;
  -moz-font-feature-settings: "ss01" on, "tnum" on;
  font-variant-numeric: persian;
}

/* Typography */
.vazir-font {
  font-family: 'Vazir', sans-serif;
}

body {
  font-family: 'Vazir', sans-serif;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

/* RTL Text Alignment */
.text-rtl {
  direction: rtl;
  text-align: right;
}

/* LTR for star ratings */
.star-rating {
  direction: ltr;
  text-align: left;
}

.container {
  width: 100%;
  max-width: 2000px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Navigation */
nav {
  background-color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

nav .container {
  max-width: 1200px;
  margin: 0 auto;
}

nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

nav ul li {
  position: relative;
}

nav ul li.group:hover ul {
  display: block;
}

nav ul li a {
  text-decoration: none;
  color: #4b5563;
  transition: color 0.2s ease;
}

nav ul li a:hover {
  color: #1e40af;
}

/* RTL Support */
html[dir="rtl"] nav ul {
  direction: rtl;
}

/* Hero Section */
.hero-section {
  min-height: 400px;
  background-color: rgb(239, 222, 199);
  background-image: url('picture/Banner.png');
  background-repeat: no-repeat;
  background-position: left;
  background-size: contain;
}

/* Search Box */
.search-box {
  width: 100%;
  max-width: 32rem;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  border: 2px solid var(--border-color);
  transition: border-color 0.2s ease;
}

.search-input:focus {
  border-color: var(--accent-color);
  outline: none;
}

/* Image Comparison Slider */
.image-comparison {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.image-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.image-container.after {
  clip-path: inset(0 0 0 50%);
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.label {
  position: absolute;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 12px;
  border-radius: 3px;
}

.label.before {
  top: 8px;
  left: 8px;
  z-index: 4;
}

.label.after {
  top: 8px;
  right: 8px;
  z-index: 4;
}

.slider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  background: white;
  left: 50%;
  transform: translateX(-50%);
  cursor: ew-resize;
  z-index: 3;
}

.slider-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: white;
  left: 50%;
  transform: translateX(-50%);
}

.slider-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider-handle svg {
  width: 20px;
  height: 20px;
  color: #1e40af;
}

.arrow-left {
  position: absolute;
  left: 4px;
}

.arrow-right {
  position: absolute;
  right: 4px;
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  padding: 2rem;
}

/* Product Card */
.product-card {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 300px;
}

.product-card h3 {
  margin-bottom: 0.5rem;
}

/* Star Rating */
.star-rating {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
  direction: ltr;
}

.star-rating .flex {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.star-rating svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.star-rating .text-yellow-400 {
  color: #fbbf24;
}

.star-rating .text-gray-300 {
  color: #d1d5db;
}

/* Partial Star */
.star-rating .partial-star {
  position: relative;
  width: 1.25rem;
  height: 1.25rem;
}

.star-rating .partial-star::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background-color: #fbbf24;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.star-rating .partial-star::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background-color: #d1d5db;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

/* Review Count */
.star-rating .review-count {
  font-family: 'Vazir', sans-serif;
  font-feature-settings: "ss01" on, "tnum" on;
  -webkit-font-feature-settings: "ss01" on, "tnum" on;
  -moz-font-feature-settings: "ss01" on, "tnum" on;
  font-variant-numeric: persian;
  unicode-bidi: plaintext;
  direction: rtl;
  margin-right: 0.5rem;
}

.product-card p {
  margin-bottom: 1rem;
}

.product-image-container {
  width: 100%;
  height: 192px;
  overflow: hidden;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-image:hover {
  transform: scale(1.05);
}

/* Buttons */
.btn {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--accent-color);
  color: white;
}

.btn-primary:hover {
  background-color: #1e40af;
}

/* Utilities */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Responsive Design */
@media (min-width: 640px) {
  .label {
    padding: 6px 10px;
    font-size: 13px;
  }
  .slider-handle {
    width: 50px;
    height: 50px;
  }
  .slider-handle svg {
    width: 25px;
    height: 25px;
  }
}

@media (min-width: 768px) {
  .label {
    padding: 8px 12px;
    font-size: 14px;
  }
  .slider-handle {
    width: 60px;
    height: 60px;
  }
  .slider-handle svg {
    width: 30px;
    height: 30px;
  }
}

/* Price Formatting */
.price-format {
  font-feature-settings: "tnum" on;
  -webkit-font-feature-settings: "tnum" on;
  -moz-font-feature-settings: "tnum" on;
  font-variant-numeric: tabular-nums;
  display: inline-block;
  margin: 0;
  padding: 0;
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
}

.price-format.loaded {
  opacity: 1;
}

/* Persian Numbers Class */
.persian-numbers {
  font-feature-settings: "ss01" on, "tnum" on;
  -webkit-font-feature-settings: "ss01" on, "tnum" on;
  -moz-font-feature-settings: "ss01" on, "tnum" on;
  font-variant-numeric: persian;
  unicode-bidi: plaintext;
}

.selected {
  color: #fff !important;
  background-color: #1e40af !important; /* Tailwind bg-blue-800 */
  border-color: #1e40af !important; /* Tailwind border-blue-800 */
}
.selected .text-gray-500 {
  color: #fff !important;
}

.input-icon-container {
  position: relative;
}
.input-icon-container input {
  padding-left: 2.5rem; /* adjust as needed */
}
.input-icon {
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
}

body.checkout-page, .checkout-page body, .checkout-page select, .checkout-page textarea, .checkout-page button { font-family: Vazir, Tahoma, sans-serif !important; }
/* Global: All email inputs & displays use Times New Roman */
input[type="email"],
.email-text,
.email,
[data-email],
.latin-digits { font-family: "Inter", Arial, Helvetica, sans-serif !important; }
/* Ensure email inputs use Latin digits/font on checkout */
.checkout-page input[type="email"],
.checkout-page .latin-digits,
.checkout-page .email-text,
.checkout-page .email,
.checkout-page [data-email] { font-family: Arial, Helvetica, sans-serif !important; direction: ltr; text-align: left; unicode-bidi: plaintext; }
.checkout-container { max-width: 1100px; margin: 0 auto; padding: 2rem 1rem; display: flex; flex-wrap: wrap; gap: 2rem; }
.checkout-form { flex: 1 1 350px; background: #fff; border-radius: 16px; box-shadow: 0 2px 8px #0001; padding: 2rem; min-width: 320px; }
.checkout-summary { flex: 1 1 350px; background: #fff; border-radius: 16px; box-shadow: 0 2px 8px #0001; padding: 2rem; min-width: 320px; }
@media (max-width: 900px) {
    .checkout-container { flex-direction: column; gap: 1.5rem; }
}
.form-label { font-weight: bold; margin-bottom: 0.5rem; display: block; color: #333; }
.form-input, .form-select { width: 100%; padding: 0.75rem; border: 1px solid #ddd; border-radius: 8px; margin-bottom: 1rem; font-size: 1rem; }
.form-input:focus, .form-select:focus { border-color: #ff6600; outline: none; }
.checkout-title { font-size: 2rem; font-weight: bold; color: #1e40af; text-align: center; margin-bottom: 2rem; }
.summary-title { font-size: 1.25rem; font-weight: bold; color: #ff6600; margin-bottom: 1.5rem; }
.cart-item { display: flex; align-items: center; gap: 1rem; border-bottom: 1px solid #f3f3f3; padding-bottom: 1rem; margin-bottom: 1rem; }
.cart-item:last-child { border-bottom: none; margin-bottom: 0; }
.cart-item-img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: #f8f8f8; }
.cart-item-info { flex: 1; }
.cart-item-title { font-weight: bold; color: #222; }
.cart-item-options { font-size: 0.95rem; color: #666; margin-top: 0.25rem; }
.cart-item-controls { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.cart-item-remove { background: none; border: none; color: #ff3333; font-size: 1.2rem; cursor: pointer; }
.cart-item-qty-btn { background: #f3f3f3; border: none; border-radius: 6px; width: 28px; height: 28px; font-size: 1.1rem; color: #333; cursor: pointer; transition: background 0.2s; }
.cart-item-qty-btn:hover { background: #ff6600; color: #fff; }
.cart-item-price { font-weight: bold; color: #ff6600; font-size: 1.1rem; }
.summary-total { font-size: 1.2rem; font-weight: bold; color: #ff6600; margin-top: 1.5rem; display: flex; justify-content: space-between; }
.pay-btn { width: 100%; background: #ff6600; color: #fff; font-size: 1.2rem; font-weight: bold; border: none; border-radius: 8px; padding: 1rem; margin-top: 2rem; transition: background 0.2s; cursor: pointer; }
.pay-btn:hover { background: #e65c00; } 