/* ==========================================================================
   RESPONSIVE.CSS - COMPLETE MULTI-DEVICE RESPONSIVE SYSTEM
   Devices: 4K/Desktop, Laptop, Tablet Landscape/Portrait, Mobile (Large/Small)
   ========================================================================== */

/* Universal Viewport & Horizontal Overflow Protection */
html, body {
  overflow-x: clip !important;
  max-width: 100vw !important;
  width: 100% !important;
  position: relative;
  box-sizing: border-box;
}

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

/* --------------------------------------------------------------------------
   1. LAPTOP & SMALL DESKTOP (Max-Width: 1200px)
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .container {
    max-width: 1000px;
    padding-left: 20px;
    padding-right: 20px;
  }

  .b2b-sectors-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  .b2b-advantage-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  .how-it-works-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
}

/* --------------------------------------------------------------------------
   2. TABLET LANDSCAPE (Max-Width: 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .hero-grid-artisanal {
    grid-template-columns: 1fr;
    gap: 36px;
    text-align: center;
  }

  .hero-description-text {
    margin-left: auto;
    margin-right: auto;
    max-width: 620px;
  }

  .hero-search-pill-box {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-stats-cluster {
    justify-content: center;
  }

  .hero-bowl-wrapper {
    margin: 0 auto;
  }

  .hero-bowl-img {
    max-width: 440px;
    margin: 0 auto;
  }

  /* 2-Column Grids on Tablet */
  .b2b-sectors-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

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

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

  .how-it-works-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  /* Footer 2 Columns */
  .footer-grid-artisanal {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }

  .supplier-onboarding-cta {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 28px;
    padding: 36px 28px;
  }

  .supplier-onboarding-cta div:first-child {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}

