/* ============================================
   1. BASE MOBILE RESETS
   ============================================ */
body {
  font-size: 14px;
  line-height: 1.5;
}

/* ============================================
   2. PAGE HEADERS
   ============================================ */
h1 {
  font-size: 1.1rem;
  padding: 10px 12px;
  margin: 10px auto;
  width: 95%;
  border-radius: 6px;
}

h2 {
  font-size: 1rem;
}

h3 {
  font-size: 0.9rem;
}

/* ============================================
   3. CARD SYSTEM - BACKGROUND IMAGE LAYOUT
   ============================================ */
.cards {
  padding: 0 8px;
}

.card {
  min-height: 140px;
  padding: 12px;
  margin: 10px auto;
  width: 95%;
  border-radius: 12px;
  align-items: flex-end;
}

/* Logo fills card background on mobile */
.card .logo {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Override desktop constraints */
  max-width: unset;
  max-height: unset;
  min-width: unset;
  min-height: unset;
  z-index: 1;
  padding: 0;
  margin: 0;
  border-radius: 0;
}

.card .logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

/* Gradient overlay for mobile (White to transparent) */
.card::before {
  content: "";
  display: block; /* Ensure it overrides the desktop display: none */
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(255,255,255,1) 0%, rgba(255,255,255,0.95) 40%, rgba(255,255,255,0.6) 70%, rgba(255,255,255,0.3) 100%);
  z-index: 2;
  pointer-events: none;
}

/* Card Text Container */
.text {
  flex: 1;
  padding: 0 5px;
  gap: 4px;
  min-width: 0;
  color: var(--color-text); /* Restore dark text */
  text-shadow: none;
  position: relative;
  z-index: 3;
}

/* Card Title */
.title {
  font-size: 0.85rem;
  margin: 0 0 3px 0;
  line-height: 1.3;
  color: var(--color-text);
  font-weight: bold;
}

/* Card Description */
.description {
  font-size: 0.7rem;
  line-height: 1.4;
  padding: 0;
  color: #555;
}

.preview {
  margin-bottom: 4px;
}

/* Card Meta Info */
.location,
.phone,
.time {
  font-size: 0.65rem;
  margin: 2px 0;
}

.location::before,
.time::before {
  width: 0.8rem;
  height: 0.8rem;
  margin-left: 0.25rem;
}

/* Read More Link */
.ReadMore {
  font-size: 0.6rem;
  margin: 3px 0;
}

/* Card Divider */
.card hr {
  margin: 6px 0;
  border-width: 0.5px;
}

/* Field Labels */
.field-label {
  font-size: 0.65rem;
  margin-left: 0.2rem;
}

/* ============================================
   4. WHATSAPP BUTTON - COMPACT
   ============================================ */
.card > .phone {
  flex-shrink: 0;
  width: auto;
  min-width: 70px;
}

.whatsUp {
  padding: 6px 10px;
  gap: 4px;
  border-radius: 20px;
  font-size: 0.7rem;
  min-height: 36px;
  white-space: nowrap;
}

.whatsUp img {
  width: 14px;
  height: 14px;
}

.whatsUp .wa-text {
  font-size: 0.65rem;
}

/* ============================================
   5. FILTERS - COMPACT
   ============================================ */
.filters {
  padding: 10px;
  margin: 10px auto;
  gap: 8px;
  width: 95%;
  border-radius: 8px;
}

.filter-group {
  min-width: unset;
  width: 100%;
}

.filter-group label {
  font-size: 0.75rem;
  margin-bottom: 3px;
}

.filter-group select {
  padding: 8px 10px;
  font-size: 0.8rem;
  border-width: 1.5px;
}

/* ============================================
   6. BRANCH SELECTOR - COMPACT
   ============================================ */
.branch-selector {
  margin: 15px auto 25px auto; /* Increased margin bottom */
  gap: 12px; /* Increased gap */
  width: 95%;
  padding: 0 10px;
}

.branch-btn {
  padding: 12px 10px; /* Larger tap area */
  font-size: 0.8rem;
  border-radius: 10px;
  border-width: 1.5px;
  gap: 6px;
  flex: 1; /* Distribute width equally */
}

.branch-btn .icon {
  font-size: 1.1rem;
}

/* ============================================
   7. NAVIGATION - MOBILE ADJUSTMENTS
   ============================================ */
