/* Header */
.gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 30px;
}

.back-btn {
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFF;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.header-title {
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 0.5px;
    color: #111;
    text-transform: uppercase;
}

/* Gallery Grid */
.gadget-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 0 15px;
}

.gadget-item {
    background: #FFF;
    border-radius: var(--r-small);
    padding: 8px;
    box-shadow: var(--glass-shadow);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.gadget-item:active {
    transform: scale(0.97);
}

.gadget-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    /* Thumbnails quadrate */
    background: rgba(0, 0, 0, 0.05);
    /* Segnaposto invisibile leggero */
    border-radius: var(--r-small);
    position: relative;
    overflow: hidden;
    margin-bottom: 8px;
}

.gadget-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.zoom-icon {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(255, 255, 255, 0.9);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    color: #111;
}

.gadget-title {
    font-weight: 700;
    font-size: 11px;
    line-height: 1.2;
    color: #111;
}

/* Free Badge */
.free-badge {
    text-align: center;
    margin-top: 40px;
    font-size: 13px;
    color: #666;
    font-weight: 500;
    padding: 0 20px;
}

/* Lightbox Modal Overlay */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.show {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    display: flex;
    justify-content: center;
}

#lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: block;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #FFF;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
}

/* --- Elegante Bottone Shop --- */
.gadget-shop-container {
    padding: 0 20px 40px 20px;
    margin-top: 10px;
}

.gadget-shop-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #111111;
    color: #FFFFFF;
    text-decoration: none;
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px 24px;
    border-radius: 99px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
    width: 100%;
}

.gadget-shop-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.gadget-shop-btn:active {
    transform: scale(0.96);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}