/* --------------------------------------------------------------------------
   3. TABLET PORTRAIT & MEDIUM SCREENS (Max-Width: 992px)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {

  /* Suppliers Listing Page Stack */
  .suppliers-layout-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  .suppliers-layout-grid aside {
    position: static !important;
    top: auto !important;
  }

  /* Supplier Detail Page Stack */
  .supplier-detail-layout {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .supplier-detail-layout aside {
    position: static !important;
    top: auto !important;
  }

  .detail-specs-grid-4col {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .detail-banner-flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .detail-hero-actions-cluster {
    align-items: flex-start;
    width: 100%;
  }

  /* Membership / Pricing 3-Tiers Grid Stack on Tablet */
  .pricing-tiers-grid {
    grid-template-columns: 1fr !important;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    gap: 32px !important;
  }

  .tier-flagship {
    transform: none !important;
  }

  .tier-flagship:hover {
    transform: translateY(-4px) !important;
  }

  .tier-crown-badge {
    max-width: 90%;
    white-space: normal !important;
    text-align: center;
    font-size: 0.68rem;
    padding: 4px 12px;
  }

  /* Enterprise Pro Card Column Stack on Tablet Portrait */
  .b2b-pro-card {
    grid-template-columns: 1fr;
  }

  .pro-card-visual {
    min-height: 200px;
    max-height: 220px;
  }

  .pro-card-img {
    min-height: 200px;
  }

  .pro-specs-bar {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  /* Footer Newsletter & Trust Strip on Tablet */
  .footer-newsletter-card {
    flex-direction: column;
    align-items: stretch;
    gap: 22px;
    padding: 26px 24px;
  }

  .footer-newsletter-left {
    max-width: 100%;
  }

  .footer-newsletter-form {
    max-width: 100%;
  }

  .footer-trust-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .trust-strip-sep {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   4. MOBILE STANDARD (Max-Width: 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  body {
    padding-bottom: 72px !important;
    /* Space for Mobile Bottom Bar */
  }

  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Header Compact */
  .artisanal-header {
    padding: 10px 0 !important;
  }

  .nav-links-cluster {
    display: none !important;
  }

  .header-actions .btn-caramel-pill {
    display: none !important;
  }

  .header-actions {
    gap: 8px !important;
  }

  .btn-icon-round {
    width: 38px !important;
    height: 38px !important;
    font-size: 0.9rem !important;
  }

  .brand-title {
    font-size: 1.45rem !important;
    gap: 6px !important;
  }

  .brand-country-tag {
    font-size: 0.6rem !important;
    padding: 2px 6px !important;
  }

  .mobile-menu-btn {
    display: flex !important;
  }

  /* Form & Pricing Pages (list-business.php & post-rfq.php) */
  .form-hero-banner {
    padding: 28px 0 46px 0 !important;
  }

  .form-hero-container {
    max-width: 100% !important;
  }

  .form-hero-title {
    font-size: 1.85rem !important;
    line-height: 1.25 !important;
    word-wrap: break-word !important;
    margin-bottom: 8px !important;
  }

  .form-hero-desc {
    font-size: 0.92rem !important;
    line-height: 1.5 !important;
  }

  .plans-section-header {
    margin-bottom: 24px !important;
    text-align: center !important;
  }

  .plans-section-title {
    font-size: 1.75rem !important;
    line-height: 1.25 !important;
  }

  .plans-section-subtitle {
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
    margin-bottom: 18px !important;
  }

  .pricing-billing-toggle-wrap {
    width: 100% !important;
    max-width: 340px !important;
    display: flex !important;
    margin: 0 auto !important;
  }

  .billing-toggle-btn {
    flex: 1 !important;
    padding: 8px 10px !important;
    font-size: 0.78rem !important;
    justify-content: center !important;
    text-align: center !important;
  }

  .annual-discount-pill {
    font-size: 0.62rem !important;
    padding: 2px 6px !important;
  }

  .pricing-tiers-grid {
    grid-template-columns: 1fr !important;
    max-width: 440px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    gap: 28px !important;
  }

  .pricing-tier-card {
    padding: 26px 20px !important;
  }

  .tier-name {
    font-size: 1.35rem !important;
  }

  .tier-amount {
    font-size: 2.6rem !important;
  }

  .tier-desc {
    min-height: auto !important;
    margin-bottom: 16px !important;
  }

  .form-selected-plan-banner {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    text-align: center !important;
  }

  .selected-plan-left {
    justify-content: center !important;
  }

  .btn-change-tier {
    width: 100% !important;
    justify-content: center !important;
  }

  .form-main-card {
    padding: 22px 18px !important;
    border-radius: var(--radius-lg) !important;
  }

  .form-main-title {
    font-size: 1.35rem !important;
    line-height: 1.3 !important;
  }

  .form-main-sub {
    font-size: 0.88rem !important;
    margin-bottom: 20px !important;
  }

  .form-grid-2col,
  .form-grid-2col-lg {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* Suppliers Directory Mobile Filters & Search */
  .directory-hero-banner {
    padding: 28px 0 46px 0 !important;
  }

  .directory-banner-title {
    font-size: 1.85rem !important;
    line-height: 1.25 !important;
  }

  .directory-banner-desc {
    font-size: 0.92rem !important;
    line-height: 1.5 !important;
  }

  .directory-top-search-banner {
    padding: 0 !important;
    margin-bottom: 20px !important;
  }

  .top-search-bar-wrap {
    flex-direction: column !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    gap: 10px !important;
  }

  .top-search-input-box {
    background: #ffffff !important;
    border: 1.5px solid var(--border-cream) !important;
    border-radius: var(--radius-pill) !important;
    padding: 10px 16px !important;
    box-shadow: var(--shadow-organic-sm) !important;
    width: 100% !important;
  }

  .top-search-btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 12px 20px !important;
    border-radius: var(--radius-pill) !important;
  }

  .directory-toolbar-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    text-align: center;
  }

  .toolbar-stats {
    text-align: center !important;
  }

  .toolbar-controls {
    justify-content: center !important;
  }

  .filter-sidebar-box {
    padding: 20px 16px !important;
  }

  .b2b-pro-stack.is-grid-view {
    grid-template-columns: 1fr !important;
  }

  /* Commodity Prices Page Mobile */
  .freight-calculator-card {
    padding: 20px 16px !important;
  }

  .freight-calc-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  .freight-benchmark-badge {
    text-align: left !important;
    width: 100% !important;
  }

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

  .freight-results-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
    padding: 16px !important;
    text-align: center;
  }

  .freight-res-item {
    align-items: center !important;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(180, 83, 9, 0.2);
  }

  .freight-res-item:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
  }

  .freight-res-action {
    width: 100%;
  }

  .freight-res-action button {
    width: 100% !important;
    justify-content: center !important;
  }

  .table-responsive {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    display: block;
    margin-bottom: 16px;
  }

  .market-data-table {
    min-width: 680px;
  }

  /* Hero Section Mobile */
  .artisanal-hero-section {
    padding: 24px 0 50px 0;
  }

  .hero-tag-text {
    font-size: 0.72rem;
    padding: 4px 10px;
  }

  .hero-big-title {
    font-size: 2.3rem;
    line-height: 1.2;
  }

  .hero-description-text {
    font-size: 0.94rem;
    line-height: 1.6;
    margin-bottom: 22px;
  }

  .hero-bowl-img {
    max-width: 300px;
  }

  /* Section Headers */
  .b2b-section-header {
    margin-bottom: 28px;
  }

  .b2b-section-title {
    font-size: 1.85rem;
    line-height: 1.25;
  }

  .b2b-section-subtitle {
    font-size: 0.92rem;
  }

  /* 1-Column Stacks on Mobile */
  .b2b-sectors-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .mandi-hubs-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

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

  .b2b-advantage-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .how-it-works-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Compliance Strip */
  .compliance-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
  }

  .compliance-badge-item {
    font-size: 0.84rem;
  }

  /* Supplier Card Specs on Mobile */
  .pro-card-content {
    padding: 20px 18px;
  }

  .pro-company-name {
    font-size: 1.22rem;
  }

  .pro-specs-bar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .pro-spec-cell:not(:last-child) {
    border-right: none;
    border-bottom: 1px dashed var(--border-cream);
    padding-bottom: 6px;
  }

  .pro-bottom-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .pro-actions-cluster {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .pro-actions-cluster .btn-caramel-pill,
  .pro-actions-cluster .btn-outline-pro {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  /* Supplier Detail Page Specs Mobile */
  .detail-specs-grid-4col,
  .detail-lab-specs-grid,
  .dock-specs-grid {
    grid-template-columns: 1fr !important;
  }

  .detail-lot-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .detail-lot-right {
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }

  .facility-photo-hero {
    height: 180px;
  }

  .facility-body-content {
    padding: 20px;
  }

  .detail-company-heading {
    font-size: 1.85rem;
  }

  .lab-actions-row button {
    width: 100%;
    justify-content: center;
  }

  /* Detail Page Map & Review Mobile Rules */
  .detail-corridors-grid {
    grid-template-columns: 1fr !important;
  }

  .detail-map-visual-wrap {
    height: 320px;
  }

  .map-floating-pin-card {
    position: static;
    margin: 12px 14px;
    max-width: calc(100% - 28px);
    box-shadow: 0 4px 12px rgba(27, 24, 21, 0.1);
  }

  .detail-map-header-wrap,
  .detail-reviews-header-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .btn-map-ext,
  .btn-write-review-toggle {
    width: 100%;
    justify-content: center;
  }

  .reviews-summary-bar {
    grid-template-columns: 1fr !important;
    gap: 14px;
    padding: 16px;
  }

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

  .review-form-inner {
    padding: 18px 16px;
  }

  .review-form-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .review-form-actions button {
    width: 100%;
    justify-content: center;
  }

  .detail-map-amenities-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }


  /* Footer Mobile Enhancements */
  .footer-newsletter-card {
    padding: 22px 18px;
    border-radius: var(--radius-lg);
  }

  .footer-newsletter-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .newsletter-icon-badge {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }

  .newsletter-input-group {
    flex-direction: column;
    align-items: stretch;
    border-radius: var(--radius-lg);
    padding: 10px;
    gap: 10px;
  }

  .newsletter-input {
    padding: 6px 4px;
    width: 100%;
  }

  .newsletter-submit-btn {
    width: 100%;
    justify-content: center;
    border-radius: var(--radius-md);
  }

  .newsletter-trust-text {
    padding-left: 0;
  }

  .footer-grid-artisanal {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-trust-strip {
    grid-template-columns: 1fr;
    padding: 14px 16px;
    gap: 12px;
  }

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

  .footer-legal-links {
    justify-content: center;
    gap: 8px 12px;
  }
}

/* --------------------------------------------------------------------------
   5. EXTRA SMALL MOBILE (Max-Width: 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .hero-big-title {
    font-size: 1.95rem;
  }

  .brand-title {
    font-size: 1.25rem !important;
  }

  .btn-icon-round {
    width: 34px !important;
    height: 34px !important;
    font-size: 0.8rem !important;
  }

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

  .plans-section-title {
    font-size: 1.45rem !important;
  }

  .tier-amount {
    font-size: 2.2rem !important;
  }

  .pricing-billing-toggle-wrap {
    max-width: 100% !important;
  }

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

  .annual-discount-pill {
    display: none !important;
  }

  /* Full Width Stack Search Box */
  .hero-search-pill-box {
    flex-direction: column;
    align-items: stretch;
    border-radius: var(--radius-xl);
    padding: 12px;
    gap: 10px;
    width: 100%;
  }

  .hero-search-pill-box input {
    width: 100%;
    text-align: center;
    font-size: 0.88rem;
  }

  .hero-search-pill-box button {
    width: 100%;
    justify-content: center;
    padding: 10px 18px;
  }

  /* Hero CTA Buttons */
  .artisanal-hero-section div[style*="display:flex; gap:14px;"] {
    flex-direction: column;
  }

  /* Hero CTA Buttons */
  .hero-cta-btns {
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .hero-cta-btns a {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  /* Hero Stats Full Width Stack */
  .hero-stats-cluster {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .hero-stat-pill {
    width: 100%;
    justify-content: center;
    font-size: 0.78rem;
  }

  .hero-bowl-img {
    max-width: 250px;
  }

  .supplier-onboarding-cta {
    padding: 24px 16px;
    border-radius: var(--radius-xl);
  }

  .supplier-onboarding-cta h3 {
    font-size: 1.6rem;
  }

  .supplier-cta-btn-group {
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .supplier-cta-btn-group a {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .b2b-section-title {
    font-size: 1.6rem;
  }

  /* Form Pages Responsive */
  .form-grid-2col,
  .form-grid-2col-lg {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .form-main-card,
  .form-highlight-card {
    padding: 24px 18px;
  }

  /* Extra Small Mobile Footer */
  .procurement-desk-card {
    padding: 20px 16px;
  }

  .desk-phone-box {
    padding: 10px 12px;
    gap: 10px;
  }

  .desk-phone-val {
    font-size: 1.05rem;
  }

  .footer-rating-pill {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }

  /* Spotlight Search Modal Mobile */
  .site-search-modal-overlay {
    padding: 16px 12px;
  }

  .site-search-modal-card {
    max-height: 85vh;
  }

  .site-search-input-wrap {
    padding: 12px 16px;
    gap: 10px;
  }

  .site-search-input {
    font-size: 0.95rem;
  }

  .search-quick-tags {
    padding: 10px 14px;
    gap: 6px;
  }

  .search-result-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .search-res-right {
    flex-direction: row;
    width: 100%;
    justify-content: space-between;
    padding-left: 54px;
  }

  .search-modal-footer {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
}

/* --------------------------------------------------------------------------
   COMMODITY MARKET PRICES (market-prices.php) RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .market-hero-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }

  .market-hero-meta-box {
    width: 100%;
    min-width: 0;
  }

  .market-macro-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .market-intel-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .market-cta-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .market-hero-title {
    font-size: 1.85rem;
  }

  .market-macro-grid {
    grid-template-columns: 1fr;
  }

  .market-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .market-filter-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .market-search-mini {
    width: 100%;
    min-width: 0;
  }

  .market-briefing-header {
    flex-direction: column;
    gap: 12px;
  }

  .market-cta-actions {
    width: 100%;
    flex-direction: column;
  }

  .market-cta-actions a {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .market-hero-title {
    font-size: 1.6rem;
  }

  .market-briefing-card,
  .market-cta-banner {
    padding: 20px 16px;
  }

  .market-data-table th,
  .market-data-table td {
    padding: 10px 12px;
  }
}