/* =========================================================
   IMAGENTIS JEWELS - ULTRA SMOOTH RESPONSIVE STYLESHEET
   Optimized for Mobile, Tablet, and Laptop / Desktop
   Zero-lag gestures, touch-friendly, fast rendering
   ========================================================= */

/* ---------------- GLOBAL TOUCH & SMOOTHNESS ---------------- */
@media (hover: none) and (pointer: coarse) {
  /* Prevent stuck hover states on touch screens */
  .product-card:hover .product-img.img-main {
    opacity: 1 !important;
  }
  .product-card:hover .product-img.img-hover {
    opacity: 0 !important;
    transform: none !important;
  }
  .product-card:active {
    transform: scale(0.985);
  }
  button:active, a:active {
    opacity: 0.85;
  }
}

/* ---------------- LAPTOP / DESKTOP (> 1024px) ---------------- */
@media (min-width: 1025px) {
  .store-container {
    grid-template-columns: 260px 1fr;
    gap: 28px;
  }
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
  .mobile-bottom-bar {
    display: none !important;
  }
  .mobile-filter-btn {
    display: none !important;
  }
}

/* ---------------- TABLET / IPAD (769px - 1024px) ---------------- */
@media (min-width: 769px) and (max-width: 1024px) {
  .store-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
  .mobile-bottom-bar {
    display: none !important;
  }
  .header-inner {
    padding: 12px 20px;
    gap: 14px;
  }
  .logo-text {
    font-size: 28px;
  }
  .search-container {
    max-width: 400px;
  }
  .filters-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    background: #ffffff;
    z-index: 1010;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translate3d(-100%, 0, 0);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.2);
  }
  .filters-sidebar.mobile-open {
    transform: translate3d(0, 0, 0);
  }
  .mobile-filter-btn {
    display: inline-flex;
  }
  .trust-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

