/* 
 * Modern UI Design for BSTM Store
 * تصميم عصري لمتجر BSTM
 */

/* Brand palette */
:root {
  --black: #0a0a0a;
  --red: #d10000;
  --red-2: #7b0a2b;
  --red-3: #3d020b;
  --sand: #d6c1a3;
  --text: #e9e6e3;
  --bg-dark: #0a0a0a;
  --bg-light: #f8f8f8;
  --light-gray: #f5f5f5;
  --mid-gray: #888;
}

/* Global Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  margin: 0;
  padding: 0;
  background: #000;
  color: var(--text);
  font-family: 'Tajawal', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

a {
  color: var(--sand);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #fff;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(0, 0, 0, .85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  transition: all 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.brand {
  display: flex;
  align-items: center;
}

.logo {
  height: 50px;
  width: auto;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.nav {
  display: flex;
  gap: 30px;
}

.nav a {
  position: relative;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  opacity: 0.9;
}

.nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  background: var(--red);
  bottom: -5px;
  left: 0;
  transition: width 0.3s ease;
}

.nav a:hover {
  opacity: 1;
}

.nav a:hover::after {
  width: 100%;
}

/* ===== Hero Section with Slider ===== */
.hero-slider {
  position: relative;
  height: 100vh;
  min-height: 600px;
  margin-top: 80px; /* Header height */
  overflow: hidden;
}

.slider-container {
  position: relative;
  height: 100%;
  width: 100%;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.5s ease;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
}

.slide.active {
  opacity: 1;
  z-index: 1;
}

.slide .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.3), rgba(0,0,0,0.8));
  z-index: 1;
}

.slide-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  padding: 0 20px;
}

.slide-title {
  font-size: 3.5rem;
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 1s ease 0.5s;
}

.slide-subtitle {
  font-size: 1.5rem;
  margin-bottom: 30px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 1s ease 0.7s;
}

.slide.active .slide-title,
.slide.active .slide-subtitle,
.slide.active .slide-btn {
  opacity: 1;
  transform: translateY(0);
}

.slide-btn {
  opacity: 0;
  transform: translateY(20px);
  transition: all 1s ease 0.9s;
}

.slider-controls {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 15px;
  z-index: 10;
}

.slider-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
}

.slider-dot.active {
  background: var(--red);
  transform: scale(1.2);
}

.slider-arrows {
  position: absolute;
  top: 50%;
  width: 100%;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  padding: 0 30px;
  transform: translateY(-50%);
}

.slider-arrow {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.slider-arrow:hover {
  background: var(--red);
}

/* ===== Main Content ===== */
main {
  position: relative;
  background: var(--bg-dark);
  padding: 60px 0;
  z-index: 1;
}

/* Search and Filter Bar - Fixed to top after scroll */
.search-filter-container {
  position: sticky;
  top: 80px; /* Header height */
  z-index: 90;
  padding: 20px 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

.search-filter-container.scrolled {
  padding: 10px 0;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.search-filter-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Improved Search Bar */
.search-bar {
  flex: 1;
  max-width: 500px;
  position: relative;
  display: flex;
  border-radius: 50px;
  overflow: hidden;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.search-bar:focus-within {
  border-color: var(--red);
  box-shadow: 0 5px 20px rgba(209, 0, 0, 0.15);
}

#search-input {
  flex: 1;
  padding: 15px 25px;
  border: none;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-family: 'Tajawal', sans-serif;
}

#search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

#search-input:focus {
  outline: none;
}

.search-btn {
  background: linear-gradient(45deg, var(--red), var(--red-2));
  color: #fff;
  border: none;
  padding: 0 25px;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.search-btn:hover {
  background: linear-gradient(45deg, #b50000, #680824);
}

/* Modern Categories Pills */
.categories-container {
  flex: 2;
  position: relative;
}

.categories-list {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 10px;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  padding: 5px;
}

.categories-list::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}

.category-item {
  flex: 0 0 auto;
  cursor: pointer;
  padding: 10px 20px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.category-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.category-item.active {
  background: linear-gradient(45deg, var(--red), var(--red-2));
  color: #fff;
  border-color: transparent;
}

.category-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: brightness(1.5);
}

.category-item.active .category-icon {
  filter: brightness(2);
}

.category-name {
  font-size: 0.9rem;
  white-space: nowrap;
}

/* Filter Results Info */
.filter-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 30px 0 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#results-count {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
}

.filter-actions {
  display: flex;
  gap: 10px;
}

/* Products Grid with Card Animation */
.section-title {
  margin: 48px 0 30px;
  font-size: 32px;
  position: relative;
  display: inline-block;
  padding-bottom: 15px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--red);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  margin-bottom: 70px;
}

.product-card {
  background: rgba(10, 10, 10, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  overflow: hidden;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.6s ease, opacity 0.6s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.product-card.in-view {
  transform: translateY(0);
  opacity: 1;
}

.product-card:hover {
  border-color: rgba(209, 0, 0, 0.3);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.product-card .image-wrap {
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
}

.category-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 8px 15px;
  border-radius: 30px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.category-badge .category-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: brightness(1.5);
}

.product-card:hover .category-badge {
  background: var(--red);
  border-color: transparent;
}

.product-card:hover .category-badge .category-icon {
  filter: brightness(2);
}

.product-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.33, 1, 0.68, 1);
}

.product-card:hover img {
  transform: scale(1.08);
}

.product-card .content {
  padding: 20px;
}

.product-card h3 {
  font-size: 18px;
  margin-bottom: 10px;
  color: #fff;
  transition: color 0.3s ease;
}

.product-card:hover h3 {
  color: var(--red);
}

.product-card p {
  font-size: 14px;
  opacity: 0.7;
  margin-bottom: 15px;
  line-height: 1.5;
}

.product-card .price {
  font-weight: 700;
  color: #fff;
  font-size: 18px;
  margin-bottom: 10px;
}

/* قسم معلومات المخزون */
.product-card .stock-info {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.product-card .stock-info.out-of-stock {
  border-color: rgba(211, 47, 47, 0.3);
  background: rgba(211, 47, 47, 0.05);
}

.product-card .stock-count {
  display: flex;
  align-items: center;
  gap: 5px;
}

.product-card .stock-label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.product-card .stock-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--sand);
}

