/**
 * INDRU PERFUMES — Master Responsive Design System
 * 100% Dynamic & Fluid Scaling across Mobile, Tablet, Laptop & Desktop
 * Eliminates horizontal scroll, viewport scale-out, and input auto-zoom
 */

/* ==============================================================
   1. GLOBAL RESPONSIVE RESETS & OVERFLOW GUARDS
   ============================================================== */
html {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden !important;
  max-width: 100% !important;
  position: relative;
  width: 100%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Guard media from causing viewport overflows */
img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  max-width: 100% !important;
  height: auto;
}

/* Prevent long words or URLs from stretching the page */
p, span, h1, h2, h3, h4, h5, h6, a, li, td, th {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Ensure containers don't produce unintended horizontal gutters */
.container,
.container-fluid {
  width: 100% !important;
  padding-right: var(--bs-gutter-x, 1rem);
  padding-left: var(--bs-gutter-x, 1rem);
  margin-right: auto;
  margin-left: auto;
}

/* ==============================================================
   2. PREVENT AUTO-ZOOM ON MOBILE INPUT FOCUS (iOS SAFARI FIX)
   ============================================================== */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="number"],
  input[type="search"],
  input[type="url"],
  input[type="date"],
  input[type="time"],
  select,
  textarea,
  .form-control,
  .form-select {
    font-size: 16px !important; /* Disables iOS auto-zoom */
  }
}

/* ==============================================================
   3. TABLET LANDSCAPE & COMPACT LAPTOPS (992px to 1199.98px)
   ============================================================== */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .navbar-luxury {
    white-space: normal !important;
    padding: 10px 0;
  }

  .navbar-luxury .container-fluid {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .brand-logo-img {
    height: 36px !important;
  }

  .navbar-luxury .navbar-nav {
    gap: 0px !important;
  }

  .nav-link-luxury {
    font-size: 12px !important;
    padding: 6px 8px !important;
    letter-spacing: 0.02em !important;
  }

  .nav-action-btn {
    width: 34px !important;
    height: 34px !important;
    font-size: 13px !important;
  }

  .hero-luxury {
    min-height: auto;
    padding: 70px 0 90px;
  }

  .hero-title {
    font-size: 3rem !important;
  }

  .hero-image-showcase-wrapper {
    max-width: 380px;
  }
}

/* ==============================================================
   4. TABLETS & MOBILE DEVICES (<= 991.98px)
   ============================================================== */
@media (max-width: 991.98px) {
  /* Navigation Bar */
  .navbar-luxury {
    white-space: normal !important;
    padding: 10px 0;
  }

  .brand-logo-img {
    height: 38px;
  }

  .navbar-collapse {
    background: #100C09;
    border: 1px solid var(--gold-border);
    border-radius: 14px;
    padding: 18px;
    margin-top: 14px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.95);
    max-height: 80vh;
    overflow-y: auto;
  }

  .navbar-luxury .navbar-nav {
    flex-direction: column !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 4px !important;
    white-space: normal !important;
    width: 100% !important;
  }

  .navbar-luxury .nav-item {
    width: 100% !important;
    white-space: normal !important;
  }

  .nav-link-luxury {
    padding: 10px 14px !important;
    display: block !important;
    width: 100% !important;
    white-space: normal !important;
    font-size: 15px !important;
    border-radius: 8px;
  }

  .nav-link-luxury:hover {
    background: rgba(212, 175, 55, 0.08);
  }

  .nav-link-luxury::after {
    display: none !important;
  }

  .dropdown-menu-luxury {
    background: #18120D !important;
    border: 1px solid var(--gold-border) !important;
    position: static !important;
    box-shadow: none !important;
    margin-top: 5px !important;
    margin-bottom: 5px !important;
    padding: 8px !important;
  }

  /* Hero Section */
  .hero-luxury {
    min-height: auto;
    padding: 45px 0 65px;
    text-align: center;
  }

  .hero-content {
    margin: 0 auto;
    max-width: 620px;
  }

  .hero-subtitle {
    margin: 0 auto 25px;
  }

  .hero-image-showcase-wrapper {
    margin: 30px auto 0;
    max-width: 380px;
  }

  .hero-spotlight-card {
    margin: 25px auto 0;
    max-width: 340px;
  }

  .hero-spotlight-card .product-thumb-wrapper {
    padding-top: 0 !important;
    height: 195px !important;
    max-height: 195px !important;
  }

  /* Shop filter sidebar */
  .filter-card {
    margin-bottom: 20px;
  }

  /* Tables */
  .table-responsive {
    border-color: var(--gold-border);
    -webkit-overflow-scrolling: touch;
  }
}

/* ==============================================================
   5. SMARTPHONES & SMALL TABLETS (<= 767.98px)
   ============================================================== */
