/* ==========================================================================
   FRAME BAZAAR - LUXURY CUSTOM FRAMING STUDIO
   Comprehensive Mobile & Tablet Responsive Stylesheet
   ========================================================================== */

/* Base Smooth Scrolling & Box Model */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

/* Base Desktop Styles for Shop */
.mobile-category-pills-bar {
  display: none;
}
.shop-layout-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 36px;
  align-items: start;
}
.shop-products-main .products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.shop-top-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 12px 18px;
  background: #F9FAFB;
  border-radius: 8px;
  border: 1px solid #E5E7EB;
  font-size: 0.88rem;
}
.sort-select {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #D1D5DB;
  font-family: inherit;
  font-size: 0.85rem;
  background: #fff;
  color: #374151;
  outline: none;
}
.mobile-filter-sort-bar,
.mobile-filter-overlay,
.mobile-filter-drawer {
  display: none;
}

/* ==========================================================================
   1. LARGE DESKTOPS & LAPTOPS (1200px and down)
   ========================================================================== */
@media (max-width: 1200px) {
  .container {
    max-width: 100%;
    padding: 0 24px;
  }

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

  .trust-pillars-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .hero-title {
    font-size: 2.8rem;
  }

  .review-card {
    min-width: calc(50% - 14px);
  }

  .product-detail-layout {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .mega-menu-container {
    grid-template-columns: 1fr 1fr 1fr 1.2fr;
    gap: 20px;
  }
}

/* ==========================================================================
   2. TABLET LANDSCAPE & PORTRAIT (992px and down)
   ========================================================================== */
@media (max-width: 992px) {
  /* Navigation: Hide desktop nav, show mobile hamburger */
  .desktop-nav,
  .mega-menu-wrapper {
    display: none !important;
  }

  .mobile-menu-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  /* Header Container */
  .header-container {
    height: 70px;
  }

  .logo-text {
    font-size: 1.4rem;
  }

  .logo-tagline {
    font-size: 0.65rem;
    letter-spacing: 1px;
  }

  /* Hero Section */
  .hero-section {
    height: 65vh;
    min-height: 480px;
  }

  .hero-title {
    font-size: 2.4rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  /* Sections Stacking */
  .metal-grid,
  .gift-grid,
  .magnetic-content-grid,
  .statement-grid,
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr !important;
    gap: 36px;
  }

  .wall-sets-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  /* Shop / Catalog Page (products.php) */
  .shop-layout-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .shop-sidebar {
    display: none !important;
  }

  .mobile-category-pills-bar {
    display: flex !important;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    margin-bottom: 14px;
    scrollbar-width: none;
  }

  .mobile-category-pills-bar::-webkit-scrollbar {
    display: none;
  }

  .cat-pill {
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 0.82rem;
    white-space: nowrap;
    background: #F3F4F6;
    color: #374151;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid #E5E7EB;
    flex-shrink: 0;
    transition: all 0.2s ease;
  }

  .cat-pill:hover,
  .cat-pill.active {
    background: var(--color-primary, #111827);
    color: #FFFFFF;
    border-color: var(--color-primary, #111827);
  }

  .desktop-only-controls {
    display: none !important;
  }

  .mobile-filter-sort-bar {
    display: flex !important;
    gap: 10px;
    margin-bottom: 16px;
  }

  .mobile-filter-btn {
    flex: 1;
    height: 42px;
    border-radius: 8px;
    border: 1.5px solid #D1D5DB;
    background: #FFFFFF;
    color: #1F2937;
    font-weight: 600;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: all 0.2s ease;
  }

  .mobile-filter-btn:active {
    background: #F3F4F6;
  }

  .mobile-sort-wrapper {
    flex: 1;
  }

  .mobile-sort-select {
    width: 100%;
    height: 42px;
    border-radius: 8px;
    border: 1.5px solid #D1D5DB;
    background: #FFFFFF;
    color: #1F2937;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0 12px;
    outline: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  }

  /* Mobile Slide-Up Filter Drawer (Bottom Sheet) */
  .mobile-filter-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .mobile-filter-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  .mobile-filter-drawer {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 84vh;
    background: #FFFFFF;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.25);
    z-index: 999999;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.32, 1, 0.23, 1);
  }

  .mobile-filter-drawer.active {
    transform: translateY(0);
  }

  .mobile-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #E5E7EB;
  }

  .mobile-filter-header h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
  }

  .close-mobile-filter {
    background: #F3F4F6;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #4B5563;
    cursor: pointer;
  }

  .mobile-filter-body {
    padding: 18px 20px;
    overflow-y: auto;
    flex-grow: 1;
  }

  .m-filter-section {
    margin-bottom: 20px;
  }

  .m-filter-section h5 {
    font-size: 0.88rem;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
  }

  .m-filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .m-filter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 14px;
    border-radius: 8px;
    background: #F9FAFB;
    border: 1.5px solid #E5E7EB;
    color: #1F2937;
    font-size: 0.88rem;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
  }

  .m-filter-item.active {
    background: #F0FDF4;
    border-color: var(--color-secondary-dark, #059669);
    color: var(--color-secondary-dark, #059669);
    font-weight: 700;
  }

  .mobile-filter-footer {
    display: flex;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid #E5E7EB;
    background: #FFFFFF;
  }

  .shop-products-main .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  /* Product Details Page (product-details.php) */
  .product-detail-layout {
    grid-template-columns: 1fr !important;
    gap: 32px;
  }

  .product-gallery-col {
    position: static;
  }

  .live-frame-visualizer-container {
    min-height: 360px;
    padding: 24px;
  }

  /* Checkout Page (checkout.php) */
  .checkout-grid,
  .checkout-layout {
    grid-template-columns: 1fr !important;
    gap: 30px;
  }

  .checkout-summary-sticky {
    position: static !important;
  }

  /* Vendor Dashboard (vendor-dashboard.php) */
  .vendor-dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 24px;
  }

  /* Footer */
  .footer-top-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }
}

