/* Luxury Navbar - RTL */
.luxury-navbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  transition: all 0.3s ease;
  font-family: 'Vazirmatn', sans-serif;

}

.luxury-navbar.scrolled {
  background: rgba(0, 0, 0, 0.95);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.navbar-brand {
  display: flex;
  align-items: center;
}

.logo {
  height: 50px;
  width: auto;
  transition: transform 0.3s;
  border-radius : 12px;
}

.logo:hover {
  transform: scale(1.05);
}

.navbar-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Mobile Menu Scroll Fix */
.navbar-menu.active {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  max-height: calc(100vh - 70px) !important;
}

body.menu-open {
  overflow: hidden;
}

/* Dropdown Menu Scroll */
.navbar-menu.active .dropdown-menu {
  max-height: 300px !important; /* Limit height */
  overflow-y: auto !important;
}

.nav-link {
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  position: relative;
  transition: color 0.3s;
  display: block;
  color: #fff !important; /* Force white text */
  padding: 25px 20px !important; /* Increased spacing */
  margin: 0 5px; /* Added margin between items */
  letter-spacing: 0.5px; /* Better Persian readability */
}

.nav-link:hover {
  color: #D4AF37;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 15px;
  width: 0;
  height: 2px;
  background: #D4AF37;
  transition: width 0.3s;
}

.nav-link:hover::after {
  width: calc(100% - 30px);
}

/* Dropdown Menu */
.dropdown {
  position: relative;
}

.dropdown-menu {
  display: block !important;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  position: absolute;
  right: 0;
  top: 100%;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  color: black;
  padding: 12px 20px;
  display: block;
  text-decoration: none;
  transition: all 0.3s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-menu a:hover {
  color: #D4AF37;
  background: rgba(212, 175, 55, 0.05);
}

/* Navbar Icons */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Common styles for all action items (buttons and links) */
.navbar-actions .search-btn,
.navbar-actions .cart-btn,
.navbar-actions .user-action-btn { /* Targets <a> and <button> with this class */
  background: transparent;
  border: none;
  color: #D4AF37; /* For text, SVG fill is separate */
  cursor: pointer;
  padding: 5px; /* Consistent padding */
  transition: transform 0.3s;
  display: inline-flex; /* Make each item a flex container for its own content (like SVG) */
  align-items: center;   /* Align content (SVG) vertically within the button/link */
  justify-content: center; /* Align content (SVG) horizontally within the button/link */
  line-height: 1; /* Can help normalize height differences sometimes */
  text-decoration: none; /* For <a> tags */
  position: relative; /* For absolutely positioned children like cart-count */
}

/* Style for the logout form to behave like other inline flex items */
.navbar-actions .logout-form-inline {
  display: inline-flex; /* Make the form itself an inline-flex item */
  align-items: center;   /* Align its content (the button) vertically */
  margin: 0; /* Remove default form margins */
  padding: 0; /* Remove default form paddings */
}

.cart-count {
  position: absolute;
  top: -5px;
  left: -5px;
  background: #D4AF37;
  color: #000;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.search-btn:hover,
.wishlist-btn:hover,
.cart-btn:hover,
.user-action-btn:hover {
  transform: scale(1.1);
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  width: 30px;
  height: 20px;
  flex-direction: column;
  justify-content: space-between;
  padding: 0;
  cursor: pointer;
}

.mobile-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: #D4AF37;
  transition: all 0.3s;
}

/* Responsive */
@media (max-width: 992px) {
  .navbar-menu {
    position: fixed;
    top: 70px;
    right: -100%;
    width: 60%;
    max-width: 300px;
    height: calc(100vh - 70px);
    background: #0a0a0a;
    flex-direction: column;
    align-items: flex-end;
    padding: 20px;
    border-left: 1px solid rgba(212, 175, 55, 0.2);
    transition: right 0.3s;
  }

  .navbar-menu.active {
    right: 0;
  }

  .nav-link {
    padding: 15px 0;
  }

  .dropdown-menu {
    position: static;
    width: 100%;
    border: none;
    box-shadow: none;
    transform: none;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
  }

  .dropdown-menu[style*="visibility: visible"] {
    max-height: 500px;
    padding: 10px 0;
  }

  .dropdown-item {
    padding: 12px 25px !important;
  }

  .dropdown:hover .dropdown-menu {
    display: block;
  }

  .mobile-toggle {
    display: flex;
  }
}

 /* Luxury Footer - RTL */
.luxury-footer {
  background: #0a0a0a;
  color: #aaa;
  font-family: 'Vazirmatn', sans-serif;
  border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.footer-column {
  min-width: 0; /* Prevent overflow */
}

@media (max-width: 768px) {
  .footer-column {
    margin-bottom: 30px;
  }

  .footer-column:last-child {
    margin-bottom: 0;
  }
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.footer-logo {
  width: 120px;
  margin-bottom: 20px;
  filter: brightness(0) invert(0.8);
}

.brand-tagline {
  font-size: 0.9rem;
  margin: 0 0 25px 0;
  line-height: 1.6;
}

.social-links {
  display: flex;
  gap: 15px;
}

.social-links a {
  color: #D4AF37;
  transition: opacity 0.3s;
}

.social-links a:hover {
  opacity: 0.7;
}

.footer-title {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.footer-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 40px;
  height: 1px;
  background: #D4AF37;
  font-size: 1.1rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  color: #aaa;
  text-decoration: none;
  transition: color 0.3s;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: #D4AF37;
}

.contact-info {
  font-style: normal;
  margin-bottom: 30px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  font-size: 0.9rem;
}

.payment-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.payment-methods img {
  height: 25px;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.payment-methods img:hover {
  opacity: 1;
}

.newsletter-form {
  display: flex;
  margin-bottom: 15px;
}

.newsletter-form input {
  flex: 1;
  background: #1a1a1a;
  border: 1px solid #333;
  padding: 10px 15px;
  color: #fff;
  font-family: 'Vazirmatn', sans-serif;
}

.newsletter-form button {
  background: #D4AF37;
  color: #000;
  border: none;
  padding: 0 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'Vazirmatn', sans-serif;
  transition: background 0.3s;
}

.newsletter-form button:hover {
  background: #e8c252;
  display: flex;
  flex-direction: column;
}

@media (min-width: 577px) {
  .newsletter-form {
    flex-direction: row; /* Side by side on larger screens */
  }
}

.newsletter-form input {
  width: 100%;
  margin-bottom: 10px; /* Space between input and button on mobile */
}

@media (min-width: 577px) {
  .newsletter-form input {
    margin-bottom: 0;
    margin-left: 10px; /* Space between input and button on desktop */
  }
}

.newsletter-note {
  font-size: 0.8rem;
  color: #666;
  margin: 0;
}

.footer-bottom {
  border-top: 1px solid rgba(212, 175, 55, 0.1);
  padding: 20px 0;
}

.footer-bottom-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  flex-direction: column;
  text-align: center;
  gap: 15px;
}

.legal-links {
  display: flex;
  gap: 20px;
}

.legal-links a {
  color: #666;
  text-decoration: none;
  transition: color 0.3s;
}

.legal-links a:hover {
  color: #D4AF37;
}

/* Responsive */
@media (max-width: 768px) {
  .footer-container {
    grid-template-columns: 1fr 1fr; /* 2 columns on tablet */
    gap: 30px;
    padding: 40px 20px;
  }
}

@media (max-width: 576px) {
  .footer-container {
    grid-template-columns: 1fr; /* 1 column on mobile */
    gap: 20px;
    padding: 30px 15px;
  }
}

  .footer-bottom-content {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }




 /* Mega Menu Base */
/* Prevent body scroll when mega menu is open */
body.mega-menu-open {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
}

.mega-dropdown {
  position: static !important; /* Critical for full-width */
}

.mega-menu {
  position: absolute;
  left: 0;
  right: 0;
  background: #1a1a1a;
  border-top: 1px solid rgba(212, 175, 55, 0.2);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1000;
  padding: 30px 0;
}

.mega-dropdown:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mega-menu-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  padding: 0 20px;
}

/* Columns */
.mega-menu-column {
  border-right: 1px solid rgba(255,255,255,0.05);
  padding-right: 30px;
}

.mega-menu-column:last-child {
  border-right: none;
}

.mega-menu-title {
  color: #D4AF37;
  font-size: 1.1rem;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.mega-menu-column ul {
  list-style: none;
  padding: 0;
}

.mega-menu-column li {
  margin-bottom: 12px;
}

.mega-menu-column a {
  color: #ddd;
  text-decoration: none;
  transition: color 0.3s;
  display: block;
  padding: 8px 0;
}

.mega-menu-column a:hover {
  color: #D4AF37;
}

/* Product Showcase */
.mega-menu-product {
  position: relative;
  border: 1px solid rgba(212, 175, 55, 0.2);
  padding: 20px;
  transition: transform 0.3s;
}

.mega-menu-product:hover {
  transform: translateY(-5px);
}

.mega-menu-product img {
  width: 100%;
  height: auto;
  margin-bottom: 15px;
}

.product-details {
  text-align: center;
}

.badge {
  background: #D4AF37;
  color: #000;
  padding: 3px 10px;
  font-size: 0.8rem;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 10px;
}

.view-button {
  background: transparent;
  color: #D4AF37;
  border: 1px solid #D4AF37;
  padding: 5px 15px;
  font-size: 0.9rem;
  margin-top: 10px;
  display: inline-block;
}

/* Promo Banner */
.promo-banner {
  background-size: cover;
  background-position: center;
  height: 100%;
  min-height: 200px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
}

.promo-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}

.promo-banner p {
  color: #fff;
  position: relative;
  z-index: 1;
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.promo-button {
  background: #D4AF37;
  color: #000;
  padding: 8px 15px;
  text-decoration: none;
  position: relative;
  z-index: 1;
  display: inline-block;
  font-size: 0.9rem;
}

/* Mobile Adaptation */
@media (max-width: 992px) {
  .mega-menu {
    max-height: 60vh !important; /* Limit height */
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch; /* Smooth iOS scrolling */
    overscroll-behavior: contain; /* Prevent page scroll behind */
    position: fixed; !important;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    padding: 0;
    box-shadow: none;
    background: #1a1a1a;
  }

  .mega-menu-container {
    display: block !important;
    height: auto !important;
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .mega-dropdown.active .mega-menu {
    display: block;
    animation: fadeIn 0.3s;
  }

  .mega-menu-column {
    border-left: none !important;
    margin-bottom: 30px;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 0 0 20px 0;
  }

  .mega-dropdown.active .mega-menu {
    display: block;
  }
    @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

/* Loading animation for dynamic content */
.loading-placeholder {
  background: linear-gradient(90deg, #1a1a1a 25%, #222 50%, #1a1a1a 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Prevent layout shift for lazy-loaded images */
img[loading="lazy"] {
  background: #1a1a1a;
  transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
  opacity: 1;
}
/* Ensure proper stacking */
.luxury-navbar { z-index: 1000; }
.mega-menu { z-index: 999; }
.dropdown-menu { z-index: 998; }


/* Search Overlay Styling */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 10, 0.97); /* Dark, slightly transparent background */
  backdrop-filter: blur(10px);
  z-index: 2000; /* Higher than navbar */
  display: flex;
  flex-direction: column; /* To allow close button at top and content below */
  align-items: center;
  justify-content: flex-start; /* Start content from the top */
  padding-top: 10vh; /* Push content down a bit */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
  font-family: 'Vazirmatn', sans-serif;
  direction: rtl; /* Right-to-left for Persian */
}

.search-overlay.active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0s linear 0s;
}

.close-search-btn {
  position: absolute;
  top: 30px;
  right: 40px; /* For RTL */
  background: transparent;
  border: none;
  color: #D4AF37;
  font-size: 3rem; /* Large close icon */
  font-weight: 300;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: transform 0.3s ease;
}
.close-search-btn:hover {
    transform: scale(1.1) rotate(90deg);
}


.search-overlay-content {
  width: 100%;
  max-width: 700px; /* Max width of the search content area */
  text-align: center;
  position: relative;
}

.site-search-form {
  display: flex;
  width: 100%;
  border-bottom: 2px solid rgba(212, 175, 55, 0.5); /* Gold underline for the form */
  margin-bottom: 30px;
}

#search-input-overlay {
  flex-grow: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 2rem; /* Large font for search input */
  padding: 15px 10px;
  outline: none;
  text-align: right; /* For Persian placeholder */
}

#search-input-overlay::placeholder {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 300;
}

.search-submit-btn-overlay {
  background: transparent;
  border: none;
  color: #D4AF37;
  padding: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-submit-btn-overlay svg {
    width: 28px;
    height: 28px;
}


.search-suggestions {
  margin-top: 20px;
  text-align: right; /* For Persian suggestions */
  max-height: 50vh;
  overflow-y: auto;
}
.search-suggestions a {
    display: block;
    padding: 10px 15px;
    color: #ccc;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.search-suggestions a:hover {
    background-color: rgba(212, 175, 55, 0.1);
    color: #D4AF37;
}
.search-suggestions a:last-child {
    border-bottom: none;
}

/* Prevent body scroll when overlay is active */
body.search-overlay-active {
    overflow: hidden;
}

.featured-product-grid {
  display: grid;
  /*
    Adjust minmax values based on the available width in your mega menu column
    and how many items you typically want to show.
    Example: If the column is around 400-500px wide, maybe 2 items.
    minmax(150px, 1fr) might allow 2-3 items.
  */
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); /* Adjust 160px as needed */
  gap: 15px; /* Smaller gap for mega menu */
}

/* Individual Featured Product Item Styling */
.mega-menu-product-item {
  background-color: rgba(255, 255, 255, 0.03); /* Very subtle background */
  border: 1px solid rgba(212, 175, 55, 0.1);
  border-radius: 6px;
  overflow: hidden; /* To contain image and ensure clean look */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex; /* To make the link fill the item */
  flex-direction: column;
}

.mega-menu-product-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(212, 175, 55, 0.08);
}

.mega-product-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Make the link take up all available space in the flex item */
  padding: 10px;
}

.mega-product-image {
  width: 100%;
  height: 100px; /* Adjust based on your design for mega menu item images */
  object-fit: contain;
  margin-bottom: 10px;
  border-radius: 4px;
}
.mega-product-no-image {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0,0,0,0.2);
    color: #888;
    margin-bottom: 10px;
    border-radius: 4px;
    font-size: 0.8rem;
}