.main-nav {
  padding: 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: linear-gradient(135deg, var(--primary), #ff6b8a); /* Ensure background covers content */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.nav-container {
  padding: 8px 12px;
}

.nav-logo {
  font-size: 0.95rem;
  gap: 6px;
  padding: 6px 0;
}

.nav-logo img {
  width: 32px;
  height: 32px;
}

.nav-links li a {
  padding: 12px 20px;
  font-size: 0.9rem;
}

/* ============================================
   8. HERO SECTION (SUPPLIER PAGE)
   ============================================ */
.hero-section {
  padding: 30px 12px;
  min-height: 320px;
}

.hero-title {
  font-size: 1.15rem;
  margin-bottom: 20px;
}

.hero-container {
  gap: 20px;
}

.hero-filter-box {
  padding: 25px 2px; /* Increased padding */
  min-width: unset;
  max-width: 320px;
  width: 100%;
  border-radius: 16px; /* rounder corners */
}


.hero-filter-box h2 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.hero-filter-box .hero-subtitle {
  font-size: 0.8rem;
  margin-bottom: 20px; /* More space below subtitle */
}

.hero-filter-box select {
  padding: 14px 12px; /* Larger touch target */
  font-size: 0.9rem;
  margin-bottom: 12px; /* Space between selects */
}

.hero-filter-box .filter-group {
  margin-bottom: 20px; /* More space between groups */
  gap: 15px; /* Gap for flex items inside */
}

.search-box-container {
    margin-bottom: 15px;
}

#searchInput {
  padding: 14px 12px !important; /* Larger touch target */
  font-size: 0.9rem !important;
}

.hero-search-btn {
  padding: 10px;
  font-size: 0.9rem;
  margin-top: 8px;
}

/* Hero Features */
.hero-features {
  padding: 15px 10px;
}

.hero-features-container {
  gap: 15px;
  flex-direction: column;
  align-items: center;
}

.hero-features-list {
  width: 100%;
}

.hero-features-list li {
  font-size: 0.8rem;
  margin-bottom: 8px;
  gap: 6px;
}

.hero-features-list li::before {
  font-size: 0.9rem;
}

.hero-map {
  width: 100%;
}

.hero-map img {
  max-width: 120px;
}

.hero-map p {
  font-size: 0.8rem;
  margin-top: 6px;
}

/* ============================================
   9. FORM PAGE - COMPACT
   ============================================ */
/* ============================================
   9. FORM PAGE - COMPACT
   ============================================ */
.form-container {
  padding: 15px;
  margin: 90px auto 10px auto; /* Increased top margin for fixed header */
  width: 95%;
  border-radius: 10px;
}