/* ==========================================================================
   3. TABLET PORTRAIT & MOBILE LARGE (768px and down)
   ========================================================================== */
@media (max-width: 768px) {
  /* Container Padding */
  .container {
    padding: 0 16px;
  }

  /* Top Bar */
  .announcement-bar {
    font-size: 0.75rem;
    padding: 6px 12px;
  }

  .announcement-bar .bar-phone,
  .announcement-bar .bar-socials {
    display: none;
  }

  .announcement-bar .bar-center {
    width: 100%;
    text-align: center;
  }

  /* Header */
  .site-header {
    top: 0;
  }

  .header-container {
    height: 64px;
  }

  .logo-text {
    font-size: 1.25rem;
    letter-spacing: 1px;
  }

  .logo-tagline {
    display: none;
  }

  .header-right-actions {
    gap: 8px;
  }

  .header-right-actions .auth-nav-link span {
    display: none;
  }

  .action-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  /* Typography */
  .section-title {
    font-size: 1.85rem !important;
  }

  .section-subtitle {
    font-size: 0.9rem !important;
    margin-bottom: 24px;
  }

  .section-header {
    margin-bottom: 28px;
  }

  /* Hero Banner */
  .hero-section {
    height: 58vh;
    min-height: 420px;
  }

  .hero-tag {
    font-size: 0.72rem;
    letter-spacing: 1.5px;
    padding: 4px 10px;
    margin-bottom: 12px;
  }

  .hero-title {
    font-size: 2rem !important;
    line-height: 1.2;
    margin-bottom: 12px;
  }

  .hero-subtitle {
    font-size: 0.88rem;
    line-height: 1.45;
    margin-bottom: 20px;
  }

  .hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .hero-buttons .btn {
    width: 100%;
    text-align: center;
    padding: 12px 20px;
    font-size: 0.88rem;
  }

  .slider-nav-arrows {
    display: none !important;
  }

  /* Products Grid - Strict 2-Column e-Commerce Grid (Mobile) */
  .products-grid,
  .shop-products-main .products-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .product-card {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    min-width: 0 !important;
    background: #FFFFFF !important;
    border: 1px solid #E5E7EB !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05) !important;
  }

  .product-media {
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    position: relative !important;
    background: #F9FAFB !important;
    overflow: hidden !important;
  }

  .product-media img,
  .product-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  .product-info {
    padding: 10px 8px 12px !important;
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
    justify-content: space-between !important;
  }

  .product-title {
    font-size: 0.86rem !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    height: 2.6em !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    margin: 3px 0 5px !important;
  }

  .product-category {
    font-size: 0.68rem !important;
    text-transform: uppercase !important;
    color: #9CA3AF !important;
    letter-spacing: 0.5px !important;
  }

  .product-price .price-current {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: #111827 !important;
  }

  .product-price .price-old {
    font-size: 0.75rem !important;
    margin-left: 4px !important;
  }

  .add-cart-mini {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.8rem !important;
    border-radius: 50% !important;
  }

  .product-wishlist-btn {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.85rem !important;
    top: 6px !important;
    right: 6px !important;
    background: rgba(255, 255, 255, 0.92) !important;
    border-radius: 50% !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12) !important;
  }

  .product-badge {
    font-size: 0.62rem !important;
    padding: 2px 6px !important;
    top: 6px !important;
    left: 6px !important;
    border-radius: 3px !important;
  }

  .quick-action-overlay {
    display: none !important;
  }

  /* Feature Sections */
  .metal-features-list,
  .statement-specs {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .metal-main-img,
  .magnetic-preview-img {
    height: 280px !important;
    object-fit: cover;
    border-radius: 8px;
  }

  .wall-sets-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .trust-pillars-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .trust-pillar-card {
    padding: 20px 16px;
  }

  /* Customer Stories (Reviews Slider) */
  .review-card {
    min-width: 100% !important;
    padding: 20px 16px !important;
  }

  .review-quote {
    font-size: 0.88rem !important;
    line-height: 1.5 !important;
  }

  /* Newsletter */
  .newsletter-banner {
    padding: 36px 0;
  }

  .newsletter-content h3 {
    font-size: 1.45rem;
  }

  .newsletter-form {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .newsletter-form .form-input,
  .newsletter-form input[type="email"] {
    width: 100%;
    font-size: 0.9rem;
  }

  .newsletter-form .btn {
    width: 100%;
  }

  /* ==========================================================================
     PRODUCT DETAILS PAGE (product-details.php)
     ========================================================================== */
  .product-detail-hero {
    padding: 20px 0 50px;
  }

  .live-frame-visualizer-container {
    min-height: 300px;
    max-height: 380px;
    padding: 16px;
    border-radius: 8px;
  }

  .mockup-artwork-preview {
    max-width: 90%;
    max-height: 240px;
  }

  .size-options-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }

  .size-btn {
    padding: 8px 6px !important;
    font-size: 0.78rem !important;
  }

  .color-thumbs-row {
    gap: 8px !important;
  }

  .color-frame-thumb {
    width: 48px !important;
    height: 48px !important;
  }

  .matboard-swatches-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }

  .action-cta-block {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  .quantity-picker {
    height: 46px;
  }

  .btn-add-cart-large {
    height: 46px;
    font-size: 0.88rem;
    padding: 0 16px;
  }

  .wishlist-toggle-btn {
    width: 46px !important;
    height: 46px !important;
  }

  .photo-upload-customizer-box {
    padding: 20px 12px;
  }

  .product-reviews-summary-card {
    flex-direction: column !important;
    gap: 20px !important;
    text-align: center;
    padding: 20px 16px !important;
  }

  .score-big {
    font-size: 2.8rem;
  }

  .breakdown-bars {
    width: 100%;
  }

  /* ==========================================================================
     CHECKOUT & ORDERS
     ========================================================================== */
  .checkout-section,
  .vendor-dashboard-section {
    padding: 24px 0 60px;
  }

  .form-grid-2 {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .checkout-card,
  .order-success-card {
    padding: 18px 14px !important;
  }

  .admin-table-wrapper,
  .responsive-table-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    display: block;
  }

  .admin-table,
  .order-table {
    min-width: 600px;
  }

  .modal-dialog {
    width: 94% !important;
    max-width: 480px !important;
    margin: 20px auto !important;
    padding: 20px 16px !important;
  }

  /* Footer */
  .footer-top-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

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

/* ==========================================================================
   4. MOBILE SMALL & EXTRA SMALL (480px and down)
   ========================================================================== */
@media (max-width: 480px) {
  /* Announcement bar */
  .announcement-bar {
    font-size: 0.7rem;
    padding: 5px 8px;
  }

  /* Header */
  .header-container {
    height: 58px;
  }

  .logo-text {
    font-size: 1.15rem;
  }

  .header-right-actions {
    gap: 5px;
  }

  .action-btn {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

  /* Hero */
  .hero-section {
    height: 52vh;
    min-height: 380px;
  }

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

  /* Product Grid: Ultra Crisp 2-Column on Mobile Phones */
  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

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

  .product-title {
    font-size: 0.84rem !important;
    margin: 2px 0 4px !important;
  }

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

  .add-cart-mini {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.75rem !important;
  }

  /* Product Details Customizer */
  .size-options-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }

  .live-frame-visualizer-container {
    min-height: 260px;
    max-height: 320px;
    padding: 12px;
  }

  .action-cta-block {
    flex-direction: column;
    align-items: stretch !important;
  }

  .quantity-picker {
    width: 100%;
    justify-content: center;
  }

  .btn-add-cart-large {
    width: 100%;
  }

  /* Cart Drawer on Mobile (Crisp, Solid White, and Proper Viewport Fit) */
  .cart-drawer {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 99999999 !important;
    background-color: #FFFFFF !important;
  }

  .cart-drawer-header {
    padding: 16px 18px !important;
    background-color: #FFFFFF !important;
  }

  .cart-drawer-body {
    padding: 14px 12px !important;
    background-color: #F9FAFB !important;
  }

  .cart-item {
    padding: 12px 10px !important;
    gap: 10px !important;
    background-color: #FFFFFF !important;
  }

  .cart-drawer-footer {
    padding: 16px 18px !important;
    background-color: #FFFFFF !important;
  }

  /* Wishlist page */
  #wishlistContainer {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* Order details badges */
  .order-fulfillment-badge {
    display: inline-block;
    margin-top: 6px;
  }
}