.mega-product-details {
  text-align: right; /* For RTL */
  flex-grow: 1; /* Allows details to take up space, pushing button down if any */
  display: flex;
  flex-direction: column;
  padding-right: 24px;
}

.mega-product-badge {
  background: #D4AF37;
  color: #000;
  padding: 2px 8px;
  font-size: 0.65rem; /* Smaller badge */
  border-radius: 10px;
  display: inline-block;
  margin-bottom: 6px;
  align-self: flex-start; /* For RTL, start of line */
}

.mega-product-name {
  font-size: 0.9rem; /* Smaller font for mega menu */
  color: #ddd;
  margin-bottom: 5px;
  font-weight: 500;
  line-height: 1.3;
  flex-grow: 1; /* Allows name to take available vertical space */
}

/* If you add price */

.mega-product-price {
  font-size: 0.95rem;
  color: #D4AF37;
  font-weight: bold;
  margin-top: auto;
  margin-bottom: 8px;
}


/* If you keep the separate view-button style from your original mega-menu */
.mega-menu-column .view-button { /* Scope it to the mega menu column */
  background: transparent;
  color: #D4AF37;
  border: 1px solid #D4AF37;
  padding: 4px 10px; /* Smaller padding */
  font-size: 0.75rem; /* Smaller font */
  margin-top: 8px;
  display: inline-block;
  text-decoration: none;
  border-radius: 3px;
  transition: background-color 0.2s, color 0.2s;
}
.mega-menu-column .view-button:hover {
    background-color: #D4AF37;
    color: #0a0a0a;
}


