.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Grid cards */
#grid>div {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s;
}

#grid>div:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#grid>div>div:first-child {
    flex-shrink: 0;
}

/* CAROUSEL — NO BLANKS, FULL HEIGHT */
#carouselTrack {
    width: 100%;
    height: 100%;
    display: flex;
    transition: transform 0.3s ease-in-out;
    overflow: hidden;
    background: #f9fafb;
    touch-action: pan-x;
}

#carouselTrack>div {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    padding: 0;
    margin: 0;
}

/* CAROUSEL — PURE CSS, NO TAILWIND */
#carouselTrack {
    width: 100%;
    height: 100%;
    display: flex;
    transition: transform 0.3s ease-in-out;
    overflow: hidden;
    background: #f9fafb;
    touch-action: pan-x;
}

#carouselTrack>div {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    padding: 0;
    margin: 0;
}

#carouselTrack img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* Dots */
.carousel-dot {
    width: 10px;
    height: 10px;
    background: #bbb;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.carousel-dot.active {
    background: #4f46e5;
}

/* NO PAGE SCROLL */
#modal {
    overscroll-behavior: contain;
    touch-action: none;
}

/* Swiper Arrows — MINIMAL, NO BACKGROUND */
.swiper-button-next,
.swiper-button-prev {
    color: #6366f1 !important;
    /* Softer indigo */
    background: none !important;
    width: 44px !important;
    height: 44px !important;
    margin-top: -22px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    color: #4f46e5 !important;
    transform: scale(1.15);
}

.swiper-button-next::after,
.swiper-button-prev::after {
    font-size: 20px;
    font-weight: bold;
}

/* Center ALL images (portrait & landscape) */
/* SUBTLE DARKER BACKGROUND — ELEGANT & CLEAN */
.swiper-slide {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #e5e7eb !important;
    /* Soft medium gray (was #f9fafb) */
    padding: 0 !important;
    margin: 0 !important;
}

.swiper-slide img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

.swiper-pagination-bullet {
    background: #cbd5e1;
    opacity: 1;
}

.swiper-pagination-bullet-active {
    background: #6366f1 !important;
}

/* Photo count badge — subtle & premium */
.grid-photo-badge {
    font-family: system-ui, -apple-system, sans-serif;
    font-weight: 600;
}

#googleSignInButton.hidden {
    display: none !important;
}

.user-menu-dialog {
    max-width: calc(100vw - 2rem);
}

.user-menu-email {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
}

@media (max-width: 640px) {
    .user-menu-dialog {
        position: fixed;
        top: 4.5rem;
        right: 1rem;
        left: 1rem;
        width: auto;
        max-width: none;
    }
}

#preferitiOverlay.hidden {
    display: none;
}

@media (max-width: 640px) {
    #preferitiSidebar {
        width: 100vw;
        /* Full width on mobile */
    }

    #preferitiToggle {
        flex-shrink: 0;
        /* Prevent shrinking */
    }

    #preferitiOverlay {
        z-index: 40 !important;
        /* Ensure overlay is below modal but above grid */
    }

    #grid {
        pointer-events: auto;
        /* Ensure grid is always clickable */
    }
}

/* BADGE STATUS – identici a quelli di index.html */
.badge-disponibile {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    /* più piccolo */
    font-size: 0.65rem;
    /* testo più piccolo */
    font-weight: 600;
    color: white;
    background-color: #10b981;
    /* emerald-500 come in index */
    border-radius: 9999px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.badge-venduto {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    background-color: #ef4444;
    /* red-500 */
    border-radius: 9999px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.badge-consegnato {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    background-color: #b91c1c;
    /* red-700 */
    border-radius: 9999px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.position-item-sold {
    border-color: #ef4444 !important;
    border-left-width: 4px;
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.08);
}

.position-item-delivered {
    border-color: #b91c1c !important;
    border-left-width: 4px;
    box-shadow: inset 0 0 0 1px rgba(185, 28, 28, 0.1);
}

/* Toast notification */
#toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 300px;
    padding: 14px 24px;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9999;
    text-align: center;
}

#toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

#toast.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

#toast.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.badge-venduto,
.badge-consegnato,
.badge-disponibile {
  display: block;
  width: 100%;
  text-align: center;
}
