/* ================================
    GALERÍA DE GORRAS (MOBILE FIRST)
   ================================ */
.hats-container {
    padding: 2.5rem;
    background-color: #fff;
    text-align: center;
    margin-top: 80px; /* Ajusta según altura del header */;
}

/* --- GALERIA DE GORRAS--- */
.hats-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columnas fijas */
    gap: 1rem;
    overflow-y: auto; /* Scroll vertical si hay muchas gorras */
    padding-bottom: 1rem;
    min-height: calc(100dvh - 207px);
    padding-right: 12px; /* Espacio para el scrollbar */
}

.hat-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    max-height: 240px;
    min-width: 100px;
    border-radius: 1rem;
    overflow: hidden;
    background: #fff;
    /* PUT IF IT IS NOT PURE WHITE BG */
    /* background: #F8F8F8; */
    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.hat-item::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(255,255,255,0.3), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.hat-item:hover {
    transform: translateY(-4px);
    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.12),
        0 4px 10px rgba(0, 0, 0, 0.08);
}

.hat-item:hover::before {
    opacity: 1;
}

.hat-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.hat-item:hover img {
    transform: scale(1.2);
}

/* --- Scroll más limpio --- */
.hats-gallery::-webkit-scrollbar {
    width: 6px;
}

.hats-gallery::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 10px;
}

/* BACK BTN */
.header-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.2rem;
    font-weight: bold;
    text-decoration: none;
    color: var(--primary-color-soft);
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--primary-color-dark);
    transition: background 0.2s ease, transform 0.1s ease;
    margin-bottom: 22px;
}

.back-btn:hover {
    background: var(--primary-color);
    transform: translateX(-2px);
}

.back-icon {
    font-size: 1.1rem;
}

.hats-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    color: var(--primary-color-dark);
}

/* --- Tablets --- */
@media (min-width: 600px) {
    .hats-gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

/* --- Desktop --- */
@media (min-width: 900px) {
    .hats-gallery {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
        max-height: none; /* Sin límite de altura */
    }
}