/* Coffee Shop Arabic CSS */
:root {
  --primary-color: #6F4E37;
  --secondary-color: #8B5A3C;
  --accent-color: #D4A574;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --gray-color: #6c757d;
}

/* Base Styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--dark-color);
  background-color: #fafafa;
}

/* Header Styles */
.header {
  background-color: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.top-bar {
  background-color: var(--primary-color);
  color: #fff;
  padding: 8px 0;
  font-size: 0.9rem;
}

.social-links a {
  color: #fff;
  margin-left: 10px;
  transition: color 0.3s;
}

.social-links a:hover {
  color: var(--accent-color);
}

.phone {
  color: #fff;
}

.navbar {
  background-color: #fff !important;
  padding: 1rem 0;
}

.navbar-brand img {
  height: 40px;
}

.navbar-nav .nav-link {
  color: var(--dark-color) !important;
  font-weight: 500;
  margin: 0 10px;
  transition: color 0.3s;
}

.navbar-nav .nav-link:hover {
  color: var(--primary-color) !important;
}

.search-form {
  position: relative;
  display: flex;
  align-items: center;
}

.search-form input {
  border-radius: 20px;
  border: 1px solid #ddd;
  padding-left: 40px;
  width: 200px;
}

.search-form button {
  position: absolute;
  left: 10px;
  border: none;
  background: none;
  color: var(--gray-color);
}

.cart-icon {
  position: relative;
  color: var(--primary-color);
  font-size: 1.2rem;
  text-decoration: none;
}

.cart-count {
  position: absolute;
  top: -8px;
  left: -8px;
  background-color: var(--danger-color);
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
}

/* Hero Section */
.hero-section {
  margin-bottom: 3rem;
}

.carousel-item {
  height: 500px;
  position: relative;
}

.carousel-item img {
  object-fit: cover;
  height: 100%;
  width: 100%;
}

.carousel-placeholder {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.carousel-content {
  text-align: center;
  color: #fff;
  max-width: 600px;
  padding: 2rem;
}

.carousel-content h1 {
  font-size: 3rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.carousel-content p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

/* Section Styles */
.section-title {
  color: var(--primary-color);
  font-weight: bold;
  margin-bottom: 1rem;
}

.section-subtitle {
  color: var(--gray-color);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

/* Category Cards */
.categories-section {
  background-color: #fff;
  padding: 4rem 0;
}

.category-card {
  display: block;
  text-align: center;
  text-decoration: none;
  color: var(--dark-color);
  transition: transform 0.3s;
}

.category-card:hover {
  transform: translateY(-5px);
  color: var(--primary-color);
}

.category-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
}

.category-placeholder {
  background-color: var(--light-color);
  width: 100%;
  height: 120px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--gray-color);
}

.category-card h5 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Product Cards */
.featured-products,
.best-sellers,
.new-products {
  padding: 4rem 0;
}

.product-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  height: 100%;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.product-image {
  position: relative;
  height: 250px;
  overflow: hidden;
}

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

.product-placeholder {
  background-color: var(--light-color);
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--gray-color);
}

.product-placeholder-large {
  background-color: var(--light-color);
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--gray-color);
}

.product-placeholder-sm {
  background-color: var(--light-color);
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--gray-color);
  border-radius: 5px;
}

.product-placeholder-xs {
  background-color: var(--light-color);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--gray-color);
  border-radius: 3px;
}

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

.product-actions {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.3s;
}

.product-card:hover .product-actions {
  opacity: 1;
}

.btn-add-cart,
.btn-quick-view {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background-color: #fff;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: all 0.3s;
  text-decoration: none;
}

.btn-add-cart:hover,
.btn-quick-view:hover {
  background-color: var(--primary-color);
  color: #fff;
  transform: scale(1.1);
}

.sale-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: var(--danger-color);
  color: #fff;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: bold;
}

.best-seller-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--warning-color);
  color: #fff;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: bold;
}

.new-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--success-color);
  color: #fff;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: bold;
}