.no-featured-products {
  color: #888;
  font-size: 0.9rem;
  padding: 20px 0;
  text-align: center;
}

.category-grid {
  display: grid;
  /*
    Adjust minmax values. Since category links are usually shorter,
    you can fit more per row.
    minmax(100px, 1fr) could allow 3-4 items in a typical column width.
  */
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* Adjust 120px as needed */
  gap: 10px; /* Gap between category links */
  margin-top: 10px; /* Space below the title */
}

/* Individual Category Link Styling (Grid Item) */
.category-grid-item {
  display: block; /* Make the link a block to fill its grid cell */
  padding: 8px 12px;
  text-decoration: none;
  color: #ccc; /* Light color for category text */
  background-color: rgba(255, 255, 255, 0.03); /* Very subtle background */
  width: 120px;
  height: 40px;
  border: 1px solid rgba(212, 175, 55, 0.08);
  border-radius: 4px;
  text-align: center; /* For RTL */
  font-size: 0.85rem;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap; /* Prevent text from wrapping if names are long */
  overflow: hidden;
  text-overflow: ellipsis; /* Add ... if text is too long */
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.category-grid-item:hover {
  background-color: rgba(212, 175, 55, 0.1);
  color: #D4AF37; /* Gold color on hover */
  border-color: rgba(212, 175, 55, 0.3);
}

.no-categories {
  color: #888;
  font-size: 0.9rem;
  padding: 10px 0;
  /* If you want it to span across grid columns if it's the only item */
  /* grid-column: 1 / -1; */
  text-align: center;
}