.product-card .stock-value.out-of-stock {
  color: #ff6b6b;
}

/* تنسيقات شارات المخزون */
.stock-badge {
  position: absolute;
  bottom: 10px;
  left: 10px; /* تغيير من اليمين إلى اليسار */
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  z-index: 2;
  opacity: 0.9;
}

.stock-badge.in-stock {
  background-color: rgba(46, 125, 50, 0.8);
  color: white;
}

.stock-badge.low-stock {
  background-color: rgba(255, 152, 0, 0.9);
  color: white;
  border: 2px solid #ff6d00;
  box-shadow: 0 2px 6px rgba(255, 109, 0, 0.4);
  animation: pulse-attention 2s infinite;
}

@keyframes pulse-attention {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.stock-badge.out-of-stock {
  background-color: rgba(211, 47, 47, 0.8);
  color: white;
}

/* تنسيقات عناصر الكمية المعطلة */
.quantity-controls.disabled {
  opacity: 0.6;
}

.shop-btn.disabled {
  background: #888;
  cursor: not-allowed;
  opacity: 0.7;
}

.shop-btn.disabled:hover {
  background: #777;
  transform: none;
  box-shadow: none;
}

.quantity-btn[disabled] {
  background: rgba(0, 0, 0, 0.2);
  cursor: not-allowed;
}

.quantity-input[disabled] {
  background: rgba(0, 0, 0, 0.05);
  cursor: not-allowed;
}

.product-card .actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
}

.shop-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(45deg, var(--red), var(--red-2));
  color: #fff;
  padding: 14px 25px;
  border-radius: 50px;
  font-weight: 700;
  transition: all 0.3s ease;
  width: 100%;
  text-align: center;
  box-shadow: 0 4px 15px rgba(209, 0, 0, 0.25);
  letter-spacing: 0.5px;
  font-size: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.shop-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(209, 0, 0, 0.4);
  background: linear-gradient(45deg, var(--red-2), var(--red-3));
}

.shop-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 5px 10px rgba(209, 0, 0, 0.3);
}

/* No Results Styling */
.no-results {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px 0;
}

.no-results-content {
  text-align: center;
  max-width: 600px;
  padding: 40px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.02);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.no-results-content .icon {
  font-size: 4rem;
  color: var(--red);
  margin-bottom: 20px;
  display: inline-block;
  opacity: 0.5;
}

.no-results-content h3 {
  margin-bottom: 15px;
  font-size: 1.8rem;
}

.no-results-content p {
  margin-bottom: 25px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
}

