/* =======================================================
   SASTRA HANDICRAFT — Comprehensive Responsive System
   Targeting: 320px, 375px, 390px, 430px, 768px, 1024px, 1366px, 1440px, 1920px
   ======================================================= */

/* --- Base Fluid Overflow Guard --- */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* =======================================================
   LARGE SCREENS & LAPTOPS (<= 1200px)
   ======================================================= */
@media (max-width: 1200px) {
  .container {
    padding: 0 1.25rem;
  }
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 2rem;
  }
}

/* =======================================================
   DESKTOP / LAPTOP BREAKPOINT (<= 1024px)
   ======================================================= */
@media (max-width: 1024px) {
  .nav-links {
    gap: 1.25rem;
  }
  .nav-link {
    font-size: 0.88rem;
  }
  .shop-layout {
    grid-template-columns: 230px 1fr !important;
    gap: 1.5rem !important;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  .quickview-box {
    grid-template-columns: 1fr;
    max-width: 580px;
  }
  .product-detail-layout {
    gap: 2rem;
  }
}

/* =======================================================
   TABLET / MOBILE TRANSITION (<= 900px)
   ======================================================= */
@media (max-width: 900px) {
  .nav-links {
    display: none;
  }
  .hamburger-btn {
    display: flex;
  }
  .shop-layout {
    grid-template-columns: 1fr !important;
  }
  .filter-sidebar {
    display: none;
  }
  .mobile-filter-drawer {
    display: block;
  }
  .product-detail-layout {
    grid-template-columns: 1fr !important;
    gap: 1.75rem !important;
  }
  .cart-page-layout {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  .cart-summary-box {
    position: static !important;
  }
  .checkout-layout {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  .contact-layout {
    grid-template-columns: 1fr !important;
    gap: 1.75rem !important;
  }
  .section-title {
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
  }
}

/* =======================================================
   TABLET VIEWPORTS (<= 768px)
   ======================================================= */
@media (max-width: 768px) {
  :root {
    --page-padding: 1rem;
    --section-gap: 2rem;
  }

  .navbar {
    height: 62px;
  }

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

  .nav-actions {
    gap: 0.35rem;
  }

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

  .hero-glow-aura {
    width: 280px;
    height: 280px;
  }

  .hero-section {
    padding: 0.65rem 0 1.25rem;
  }

  .hero-card {
    padding: 1.5rem 1.15rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero-heading {
    font-size: clamp(26px, 6.2vw, 32px);
  }

  .hero-paragraph {
    font-size: 14.5px;
  }

  .hero-image-card {
    max-width: 100%;
    aspect-ratio: 16 / 10;
  }

  .hero-highlights-row {
    gap: 0.85rem;
  }

  .hero-highlight-pill {
    font-size: 12px;
  }

  .floating-heritage-badge,
  .hero-floating-badge {
    bottom: 10px;
    left: 8px;
    font-size: 10.5px;
    padding: 6px 12px;
  }

  .testimonial-card-inner {
    padding: 24px 16px;
  }

  .testimonial-quote-text {
    font-size: 15px;
    line-height: 1.5;
  }

  .testimonial-quote-mark {
    font-size: 42px;
    margin-bottom: -12px;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }

  .product-tabs-bar {
    gap: 1rem;
  }

  .product-tab-btn {
    font-size: 0.9rem;
    padding: 0.5rem 0.1rem;
  }

  .cart-table th, .cart-table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.82rem;
  }

  .cart-table th:nth-child(4),
  .cart-table td:nth-child(4) {
    display: none; /* Hide Subtotal column on narrow tablet/mobile table, total is shown in summary */
  }
}

/* =======================================================
   STANDARD & COMPACT MOBILE (<= 640px)
   (Covers 430px, 390px, 375px, 320px)
   ======================================================= */
@media (max-width: 640px) {
  .navbar {
    height: 58px;
  }

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

  .footer-logo-img {
    height: 36px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0.85rem;
    text-align: center;
  }

  /* Two Column Mobile Catalog Grid */
  .product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }

  .product-info {
    padding: 0.65rem 0.65rem 0.75rem !important;
  }

  .product-title {
    font-size: 0.84rem !important;
    min-height: 2.2em;
    line-height: 1.25;
  }

  .price-current {
    font-size: 0.98rem !important;
  }

  .price-original {
    font-size: 0.78rem !important;
  }

  .product-add-cart-btn {
    padding: 0.45rem 0.5rem !important;
    font-size: 0.78rem !important;
    min-height: 34px !important;
  }

  /* Responsive 3-Column Address Fields on Mobile */
  .checkout-address-grid,
  div[style*="grid-template-columns:1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 0.65rem !important;
  }

  div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 0.65rem !important;
  }

  .checkout-card {
    padding: 1.25rem 1rem !important;
  }

  .auth-card {
    padding: 1.5rem 1.15rem !important;
  }

  .contact-card {
    padding: 1.5rem 1.15rem !important;
  }

  .btn-lg {
    padding: 0.65rem 1.25rem;
    font-size: 0.88rem;
    min-height: 40px;
  }

  .toast-container {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .toast {
    min-width: unset;
    width: 100%;
    padding: 0.65rem 0.9rem;
    font-size: 0.82rem;
  }

  .cart-drawer, .wishlist-drawer {
    max-width: 100%;
  }

  .search-modal {
    padding-top: 0;
  }

  .search-modal-box {
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
  }

  .quickview-modal {
    padding: 0.5rem;
  }

  .quickview-box {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-md);
  }

  /* Mobile Gallery Clamp */
  .gallery-main-frame {
    max-height: 320px !important;
  }

  .gallery-thumb {
    width: 52px !important;
    height: 52px !important;
  }

  /* Deep tabs mobile scrolling */
  .product-tabs-bar {
    padding-bottom: 0.25rem;
    gap: 0.75rem;
  }
}

/* =======================================================
   MOBILE SCREENS (<= 480px)
   ======================================================= */
@media (max-width: 480px) {
  .hero-cta-group {
    flex-direction: column;
    width: 100%;
    gap: 0.65rem;
  }
  .btn-hero-primary,
  .btn-hero-secondary {
    width: 100%;
    justify-content: center;
  }
  .hero-highlights-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .hero-highlight-sep {
    display: none;
  }
  .hero-highlight-pill {
    font-size: 12px;
  }
}

/* =======================================================
   SMALL SMARTPHONES (<= 375px & 320px)
   ======================================================= */
@media (max-width: 375px) {
  .product-grid {
    gap: 0.5rem !important;
  }

  .product-info {
    padding: 0.5rem !important;
  }

  .product-title {
    font-size: 0.8rem !important;
  }

  .price-current {
    font-size: 0.92rem !important;
  }

  .btn {
    font-size: 0.82rem;
    padding: 0.45rem 0.75rem;
  }

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

  .announcement-bar {
    font-size: 0.72rem;
    padding: 0.35rem 0.5rem;
  }
}

/* =======================================================
   ULTRA-COMPACT MOBILE BREAKPOINT (<= 340px / 320px)
   ======================================================= */
@media (max-width: 340px) {
  .product-grid {
    grid-template-columns: 1fr !important;
  }
  .cart-item-card, .wishlist-item-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .btn {
    width: 100%;
  }
}

/* =======================================================
   UNIVERSAL ACCESSIBLE TOUCH TARGETS & OVERFLOW GUARDS
   ======================================================= */
@media (max-width: 768px) {
  .btn, .nav-action-btn, .form-control, input[type="text"], input[type="email"], input[type="password"], input[type="tel"], select {
    min-height: 42px;
  }
  .table-responsive, .cart-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* --- Touch & Mobile Custom Cursor Suppression --- */
@media (pointer: coarse), (hover: none), (max-width: 991px) {
  .custom-cursor-dot,
  .custom-cursor-ring {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

/* =======================================================
   RESPONSIVE WATCH & SHOP REELS CAROUSEL
   ======================================================= */
@media (min-width: 1440px) {
  .reel-card {
    flex: 0 0 calc((100% - 4 * 18px) / 5);
  }
}

@media (min-width: 1200px) and (max-width: 1439px) {
  .reel-card {
    flex: 0 0 calc((100% - 3 * 18px) / 4);
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .reel-card {
    flex: 0 0 calc((100% - 2 * 16px) / 3.2);
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .reel-card {
    flex: 0 0 calc((100% - 16px) / 2.3);
  }
}

@media (max-width: 767px) {
  .reel-card {
    flex: 0 0 68vw;
    max-width: 270px;
  }
  .watch-shop-nav-arrows {
    display: none;
  }
  .watch-shop-mobile-hint {
    display: block;
  }
  .watch-shop-header {
    margin-bottom: 1rem;
  }
  .reel-story-caption {
    font-size: 0.78rem;
  }
  .reel-product-strip {
    padding: 6px 8px;
    gap: 8px;
  }
  .reel-product-strip-thumb {
    width: 38px;
    height: 38px;
  }
  .reel-product-strip-title {
    font-size: 0.76rem;
  }
  .reel-product-strip-btn {
    padding: 5px 8px;
    font-size: 0.7rem;
  }
}

/* =======================================================
   RESPONSIVE 8 SASTRA BRAND VALUES GRID
   ======================================================= */
/* Large Desktop (>= 1150px): All 8 cards in one single row */
@media (min-width: 1150px) {
  .brand-values-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
  }
  .brand-value-card {
    padding: 10px 5px;
    min-height: 94px;
  }
  .brand-value-icon-box {
    width: 34px;
    height: 34px;
    font-size: 19px;
    margin-bottom: 0.35rem;
  }
  .brand-value-title {
    font-size: 12px;
    line-height: 1.22;
  }
}

/* Laptops & Tablets (681px - 1149px): 4 cards per row */
@media (min-width: 681px) and (max-width: 1149px) {
  .brand-values-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    align-items: stretch;
  }
  .brand-value-card {
    padding: 12px 10px;
    min-height: 94px;
  }
  .brand-value-icon-box {
    width: 36px;
    height: 36px;
    font-size: 20px;
    margin-bottom: 0.45rem;
  }
  .brand-value-title {
    font-size: 13px;
    line-height: 1.3;
  }
}

/* Mobile (<= 680px): 2 cards per row */
@media (max-width: 680px) {
  .brand-values-section {
    padding: clamp(16px, 2.8vw, 24px) 0;
  }
  .brand-values-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    align-items: stretch;
  }
  .brand-value-card {
    min-height: 88px;
    padding: 11px 8px;
    border-radius: 12px;
  }
  .brand-value-icon-box {
    width: 35px;
    height: 35px;
    font-size: 19px;
    margin-bottom: 0.4rem;
  }
  .brand-value-title {
    font-size: 12.5px;
    line-height: 1.3;
  }
}

/* Small / Compact Mobile (<= 360px): 2 cards per row with compact spacing */
@media (max-width: 360px) {
  .brand-values-grid {
    gap: 6px;
  }
  .brand-value-card {
    padding: 10px 5px;
    min-height: 84px;
    border-radius: 10px;
  }
  .brand-value-icon-box {
    width: 32px;
    height: 32px;
    font-size: 18px;
    margin-bottom: 0.35rem;
  }
  .brand-value-title {
    font-size: 11.5px;
    line-height: 1.25;
  }
}

/* =======================================================
   RESPONSIVE CUSTOMER TESTIMONIALS CAROUSEL
   ======================================================= */
@media (min-width: 1024px) {
  .reviews-track {
    gap: 20px;
  }
  .review-card {
    flex: 0 0 calc((100% - 2 * 20px) / 3);
    max-width: calc((100% - 2 * 20px) / 3);
    width: calc((100% - 2 * 20px) / 3);
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .reviews-track {
    gap: 16px;
  }
  .review-card {
    flex: 0 0 calc((100% - 16px) / 2);
    max-width: calc((100% - 16px) / 2);
    width: calc((100% - 16px) / 2);
  }
}

@media (max-width: 767px) {
  .customer-reviews-section {
    padding: clamp(22px, 4vw, 32px) 0;
  }
  .customer-reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 16px;
  }
  .reviews-nav-controls {
    display: flex;
    gap: 0.4rem;
  }
  .reviews-nav-btn {
    width: 36px;
    height: 36px;
  }
  .reviews-nav-btn svg {
    width: 16px;
    height: 16px;
  }
  .reviews-track {
    gap: 16px;
  }
  .review-card {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
    padding: 20px 18px;
    border-radius: 14px;
    min-height: 220px;
  }
  .review-quote-body {
    font-size: 13.5px;
    margin-bottom: 16px;
  }
  .reviews-mobile-hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reviews-track {
    transition: none !important;
  }
  .review-card {
    transition: none !important;
  }
  .reviews-dot {
    transition: none !important;
  }
}

/* =======================================================
   COMPREHENSIVE VIEWPORT NORMALIZATION (320px to 1920px+)
   ======================================================= */

/* 1. Large Desktops & Ultrawide (>= 1441px) */
@media (min-width: 1441px) {
  .container {
    max-width: 1440px;
  }
  .hero-card {
    max-width: 1440px;
  }
}

/* 2. Fluid Imagery, Media & Video Guards */
img, video, iframe {
  max-width: 100%;
  height: auto;
}

/* 3. Universal Modal Viewport Fit (QuickView, Search, Drawers) */
.quickview-modal {
  padding: 1rem;
  box-sizing: border-box;
}

.quickview-box {
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .quickview-modal {
    padding: 0.5rem;
    align-items: flex-start;
  }
  .quickview-box {
    margin: 1rem auto;
    padding: 1.25rem 1rem;
    max-height: 92vh;
    max-height: 92dvh;
  }
}

@media (max-width: 480px) {
  .quickview-modal {
    padding: 0.25rem;
  }
  .quickview-box {
    padding: 1rem 0.85rem;
    border-radius: var(--radius-md);
  }
  .quickview-close {
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    font-size: 0.95rem;
  }
}

/* 4. Mobile Menu Drawer Animation & Sizing */
.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(85vw, 340px);
  height: 100vh;
  height: 100dvh;
  background: var(--bg-main, #FAF7F2);
  z-index: 1002;
  box-shadow: 8px 0 32px rgba(47, 36, 31, 0.25);
  transform: translateX(-100%);
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.15rem;
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-drawer.open,
.mobile-drawer.active {
  transform: translateX(0);
}

.mobile-nav-links {
  list-style: none;
  padding: 1.25rem 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.mobile-nav-link {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  padding: 0.6rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link:active {
  background: rgba(196, 154, 108, 0.15);
  color: var(--primary-dark);
  padding-left: 0.75rem;
}

/* 5. Mobile Drawer Backdrop */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(35, 24, 19, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 250ms ease, visibility 250ms ease;
}

.drawer-backdrop.active,
.drawer-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

/* 6. Mobile Small Devices (320px–375px) Horizontal Overflow Guard */
@media (max-width: 375px) {
  .container {
    padding: 0 0.75rem;
  }
  .navbar {
    padding: 0 0.5rem;
  }
  .nav-action-btn {
    width: 30px;
    height: 30px;
  }
  .nav-action-btn svg {
    width: 17px;
    height: 17px;
  }
  .hero-card {
    padding: 1.15rem 0.85rem;
  }
  .section-title {
    font-size: 1.35rem;
  }
  .product-info {
    padding: 0.55rem 0.45rem !important;
  }
  .product-title {
    font-size: 0.78rem !important;
  }
  .price-current {
    font-size: 0.88rem !important;
  }
  .product-add-cart-btn {
    font-size: 0.72rem !important;
    padding: 0.35rem 0.4rem !important;
  }
}

/* Responsive Refinements for Bestsellers & Collection Cards */
@media (max-width: 768px) {
  .bestsellers-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }
  .bestsellers-nav-arrows {
    align-self: flex-end;
  }
  .bestsellers-track .product-card {
    flex: 0 0 clamp(220px, 68vw, 260px);
  }
  .collections-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .collection-card.col-2,
  .collection-card.col-3 {
    grid-column: span 1;
  }
}

@media (max-width: 480px) {
  .bestsellers-track .product-card {
    flex: 0 0 220px;
  }
  .collection-card-media {
    height: 180px;
  }
  .collection-card-body {
    padding: 14px;
  }
  .collection-card-title {
    font-size: 1.1rem;
  }
  .collection-card-desc {
    font-size: 0.82rem;
    margin-bottom: 0.85rem;
  }
}

/* 7. Reduced-Motion Accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}