@media (max-width: 767.98px) {
  /* Fluid Typography Scaling */
  .display-4 {
    font-size: clamp(1.85rem, 5.5vw, 2.4rem) !important;
  }

  .display-5 {
    font-size: clamp(1.65rem, 5vw, 2.1rem) !important;
  }

  .display-6 {
    font-size: clamp(1.4rem, 4.5vw, 1.8rem) !important;
  }

  .section-title {
    font-size: clamp(1.5rem, 5vw, 2rem) !important;
  }

  .section-subtitle {
    font-size: 11px !important;
    letter-spacing: 0.12em !important;
  }

  /* Hero Actions */
  .hero-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
    padding: 12px 20px;
    font-size: 15px;
  }

  /* Announcement Bar */
  .announcement-bar {
    font-size: 11px;
    padding: 6px 10px;
    letter-spacing: 0.02em;
    line-height: 1.4;
  }

  /* Brand Benefits Bar */
  .benefits-bar {
    padding: 20px 0;
  }

  .benefit-item {
    border-bottom: 1px solid rgba(212, 175, 55, 0.12);
    padding: 12px 6px;
    text-align: center;
  }

  .benefit-icon {
    width: 38px;
    height: 38px;
    font-size: 15px;
    margin: 0 auto 8px;
  }

  .benefit-title {
    font-size: 12.5px !important;
    margin-bottom: 2px;
  }

  .benefit-desc {
    font-size: 11px !important;
  }

  /* Luxury Box */
  .luxury-box {
    padding: 20px 16px;
    border-radius: 12px;
  }

  /* Home Salons */
  #salonFilters {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  #salonFilters::-webkit-scrollbar {
    display: none;
  }

  .salon-filter-btn {
    white-space: nowrap !important;
    flex-shrink: 0;
    padding: 6px 14px;
    font-size: 11px;
  }

  /* Product Details Form */
  #purchaseForm .d-flex.align-items-center.gap-3 {
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  #purchaseForm .qty-control {
    height: 44px;
  }

  #purchaseForm .btn-gold {
    min-height: 44px;
    font-size: 14px;
  }

  /* Reviews Carousel Controls */
  .luxury-carousel-control {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .review-card-luxury {
    padding: 22px 18px;
  }

  /* Footer */
  .footer-luxury {
    padding: 45px 0 25px;
  }

  .footer-heading {
    margin-top: 15px;
    margin-bottom: 12px;
    font-size: 15px;
  }

  .footer-links li a {
    padding: 4px 0;
    display: inline-block;
  }
}

/* ==============================================================
   6. SMALL & STANDARD PHONES (<= 575.98px)
   ============================================================== */
@media (max-width: 575.98px) {
  /* Container Padding */
  .container {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  /* Navbar */
  .brand-logo-img {
    height: 32px;
  }

  .nav-action-btn {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }

  /* Hero Section */
  .hero-luxury {
    padding: 35px 0 50px;
  }

  .hero-badge {
    font-size: 11px;
    padding: 5px 12px;
    letter-spacing: 0.08em;
  }

  .hero-title {
    font-size: 2.1rem !important;
    margin-bottom: 14px;
  }

  .hero-subtitle {
    font-size: 13.5px !important;
    line-height: 1.55;
    margin-bottom: 22px;
  }

  .hero-image-showcase-wrapper {
    margin: 20px auto 0;
    max-width: 300px;
    border-radius: 14px;
  }

  .hero-showcase-img {
    border-radius: 13px;
  }

  .hero-spotlight-card {
    max-width: 300px;
    margin: 18px auto 0;
  }

  .hero-spotlight-card .product-thumb-wrapper {
    height: 165px !important;
    max-height: 165px !important;
  }

  /* Product Card Grid (2 Columns on Mobile) */
  .col-6 .product-card {
    border-radius: 10px;
  }

  .col-6 .product-thumb-wrapper {
    padding-top: 100%;
  }

  .col-6 .product-card-body {
    padding: 10px 8px;
  }

  .col-6 .product-category-tag {
    font-size: 9px;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
  }

  .col-6 .product-card-title {
    font-size: 12.5px !important;
    line-height: 1.3;
    margin-bottom: 6px;
    min-height: 32px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .col-6 .product-rating-row {
    margin-bottom: 6px;
    font-size: 10px;
  }

  .col-6 .rating-stars i {
    font-size: 9px;
  }

  .col-6 .current-price {
    font-size: 13.5px !important;
  }

  .col-6 .compare-price {
    font-size: 10.5px !important;
  }

  .col-6 .card-discount-badge {
    font-size: 9px;
    padding: 2px 6px;
    top: 6px;
    left: 6px;
  }

  .col-6 .card-wishlist-btn {
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .col-6 .size-chips-container {
    gap: 3px;
    margin-bottom: 8px;
  }

  .col-6 .size-chip {
    font-size: 9.5px;
    padding: 2px 6px;
  }

  .col-6 .card-actions {
    margin-top: 6px;
  }

  .col-6 .btn-add-cart,
  .col-6 .quick-add-form button {
    font-size: 11px !important;
    padding: 6px 4px !important;
    border-radius: 6px;
  }

  /* Product Details Page */
  .notes-card {
    padding: 8px 4px !important;
  }

  .notes-card-title {
    font-size: 10px !important;
  }

  .notes-card-text {
    font-size: 11px !important;
  }

  #skuDisplay {
    display: none;
  }

  /* Search Modal */
  .modal-dialog {
    margin: 12px;
  }

  .modal-content {
    padding: 18px !important;
  }

  /* FAQ section columns on phone */
  #faqColumns .luxury-box {
    padding: 18px 14px;
  }

  /* Newsletter */
  #newsletter form {
    width: 100%;
  }

  #newsletter input {
    max-width: 100% !important;
    width: 100% !important;
    font-size: 16px !important;
  }

  #newsletter button {
    width: 100%;
  }
}

/* ==============================================================
   7. ULTRA-COMPACT PHONES (<= 375px)
   ============================================================== */
@media (max-width: 375px) {
  .hero-title {
    font-size: 1.85rem !important;
  }

  .brand-logo-img {
    height: 28px;
  }

  .col-6 .product-card-title {
    font-size: 11.5px !important;
  }

  .col-6 .current-price {
    font-size: 12.5px !important;
  }

  .benefit-desc {
    display: none;
  }
}
