/**
 * Inspiration Gallery Styles
 */

/* ===========================
   Gallery Page Layout
   =========================== */
.gallery-page {
    padding: 50px 0;
    padding-bottom: 120px;
    min-height: 60vh;
}

/* ===========================
   Gallery Grid (3 columns)
   =========================== */
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.gallery-header {
    text-align: left;
    margin-bottom: 2rem;
}

.gallery-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.gallery-title {
    /* var(--type-page-title) is uvw's shared H1 token; the 3rem/600 fallback
       keeps every other theme at the size it had. */
    font-size: var(--type-page-title, 3rem);
    font-weight: var(--title-weight, 600);
    margin: 0;
    color: var(--color-heading);
}

.btn-slideshow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 10px 20px;
    background: var(--grey-900);
    color: #FFF;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-slideshow:hover {
    background: var(--color-heading);
    transform: scale(1.02);
}

.btn-slideshow svg {
    flex-shrink: 0;
}

.gallery-subtitle {
    font-size: 1.5rem;
    color: var(--grey-500);
}

/* ===========================
   Theme (Category) Filters
   =========================== */
.gallery-themes {
    display: flex;
    justify-content: flex-start;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.theme-btn {
    padding: 5px 14px;
    margin: 10px 5px;
    border: 1px solid var(--grey-900);
    border-radius: 15px;
    background: #FFF;
    font-size: 15px;
    font-weight: 500;
    color: var(--grey-900);
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-btn:hover {
    background: var(--grey-100);
}

.theme-btn.active {
    background: var(--grey-900);
    color: #FFF;
}

.theme-btn-bookmarks {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
}

.theme-btn-bookmarks svg {
    flex-shrink: 0;
}

.theme-btn-bookmarks.active svg {
    fill: currentColor;
}

/* ===========================
   Separator
   =========================== */
.gallery-separator {
    border: none;
    border-top: 1px solid var(--grey-200);
    margin: 0 0 3rem 0;
}

/* ===========================
   Gallery Content Area
   =========================== */
.gallery-content {
    min-height: 300px;
}

/* ===========================
   Loading State
   =========================== */
.gallery-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    color: var(--grey-500);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--grey-200);
    border-top-color: var(--grey-900);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===========================
   Error State
   =========================== */
.gallery-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    text-align: center;
}

.gallery-error p {
    color: var(--grey-500);
    margin-bottom: 1rem;
}

/* ===========================
   Empty State
   =========================== */
.gallery-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    text-align: center;
}

.gallery-empty p {
    color: var(--grey-500);
    font-size: 1.125rem;
}

/* ===========================
   Mobile Adjustments
   =========================== */
@media (max-width: 768px) {
    .gallery-page {
        padding: 40px 0;
        padding-bottom: 60px;
    }

    .gallery-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .gallery-title {
        /* uvw's token carries the mobile step; 2rem stays the fallback for
           themes that do not define it. */
        font-size: var(--type-page-title, 2rem);
    }

    .gallery-subtitle {
        font-size: 1rem;
    }

    .theme-btn {
        padding: 4px 12px;
        font-size: 14px;
    }

    .btn-slideshow {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* ===========================
   Slideshow Modal
   =========================== */
.slideshow-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.slideshow-modal.active {
    display: block;
    opacity: 1;
}

.slideshow-modal-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.slideshow-close {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #FFF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    margin-left: auto;
    position: relative;
    top: 0px;
}

.slideshow-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Main Content Area - flexible height minus header and thumbnails */
.slideshow-main {
    flex: 1;
    display: flex;
    min-height: 0;
}

/* Image Area - takes remaining space */
.slideshow-image-area {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.slideshow-image-wrapper {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slideshow-image-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
    max-height: 100%;
}

.slideshow-image-container img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 200px);
    object-fit: contain;
    border-radius: 8px;
    position: relative;
    z-index: 1;
}

/* Navigation Arrows */
.slideshow-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #FFF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    z-index: 5;
}

.slideshow-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.slideshow-prev {
    left: 20px;
}

.slideshow-next {
    right: 20px;
}

/* Hotspots in Slideshow */
.slideshow-hotspot {
    position: absolute;
    z-index: 3;
    transform: translate(-50%, -50%);
}

.slideshow-hotspot .hotspot-dot {
    width: 36px;
    height: 36px;
    background: #FFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
}

.slideshow-hotspot .hotspot-dot::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--grey-900);
    border-radius: 50%;
}

.slideshow-hotspot .hotspot-pulse {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #FFF;
    opacity: 0.5;
    animation: hotspotPulse 2s infinite;
    pointer-events: none;
}

/* Hotspot click highlight effect */
.slideshow-hotspot.pulse-highlight .hotspot-dot {
    transform: scale(1.3);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

.slideshow-hotspot .hotspot-dot {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.slideshow-hotspot:hover .hotspot-dot {
    transform: scale(1.1);
    cursor: pointer;
}

/* Slideshow Hotspot Popup */
.slideshow-hotspot-popup {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 15px);
    transform: translateX(-50%);
    background: #FFF;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    max-width: 250px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
    pointer-events: none;
}

.slideshow-hotspot-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #FFF;
}