.form-title {
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.form-subtitle {
  font-size: 0.8rem;
  margin-bottom: 15px;
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  font-size: 0.8rem;
  margin-bottom: 5px;
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 10px;
  font-size: 0.85rem;
}

.required-note {
  font-size: 0.75rem;
  margin-bottom: 12px;
}

.submit-btn {
  padding: 12px;
  font-size: 0.95rem;
}

.upload-area {
  padding: 20px 15px;
  border-radius: 10px;
}

.upload-icon {
  font-size: 2rem;
}

.upload-area p {
  font-size: 0.8rem;
}

.upload-area small {
  font-size: 0.7rem;
}

/* ============================================
   10. ABOUT PAGE - COMPACT
   ============================================ */
.about-container {
  padding: 20px 15px;
  margin: 90px auto 10px auto; /* Increased top margin for fixed header */
  width: 95%;
  border-radius: 10px;
}

.about-logo {
  width: 80px;
  height: 80px;
  margin-bottom: 12px;
}

.about-title {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.about-description {
  font-size: 0.85rem;
  line-height: 1.6;
  margin-bottom: 15px;
}

.about-stats {
  gap: 20px;
  margin-top: 20px;
}

.stat-number {
  font-size: 1.8rem;
}

.stat-label {
  font-size: 0.75rem;
}

/* ============================================
   11. SOCIAL MEDIA PAGE - COMPACT
   ============================================ */
.social-container {
  padding: 20px 15px;
  margin: 10px auto;
  width: 95%;
}

.social-title {
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.social-links {
  gap: 10px;
}

.social-link {
  padding: 12px 15px;
  gap: 10px;
  font-size: 0.9rem;
}

.social-link .icon {
  font-size: 1.3rem;
}

/* ============================================
   12. SHARE PAGE - COMPACT
   ============================================ */
.share-container {
  padding: 20px 15px;
  margin: 10px auto;
  width: 95%;
}

.share-title {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.share-description {
  font-size: 0.85rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

.share-buttons {
  gap: 10px;
  margin-bottom: 20px;
}

.share-btn {
  padding: 10px 18px;
  font-size: 0.85rem;
}

.copy-link-box {
  padding: 10px;
}

.copy-link-box input {
  font-size: 0.8rem;
  padding: 8px;
}

.copy-link-box button {
  padding: 8px 15px;
  font-size: 0.8rem;
}

/* ============================================
   13. UTILITY CLASSES
   ============================================ */

/* Ensure no horizontal scroll */
html,
body {
  overflow-x: hidden;
}

/* Touch-friendly minimum sizes */
button,
a.submit-btn,
select,
input[type="submit"],
input[type="button"] {
  min-height: 44px;
}

/* Better text rendering on mobile */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Prevent zoom on input focus (iOS) */
input,
select,
textarea {
  font-size: 16px;
}



/* ============================================
   15. COLLAPSIBLE FILTERS
   ============================================ */

/* Filter toggle button - visible on mobile */
.filter-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 95%;
  max-width: 400px;
  margin: 10px auto;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--primary), #ff6b8a);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.541);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.397);
}

.filter-toggle-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(248, 66, 105, 0.3);
}

.filter-toggle-btn:active {
  transform: scale(0.98);
}

.filter-toggle-btn .toggle-icon {
  transition: transform 0.3s ease;
}

.filter-toggle-btn.open .toggle-icon {
  transform: rotate(180deg);
}

/* Filters - collapsible on mobile */
.filters {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0 10px;
  margin: 0 auto;
  transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease, margin 0.3s ease;
}

.filters.open {
  max-height: 500px;
  opacity: 1;
  padding: 10px;
  margin: 10px auto;
}

/* ============================================
   16. EXTRA SMALL SCREENS (< 360px)
   ============================================ */
@media (max-width: 380px) {
  .hero-filter-box {
    margin: auto;
    padding: 25px 10px; /* Increased padding */
    min-width: unset;
    max-width: 380px;
    width: 100%;
    border-radius: 16px; /* rounder corners */
    
    font-size: 0.3em;
  }
  .branch-btn{
    display: flex;
    flex-direction: column;
    font-size: 0.3em;
    padding: 2px 1px;
    gap: 3px;
  }
  .brand-card{
    padding: 2px 1px;
    font-size: smaller;
  }
}

@media (max-width: 500px) {
  .card {
    flex-direction: column;
  }

  .logo {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .text {
    padding: 0 8px;
  }

  .card > .phone {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .whatsUp {
    width: 80%;
    justify-content: center;
  }

  .branch-btn {
    font-size: 0.65rem;
    padding: 3px 2px;
  }

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

  /* Single column on very small screens */
  #cardsContainer {
    grid-template-columns: 1fr;
  }

  .social-links {
    grid-template-columns: 1fr;
  }

  .hero-filter-box {
    margin: auto;
    padding: 25px; /* Increased padding */
    min-width: unset;
    max-width: 490px;
    width: 100%;
  }
}


 
/* ============================================
   TABLET OPTIMIZATIONS (500px - 768px)
   ============================================ */
@media (min-width: 500px) and (max-width: 768px) {
  #cardsContainer {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px; /* Consistent gap */
    padding: 0 16px;
  }

  .card {
    display : flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: right;
    width: 100%;
    margin: 0; 
  }

  /* Ensure full description is hidden initially */
  .description.full-view {
    display: none;
  }

  .text {
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: right;
  }

  /* Adjust font sizes for grid layout to prevent cramming */
  .title {
    font-size: 0.9rem;
    white-space: nowrap; /* Prevent multiline title mess */
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .description {
    font-size: 0.7rem;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limit text lines */
    line-clamp: 2; /* Standard property */
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* READ MORE LOGIC: 
     When expanded, hide preview, show full-view, and disable clamping 
  */
  .description-container.expanded .description.preview {
    display: none;
  }

  .description-container.expanded .description.full-view {
    display: block; /* Show the full text */
    -webkit-line-clamp: unset; /* Remove clamping */
    line-clamp: unset;
    overflow: visible; /* Show all content */
  }

  /* Hide less critical info if crowded */
  .location, .time {
    font-size: 0.65rem;
  }

    .whatsUp {
    width: 80%;
    justify-content: center;
  }
  .card > .phone {
    width: 100%;
    display: flex;
    justify-content: center;
  }
  .hero-filter-box {
    margin: auto;
    padding: 30px; /* Increased padding */
    min-width: 490;
    max-width: 760px;
    width: 100%;
  }
}

/* ============================================
   MOVED FROM STYLE.CSS (Mobile Navigation)
   ============================================ */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: row;
    justify-content: space-between;
    padding: 10px 15px;
  }
  
  /* Add spacing for the fixed header so the slider isn't hidden */
  .slider-container {
      margin-top: 90px !important;
  }
  
  .hamburger {
    display: flex;
  }
  
  .nav-links {
    display: flex;
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    max-width: 300px;
    height: 100vh;
    background: linear-gradient(180deg, var(--primary), #ff6b8a);
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 80px;
    gap: 0;
    transition: right 0.3s ease;
    box-shadow: -5px 0 20px rgba(0,0,0,0.2);
    z-index: 1000;
  }
  
  .nav-links.open {
    right: 0;
  }
  
  .nav-links li {
    width: 100%;
  }
  
  .nav-links li a {
    padding: 15px 25px;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: block;
  }
  
  /* Mobile overlay */
  .nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
  }
  
  .nav-overlay.show {
    display: block;
  }
  
  /* Center hero filter on mobile */
  .hero-container {
    justify-content: center;
  }
  
  .hero-filter-box {
    margin: 0 auto;
  }
}