/* ---------------- MOBILE PHONES (<= 768px) ---------------- */
@media (max-width: 768px) {
  /* Prevent screen content from hiding behind mobile bottom bar */
  body {
    padding-bottom: 68px;
  }

  /* Show App-Like Mobile Bottom Navigation Bar */
  .mobile-bottom-bar {
    display: block !important;
  }

  /* Hide floating button on mobile to save screen real estate */
  .whatsapp-float-btn {
    display: none !important;
  }

  /* Top Announcement Bar */
  .announcement-bar {
    font-size: 10.5px;
    padding: 5px 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
  }
  .announcement-bar::-webkit-scrollbar {
    display: none;
  }

  /* Compact Sticky Header */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 990;
    background: #ffffff;
  }

  .header-inner {
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
    align-items: center;
  }

  .logo-area {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 58%;
  }

  .logo-text {
    font-size: 20px;
    letter-spacing: 0.5px;
    line-height: 1.1;
  }

  .logo-tagline {
    font-size: 8px;
    letter-spacing: 0.6px;
    margin-top: -2px;
  }

  /* Compact Header Action Buttons */
  .header-actions {
    gap: 6px;
    display: flex;
    align-items: center;
  }

  .header-actions .action-btn {
    padding: 4px;
    font-size: 0; /* Hides text labels on phone header, keeping clean icons */
  }

  .header-actions .action-btn .icon {
    font-size: 20px;
  }

  .header-actions .action-badge {
    top: -2px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    font-size: 9px;
  }

  .instagram-header-btn {
    padding: 6px 9px;
    font-size: 11px;
    border-radius: 16px;
  }

  body.owner-authenticated .owner-add-btn {
    display: inline-flex !important;
    padding: 6px 9px;
    font-size: 11px;
    border-radius: 16px;
  }

  /* Full-Width Search on Mobile */
  .search-container {
    order: 3;
    max-width: 100%;
    width: 100%;
    margin-top: 4px;
  }

  .search-input-wrap {
    height: 38px;
    border-radius: 20px;
    padding: 4px 12px;
  }

  .search-input-wrap input {
    font-size: 14px;
  }

  /* Hero & Category Strip */
  .collection-hero {
    padding: 16px 12px;
  }

  .hero-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .hero-badges-side {
    display: none;
  }

  .collection-title {
    font-size: 22px;
    line-height: 1.2;
  }

  .collection-description {
    font-size: 12px;
    line-height: 1.45;
  }

  .channels-strip {
    font-size: 11px !important;
    gap: 6px !important;
  }

  .channel-pill {
    padding: 3px 8px;
    font-size: 10.5px;
  }

  /* Category Pills Carousel */
  .category-pills-bar {
    padding: 8px 12px;
  }

  .pills-container {
    gap: 8px;
  }

  .category-pill {
    font-size: 11.5px;
    padding: 6px 14px;
  }

  /* Catalog Top Bar & Sorting */
  .catalog-topbar {
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .grid-switcher {
    display: none;
  }

  .mobile-filter-btn {
    display: inline-flex;
    padding: 7px 14px;
    font-size: 12px;
  }

  /* Products Grid: 2 Columns for Mobile */
  .store-container {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 12px 12px 24px;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .product-card {
    border-radius: 8px;
  }

  .product-info {
    padding: 10px 8px;
  }

  .product-title {
    font-size: 12px;
    height: 32px;
    line-height: 1.3;
  }

  .product-rating {
    font-size: 11px;
    margin: 3px 0 6px;
  }

  .current-price {
    font-size: 14px;
  }

  .mrp-price {
    font-size: 11px;
  }

  .discount-tag {
    font-size: 9.5px;
    padding: 1px 4px;
  }

  .add-to-cart-btn {
    font-size: 11px;
    padding: 7px 6px;
    border-radius: 4px;
  }

  /* Product Card Dual Buttons on Mobile */
  .card-actions {
    gap: 4px;
    margin-top: 6px;
  }

  .btn-card-add,
  .btn-card-buy {
    font-size: 11px;
    padding: 7px 4px;
    border-radius: 4px;
  }

  .quick-view-btn {
    display: none;
  }

  /* Mobile Bottom-Sheet Modals */
  .checkout-modal,
  .add-product-modal,
  .quickview-modal {
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    transform: translate3d(0, 100%, 0) !important;
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: 92vh !important;
    border-radius: 20px 20px 0 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  .checkout-modal.open,
  .add-product-modal.open,
  .quickview-modal.open {
    transform: translate3d(0, 0, 0) !important;
  }

  /* Prevent iOS Safari Auto-Zoom on Form Inputs */
  input, select, textarea {
    font-size: 16px !important;
  }

  .checkout-form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .cart-drawer,
  .wishlist-drawer {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 1050 !important;
  }

  .cart-footer {
    padding: 14px 18px calc(24px + env(safe-area-inset-bottom, 16px)) !important;
    border-top: 1px solid #ede8e1 !important;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08) !important;
  }

  /* Trust & Footer */
  .trust-inner {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 20px 12px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 28px 16px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 10px;
    text-align: center;
    padding: 14px;
  }

  .payment-badges {
    font-size: 11px;
    gap: 6px;
  }

  /* Toast Notification on Mobile (Floating Pill above bottom nav bar) */
  .toast-notice {
    bottom: 72px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) translateY(20px) !important;
    max-width: 90vw;
    white-space: nowrap;
    border-radius: 30px;
    padding: 8px 18px;
    font-size: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    z-index: 2000 !important;
  }
  .toast-notice.show {
    transform: translateX(-50%) translateY(0) !important;
  }
}

/* ---------------- SMALL PHONES (<= 380px) ---------------- */
@media (max-width: 380px) {
  .logo-text {
    font-size: 18px;
  }
  .products-grid {
    gap: 8px;
  }
  .product-info {
    padding: 8px 6px;
  }
  .product-title {
    font-size: 11.5px;
    height: 30px;
  }
  .current-price {
    font-size: 13.5px;
  }
  .add-to-cart-btn {
    font-size: 10px;
    padding: 6px 4px;
  }
  .btn-card-add,
  .btn-card-buy {
    font-size: 9.5px;
    padding: 6px 2px;
  }
}