.slideshow-hotspot:hover .slideshow-hotspot-popup {
    opacity: 1;
    visibility: visible;
}

.slideshow-hotspot-popup.popup-left {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}

.slideshow-hotspot-popup-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
}

.slideshow-hotspot-popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slideshow-hotspot-popup-content {
    padding: 12px;
}

.slideshow-hotspot-popup-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-heading);
    margin: 0 0 5px 0;
    line-height: 1.3;
}

.slideshow-hotspot-popup-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-heading);
    margin: 0;
}

/* Products Sidebar - fixed 350px width */
.slideshow-sidebar {
    flex: 0 0 350px;
    width: 350px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.slideshow-sidebar-title {
    color: #FFF;
    font-size: 16px;
    font-weight: 600;
    padding: 20px;
    margin: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.slideshow-products {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Product Card in Slideshow - Horizontal layout */
.slideshow-product-card {
    background: #FFF;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    transition: box-shadow 0.3s ease;
}

.slideshow-product-card:hover {
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.slideshow-product-card.active {
    box-shadow: 0 0 0 2px var(--color-primary);
}

.slideshow-product-image {
    flex: 0 0 30%;
    width: 30%;
    aspect-ratio: 1;
    overflow: hidden;
}

.slideshow-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slideshow-product-info {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.slideshow-product-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-heading);
    margin: 0 0 3px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.slideshow-product-price {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-heading);
    margin: 0 0 8px 0;
}

.slideshow-product-actions {
    display: flex;
    flex-direction: row;
    gap: 6px;
}

.slideshow-product-actions .btn {
    flex: 1;
    font-size: 11px;
    padding: 6px 8px;
    white-space: nowrap;
}

/* Thumbnails Strip - 10% height */
.slideshow-thumbnails {
    height: 10%;
    min-height: 80px;
    background: rgba(0, 0, 0, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    overflow-x: auto;
}

.slideshow-thumbnails-inner {
    display: flex;
    gap: 10px;
    height: 100%;
    align-items: center;
}

.slideshow-thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.slideshow-thumbnail:hover {
    opacity: 0.8;
}

.slideshow-thumbnail.active {
    opacity: 1;
    border-color: #FFF;
}

.slideshow-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Slideshow Tablet - 275px sidebar */
@media (max-width: 1024px) and (min-width: 769px) {
    .slideshow-sidebar {
        flex: 0 0 275px;
        width: 275px;
    }

    .slideshow-product-name {
        font-size: 11px;
    }

    .slideshow-product-price {
        font-size: 12px;
    }
}

/* Slideshow Mobile - Hide sidebar on mobile, show full image */
@media (max-width: 768px) {
    .slideshow-sidebar {
        display: none;
    }

    .slideshow-image-area {
        width: 100%;
        padding: 10px;
    }

    .slideshow-nav {
        width: 40px;
        height: 40px;
    }

    .slideshow-prev {
        left: 10px;
    }

    .slideshow-next {
        right: 10px;
    }

    .slideshow-thumbnail {
        width: 60px;
        height: 45px;
    }

    .slideshow-image-container img {
        max-height: calc(100vh - 180px);
    }

    .slideshow-header {
        padding: 15px;
    }

    .slideshow-theme-btn {
        padding: 4px 10px;
        font-size: 12px;
    }
}

/* ===========================
   Slideshow Header with Theme Selector
   =========================== */
.slideshow-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 5px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.slideshow-themes {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    flex: 1;
    min-width: 0;
}

.slideshow-theme-btn {
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.slideshow-theme-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #FFF;
}

.slideshow-theme-btn.active {
    background: #FFF;
    color: var(--grey-900);
    border-color: #FFF;
}

/* ===========================
   Gallery Bookmark Button
   =========================== */
.gallery-bookmark-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--grey-600, #666);
    z-index: 4;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
}

.lookbook-image-wrapper:hover .gallery-bookmark-btn,
.gallery-bookmark-btn.active {
    opacity: 1;
}

.gallery-bookmark-btn:hover {
    background: #fff;
    transform: scale(1.1);
}

.gallery-bookmark-btn.active {
    color: var(--color-primary, #1a73e8);
    background: #fff;
}

.gallery-bookmark-btn.active svg {
    filter: drop-shadow(0 1px 2px rgba(26, 115, 232, 0.3));
}

/* Bookmark in slideshow */
.gallery-bookmark-btn.slideshow-bookmark {
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    opacity: 0.7;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
}

.gallery-bookmark-btn.slideshow-bookmark:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.6);
}

.gallery-bookmark-btn.slideshow-bookmark.active {
    opacity: 1;
    color: #fff;
    background: var(--color-primary, #1a73e8);
}