.featured-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background-color: var(--info-color);
  color: #fff;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: bold;
}

.product-info {
  padding: 1rem;
}

.product-category {
  color: var(--gray-color);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-name {
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.product-name a {
  color: var(--dark-color);
  text-decoration: none;
}

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

.product-meta {
  color: var(--gray-color);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.product-flavors {
  color: var(--gray-color);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.product-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

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

.original-price {
  color: var(--gray-color);
  text-decoration: line-through;
  font-size: 0.9rem;
}

.stock-warning {
  color: var(--warning-color);
  font-size: 0.85rem;
  margin: 0;
}

.stock-out {
  color: var(--danger-color);
  font-size: 0.85rem;
  margin: 0;
}

/* Filter Sidebar */
.filter-sidebar {
  background: #fff;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.filter-section {
  margin-bottom: 2rem;
}

.filter-section h5 {
  color: var(--primary-color);
  font-weight: bold;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-color);
}

.filter-section ul {
  list-style: none;
  padding: 0;
}

.filter-section ul li {
  margin-bottom: 0.5rem;
}

.filter-section ul li a {
  color: var(--dark-color);
  text-decoration: none;
  transition: color 0.3s;
  display: block;
  padding: 5px 10px;
  border-radius: 5px;
}

.filter-section ul li a:hover,
.filter-section ul li a.active {
  color: var(--primary-color);
  background-color: rgba(111, 78, 55, 0.1);
}

/* Products Header & Sort Dropdown */
.products-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(111, 78, 55, 0.12);
}

.products-header-title {
  margin: 0;
  font-size: 1.75rem;
  color: var(--primary-color);
}

.sort-dropdown {
  flex-shrink: 0;
}

.sort-dropdown-form {
  margin: 0;
}

.sort-dropdown-control {
  position: relative;
  margin: 0;
  padding: 0.5rem 0.5rem 0.5rem 1rem;
  background: #fff;
  border: 1px solid rgba(111, 78, 55, 0.18);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(111, 78, 55, 0.08);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  min-width: 260px;
}

.sort-dropdown-display {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  pointer-events: none;
  user-select: none;
}

.sort-dropdown-control:hover {
  border-color: var(--accent-color);
  box-shadow: 0 4px 14px rgba(111, 78, 55, 0.14);
}

.sort-dropdown-control:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(111, 78, 55, 0.12);
}

.sort-dropdown-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  background: rgba(111, 78, 55, 0.08);
  border-radius: 8px;
  color: var(--primary-color);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.sort-dropdown-label i {
  font-size: 0.75rem;
  opacity: 0.85;
}

.sort-dropdown-value {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--dark-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sort-dropdown-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  opacity: 0;
  cursor: pointer;
  outline: none;
  z-index: 1;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.sort-dropdown-select option,
.sort-dropdown-select optgroup {
  font-weight: 500;
  color: var(--dark-color);
}

.sort-dropdown-chevron {
  color: var(--primary-color);
  font-size: 0.7rem;
  opacity: 0.7;
  padding-left: 0.35rem;
  flex-shrink: 0;
  pointer-events: none;
  transition: transform 0.2s ease;
}

.sort-dropdown-control:focus-within .sort-dropdown-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

/* Features Section */
.features-section {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #fff;
  padding: 4rem 0;
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--accent-color);
}

.features-section h5 {
  margin-bottom: 0.5rem;
}

.features-section p {
  margin-bottom: 0;
  opacity: 0.9;
}

/* Footer */
.footer {
  background-color: var(--dark-color);
  color: #fff;
  padding: 3rem 0 1rem;
}

.footer h5 {
  color: var(--accent-color);
  margin-bottom: 1rem;
}

.footer ul {
  list-style: none;
  padding: 0;
}

.footer ul li {
  margin-bottom: 0.5rem;
}

.footer ul li a {
  color: #ccc;
  text-decoration: none;
  transition: color 0.3s;
}

.footer ul li a:hover {
  color: var(--accent-color);
}

.contact-info li {
  display: flex;
  align-items: center;
  margin-bottom: 0.8rem;
}

.contact-info i {
  margin-left: 10px;
  color: var(--accent-color);
}

/* Product Gallery */
.thumbnail-images img {
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid transparent;
}

.thumbnail-images img.active,
.thumbnail-images img:hover {
  border-color: var(--primary-color);
}

/* Product Details */
.product-title {
  color: var(--primary-color);
  font-weight: bold;
  margin-bottom: 1rem;
}

.product-description {
  color: var(--gray-color);
  line-height: 1.8;
}

.flavor-notes {
  background-color: var(--light-color);
  padding: 1rem;
  border-radius: 8px;
  border-right: 4px solid var(--accent-color);
}

.product-specs {
  background-color: var(--light-color);
  padding: 1rem;
  border-radius: 8px;
}

.quantity-selector {
  max-width: 200px;
}

.product-features ul li {
  padding: 5px 0;
}

.discount-badge {
  background-color: var(--danger-color);
  color: #fff;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.8rem;
  font-weight: bold;
}

/* Cart Styles */
.cart-item {
  border: none;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.cart-summary {
  position: sticky;
  top: 20px;
}

.summary-item,
.summary-total {
  padding: 10px 0;
}

.summary-total {
  border-top: 2px solid var(--accent-color);
  padding-top: 15px;
}

.promo-code {
  margin-bottom: 1rem;
}

.badge-item {
  padding: 1rem;
}

.trust-badges .badge-item {
  transition: transform 0.3s;
}

.trust-badges .badge-item:hover {
  transform: translateY(-3px);
}

/* Empty Cart */
.empty-cart {
  padding: 4rem 2rem;
}

/* Checkout Styles */
.checkout-form .card {
  border: none;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.checkout-form .card-header {
  background-color: var(--primary-color);
  border-bottom: none;
}

.order-item img {
  border-radius: 8px;
}

.payment-option {
  padding: 10px;
  border-radius: 8px;
  transition: background-color 0.3s;
}

.payment-option:hover {
  background-color: var(--light-color);
}

.security-notice {
  border-right: 4px solid var(--success-color);
}

/* Success Page */
.order-success {
  text-align: center;
  padding: 4rem 2rem;
}

.success-icon {
  font-size: 4rem;
  color: var(--success-color);
  margin-bottom: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .carousel-content h1 {
      font-size: 2rem;
  }

  .carousel-content p {
      font-size: 1rem;
  }

  .product-actions {
      opacity: 1;
      top: auto;
      bottom: 10px;
      right: 50%;
      transform: translateX(50%);
      flex-direction: row;
  }

  .search-form input {
      width: 150px;
  }

  .navbar-nav {
      text-align: center;
      margin-top: 1rem;
  }

  .filter-sidebar {
      margin-bottom: 2rem;
  }

  .products-header {
      flex-direction: column;
      align-items: stretch;
  }

  .products-header-title {
      font-size: 1.5rem;
      text-align: center;
  }

  .sort-dropdown,
  .sort-dropdown-control {
      width: 100%;
      min-width: 0;
  }
}

/* RTL Specific Adjustments */
.text-md-start {
  text-align: right !important;
}

.dropdown-menu-start {
  right: 0 !important;
  left: auto !important;
}

.me-auto {
  margin-right: auto !important;
  margin-left: 0 !important;
}

.me-2 {
  margin-left: 0.5rem !important;
  margin-right: 0 !important;
}

.me-3 {
  margin-left: 1rem !important;
  margin-right: 0 !important;
}

.ms-2 {
  margin-right: 0.5rem !important;
  margin-left: 0 !important;
}

.ms-3 {
  margin-right: 1rem !important;
  margin-left: 0 !important;
}

/* Animation Classes */
@keyframes fadeIn {
  from {
      opacity: 0;
      transform: translateY(20px);
  }
  to {
      opacity: 1;
      transform: translateY(0);
  }
}

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

/* Loading Spinner */
.spinner {
  border: 4px solid var(--light-color);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--light-color);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}
