/* ========================= */
/* Filter Section Styling */
/* ========================= */
#toy-filter-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    width: 100%;
}

/* Filter Rows: Label + Dropdown */
.toy-filter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Labels for filters */
#toy-filter-container label {
    font-weight: bold;
    font-size: 14px;
    flex: 1;
    text-align: left;
}

/* Dropdown Select Boxes */
#toy-filter-container select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
    flex: 2;
}

/* Search Box */
#toy-filter-container input[type="text"]#search-filter {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    background-color: white;
    flex: 2;
    width: auto;
}

.toy-filter-row.is-active label {
    color: var(--vtl-green);
}

.toy-filter-row.is-active select,
.toy-filter-row.is-active input[type="text"] {
    border-color: var(--vtl-green);
    border-width: 1px;
    box-shadow: 0 0 0 2px rgba(21, 122, 110, 0.65);
}

/* Mobile overrides */
@media (max-width: 768px) {
    #toy-filter-container input[type="text"]#search-filter {
        flex: 1 1 100%;
        width: 100%;
    }
}


/* Buttons Wrapper - Buttons side by side */
#toy-filter-buttons{
  display: flex;
  gap: 16px;              /* space between the buttons */
  width: 100%;
  margin-top: 10px;
}

/* Make both buttons take equal width */
#toy-filter-buttons .btn{
  flex: 1 1 0;
}

/* ========================= */
/* Toy Grid Styling */
/* ========================= */
#toy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    justify-items: center;
    /* center each card horizontally */
    align-items: start;
    max-width: 1200px;
    /* nice cap; keeps rows balanced on large screens */
    margin: 0 auto;
}

/* Toy Items */
.toy-item {
    width: 100%;
    max-width: 250px;
    /* visual cap per card */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Toy Title */
.toy-item h3 {
    font-size: 16px;
    margin-bottom: 8px;
    text-align: center;
}

/* Clickable Toy Items */
.toy-item a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Thumbnail Image */
.toy-thumbnail {
    width: 100%;
    max-width: 250px;
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .1);
}

.toy-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Container for thumbnail and hover effect */
.toy-thumbnail {
    position: relative;
    overflow: hidden;
}

/* Hover overlay for title */
.toy-hover-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(216, 30, 91, 0.9);
    /* Pink with opacity */
    color: white;
    text-align: center;
    padding: 10px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* Hide h3 title on desktop */
@media (min-width: 601px) {
    .toy-item h3 {
        display: none;
    }

    .toy-thumbnail:hover .toy-hover-overlay {
        opacity: 1;
    }
}

/* Toy Count Message */
#toy-count-message {
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    margin-top: 15px;
}

/* ========================= */
/* Toy Grid Badges (New/Hot) */
/* ========================= */

/* Position the badges row in the thumbnail corner */
.toy-thumbnail { position: relative; }
.toy-badges{
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  gap: 6px;
  z-index: 2;
}

/* Shared badge look */
.toy-badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .5rem .5rem;
  line-height: 1;
  font-weight: 700;
  font-size: .8rem;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* “New!” chip (filled) */
.toy-badge-new{
  /* padding: .2rem .55rem; */
  background: var(--vtl-attention); /* pink */
  color: #fff;
}

/* Hot icon (round pill with flame) */
.toy-badge-hot{
  background: #ffffff;
  border-radius: 999px;
  max-width: 32px;
}


/* ========================= */
/* Responsive Adjustments */
/* ========================= */
@media (max-width: 1024px) {
    .toy-item {
        max-width: 200px;
    }

    #toy-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        /* tidy 3-up tablet landscape */
        gap: 18px;
    }
}

@media (max-width: 768px) {
    #toy-grid {
        justify-content: center;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        /* 2-up tablet/large phone */
        gap: 16px;
    }

    .toy-item,
    .toy-thumbnail {
        max-width: 220px;
    }

    #toy-filter-container {
        max-width: 100%;
    }

    #toy-filter-buttons {
        flex-direction: row;
        gap: 5px;
    }

    #apply-filter,
    #clear-filter {
        width: 50%;
    }

    /* Ensure filters stack properly on smaller screens */
    .toy-filter-row {
        flex-direction: column;
        align-items: flex-start;
    }

    #toy-filter-container select {
        width: 100%;
        margin-top: 5px;
    }
}

@media (max-width: 480px) {
    #toy-grid {
        grid-template-columns: 1fr;
    }

    .toy-item,
    .toy-thumbnail {
        max-width: 260px;
        /* a touch wider looks better single-column */
    }
}

/* Titles: show on touch, keep hover overlay on desktop */
@media (min-width: 601px) {
    .toy-item h3 {
        display: none;
    }

    .toy-thumbnail:hover .toy-hover-overlay {
        opacity: 1;
    }
}