.btn-secondary {
  background: transparent;
  color: var(--red);
  border: 2px solid var(--red);
  padding: 12px 30px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Tajawal', sans-serif;
}

.btn-secondary:hover {
  background: rgba(209, 0, 0, 0.1);
  transform: translateY(-3px);
}

/* ===== Footer ===== */
.site-footer {
  background: linear-gradient(180deg, #0b0b0b, #060606);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 70px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
}

.footer-grid h4 {
  margin: 0 0 20px;
  font-size: 20px;
  position: relative;
  display: inline-block;
  padding-bottom: 12px;
}

.footer-grid h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 60%;
  height: 2px;
  background: var(--red);
  opacity: 0.7;
}

.footer-grid p {
  margin: 0 0 15px;
  line-height: 1.6;
  opacity: 0.8;
}

.footer-logo {
  margin-bottom: 20px;
}

.footer-logo-img {
  height: 70px;
  width: auto;
}

.socials {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.socials a {
  display: inline-flex;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.socials a:hover {
  background: rgba(209, 0, 0, 0.15);
  border-color: var(--red);
  transform: translateY(-5px);
}

.copyright {
  text-align: center;
  padding-top: 40px;
  margin-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  opacity: 0.7;
  font-size: 14px;
}

/* Utility Classes */
.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--red), var(--red-2));
  color: #fff;
  padding: 15px 35px;
  border-radius: 50px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(209, 0, 0, 0.2);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(209, 0, 0, 0.3);
}

.btn-primary:active {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(209, 0, 0, 0.3);
}

/* Animation Classes */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s ease, transform 1s ease;
}

.fade-in.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .slide-title {
    font-size: 3rem;
  }
}

@media (max-width: 992px) {
  .search-filter-flex {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-bar {
    max-width: 100%;
  }
  
  .slide-title {
    font-size: 2.5rem;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (max-width: 768px) {
  .site-header .container {
    height: 70px;
  }
  
  .hero-slider {
    height: 80vh;
    min-height: 500px;
    margin-top: 70px;
  }
  
  .search-filter-container {
    top: 70px;
  }
  
  .slide-title {
    font-size: 2rem;
  }
  
  .slide-subtitle {
    font-size: 1.2rem;
  }
  
  .slider-arrows {
    display: none;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
  }
  
  /* تصغير badge في الشاشات المتوسطة */
  .stock-badge {
    padding: 4px 8px;
    font-size: 11px;
    bottom: 8px;
    left: 8px;
  }
  
  /* تصغير category badge في الشاشات المتوسطة */
  .category-badge {
    padding: 5px 10px;
    font-size: 0.7rem;
    top: 10px;
    right: 10px;
    gap: 5px;
  }
  
  .category-badge .category-icon {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 576px) {
  .logo {
    height: 40px;
  }
  
  .hero-slider {
    height: 70vh;
    min-height: 400px;
  }
  
  .slide-title {
    font-size: 1.8rem;
  }
  
  .slide-subtitle {
    font-size: 1rem;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
  }
  
  .product-card .content {
    padding: 15px;
  }
  
  .product-card h3 {
    font-size: 16px;
  }
  
  .shop-btn {
    padding: 10px 20px;
    font-size: 14px;
  }
  
  /* تصغير badge أكثر في الجوال */
  .stock-badge {
    padding: 3px 6px;
    font-size: 9px;
    bottom: 6px;
    left: 6px;
    border-radius: 3px;
  }
  
  /* تصغير category badge أكثر في الجوال */
  .category-badge {
    padding: 4px 8px;
    font-size: 0.6rem;
    top: 8px;
    right: 8px;
    gap: 4px;
    border-radius: 20px;
  }
  
  .category-badge .category-icon {
    width: 14px;
    height: 14px;
  }
}

/* تنسيقات للشاشات الصغيرة جداً */
@media (max-width: 400px) {
  .stock-badge {
    padding: 2px 5px;
    font-size: 8px;
    bottom: 5px;
    left: 5px;
    border-radius: 2px;
    opacity: 0.85;
  }
  
  /* تصغير category badge للشاشات الصغيرة جداً */
  .category-badge {
    padding: 3px 6px;
    font-size: 0.55rem;
    top: 6px;
    right: 6px;
    gap: 3px;
    border-radius: 15px;
  }
  
  .category-badge .category-icon {
    width: 12px;
    height: 12px;
  }
}
