/* Add to your existing styles */
nav .dropdown-toggle {
    padding: 8px 15px;
    background-color: #eee;
    border-radius: 15px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.3s;
    cursor: pointer;
    display: inline-block;
}

nav .dropdown-toggle:hover {
    background-color: #ccc;
}

nav .dropdown-menu {
    border-radius: 15px;
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 10px;
}

nav .dropdown-item {
    border-radius: 10px;
    margin: 2px 0;
    padding: 8px 15px;
}

nav .dropdown-item:hover {
    background-color: #f0f0f0;
}
 /* Add to your existing styles */
nav .dropdown-toggle {
    padding: 8px 15px;
    background-color: #eee;
    border-radius: 15px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.3s;
    cursor: pointer;
    display: inline-block;
}

nav .dropdown-toggle:hover {
    background-color: #ccc;
}

nav .dropdown-menu {
    border-radius: 15px;
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 10px;
}

nav .dropdown-item {
    border-radius: 10px;
    margin: 2px 0;
    padding: 8px 15px;
}

nav .dropdown-item:hover {
    background-color: #f0f0f0;
}
    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    body {
      font-family: Arial, sans-serif;
      background-color: #f9f9f9;
      color: #333;
      font-family: "Roboto", sans-serif;
      font-optical-sizing: auto;
      font-weight: 500;
      font-style: normal;
    }

    header {
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 20px;
      background-color: white;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
      position: sticky;
      top: 0;
      z-index: 1000;
    }

    #search {
      width: 500vw;
      max-width: 30vw;
      padding: 10px;
      border-radius: 20px;
    }
	
	/* Mobile-specific override */
	@media (max-width: 768px) {
	  #search {
		max-width: 90vw; /* almost full width on mobile */
	  }
	}

    nav {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      justify-content: center;
    }

    nav a {
      padding: 8px 15px;
      background-color: #eee;
      border-radius: 15px;
      text-decoration: none;
      color: #333;
      transition: background-color 0.3s;
      cursor: pointer;
    }

    nav a:hover {
      background-color: #ccc;
    }
	
	@media screen and (max-width: 480px) {
	  nav {
		  display: flex;
		  gap: 10px;
		  flex-wrap: wrap;
		  justify-content: center;
	  }

	  nav a {
		  padding: 6px 8px;
		  background-color: #eee;
		  border-radius: 15px;
		  text-decoration: none;
		  font-size:13px;
		  color: #333;
		  transition: background-color 0.3s;
		  cursor: pointer;
	  }
	}

	.gallery {
	  display: grid;
	  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));   
	  gap: 15px;
	  grid-auto-rows: 10px; /* Base row height */
	  column-count: 3;
	  column-gap: 15px;
	  margin-top:20px;
	}

		/* Small devices (up to 575.98px) */
	/* Small devices */
	@media (max-width: 575.98px) {
	  .gallery {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 10px;
		grid-auto-rows: 5px; /* Smaller base for mobile */
	  }
	}

	/* Medium devices (576px to 799.98px) */
	@media (min-width: 320px) and (max-width: 575.98px) {
	  .gallery {
		grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
		gap: 10px;
		grid-auto-rows: 7.5px;
	  }
	}
		@media (min-width: 320px) and (max-width: 425px) {
	  .gallery {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 10px;
		grid-auto-rows: 2px;
	  }
	}
	@media (min-width: 0px) and (max-width: 320px) {
	  .gallery {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 10px;
		grid-auto-rows: 0.3px;
	  }
	}

    .card {
      position: relative;
      background-color: white;
      border-radius: 10px;
      overflow: hidden;
	    border: none; /* This removes any border */
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
      transition: transform 0.3s ease, box-shadow 0.3s ease;
      animation: fadeIn 0.5s ease-in-out;
      cursor: pointer;
	    break-inside: avoid;

    }

    .card:hover {
      transform: translateY(-5px);
      box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    }

	.card img {
	  width: 100%;
	  /* Remove fixed height */
	  height: auto;
	  object-fit: cover;
	  display: block;
	}


    .card.loaded img {
      opacity: 1;
    }

    .card-content {
      padding: 10px;
    }	
    
    p {
      margin-bottom:0rem!important;
    }
    
	.price-label {
	  position: absolute;
	  top: 1em;
	  right: 10px;
	  background-color: white;
	  color: black;
	  padding: 4px 8px;
	  border-radius: 5px;
	  font-size: 0.85rem;
	  opacity: 0;
	  transition: opacity 0.3s ease;
	  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* Add this line */
	}

	/* Mobile adjustment */
	@media (max-width: 768px) {
	  .price-label {
		top: 0.5em;
		right: 6px;
		font-size: 0.6rem;

	  }
	}

    .card-id-label {
      position: absolute;
      top: 10px;
      left: 10px;
      background-color: rgba(0, 0, 0, 0.7);
      color: white;
      padding: 2px 6px;
      border-radius: 5px;
      font-size: 0.3rem;
      opacity: 0;
      transition: opacity 0.3s ease;
    }

    .card.loaded .price-label,
    .card.loaded .card-id-label {
      opacity: 1;
    }

    /* Skeleton loader styles */
    .card-skeleton {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
      background-size: 200% 100%;
      animation: skeletonLoading 1.5s infinite;
      border-radius: 10px;
    }

    .card-skeleton-content {
      padding: 10px;
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      background: white;
    }

    .skeleton-line {
      height: 12px;
      background: #e0e0e0;
      margin-bottom: 8px;
      border-radius: 4px;
    }

    .skeleton-line.short {
      width: 60%;
    }

    @keyframes skeletonLoading {
      0% {
        background-position: 200% 0;
      }
      100% {
        background-position: -200% 0;
      }
    }

    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(10px); }
      to { opacity: 1; transform: translateY(0); }
    }


	/* Custom modern popup styles */
.custom-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 15, 15, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
  opacity: 0;
  animation: fadeInBackdrop 0.3s forwards;
}

.custom-modal-content {
  background: white;
  border-radius: 20px;
  padding: 10px;
  max-width: 30%;
  max-height: 90vh;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: scaleIn 0.3s ease forwards;
  overflow: auto;
}

/* Adjust for mobile screens */
@media (max-width: 768px) {
  .custom-modal-content {
    max-width: 90%;
  }
}
.custom-modal-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.custom-modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 24px;
  cursor: pointer;
  color: #333;
}

/* Tags popup styles */
.tags-modal-content {
  background: white;
  border-radius: 20px;
  padding: 30px;
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: scaleIn 0.3s ease forwards;
  overflow: auto;
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.tags-container a {
  padding: 8px 15px;
  background-color: #eee;
  border-radius: 15px;
  text-decoration: none;
  color: #333;
  transition: background-color 0.3s;
  cursor: pointer;
  font-size: 0.9rem;
}

.tags-container a:hover {
  background-color: #ccc;
}

.tags-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.tags-header h3 {
  margin: 0;
  font-size: 1.5rem;
}

@keyframes fadeInBackdrop {
  to { opacity: 1; }
}

@keyframes scaleIn {
  0% { opacity: 0; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}


.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Skeleton Card Structure */
.skeleton-card {
  break-inside: avoid;
  margin-bottom: 20px;
  border-radius: 12px;
}

.skeleton-image {
  width: 100%;
  height: 200px; /* Adjust based on your card height */
  margin-bottom: 10px;
}

.skeleton-text {
  height: 15px;
  width: 80%;
  margin: 5px auto;
}