/* ============================================
   EXPLORE PAGE STYLES - HAZLNUT LIGHT THEME
   Category list with horizontal product rows
   Inspired by Kiki/Gokiki design
   ============================================ */

/* --- CSS Variables --- */
:root {
    --explore-bg: #faf8f5;
    --explore-card-bg: #ffffff;
    --explore-text-primary: #2c3e50;
    --explore-text-secondary: #666666;
    --explore-text-muted: #999999;
    --explore-accent: #E1B672;
    --explore-divider: #e0dcd5;
    --explore-card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --explore-card-radius: 12px;
    --explore-transition: all 0.25s ease;
}

/* --- Body --- */
.explore-body {
    padding-top: 80px;
    margin: 0;
    background-color: var(--explore-bg);
    font-family: 'Work Sans', sans-serif;
    color: var(--explore-text-primary);
    min-height: 100vh;
}

/* Content wrapper (viewport) adjusts with sidepane on desktop */
body.explore-body.has-sidepane .content-wrapper {
    background-color: var(--explore-bg);
}

/* --- Page Layout --- */
.explore-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 24px 80px;
    min-height: calc(100vh - 80px);
}

/* --- Header --- */
.explore-header {
    text-align: center;
    margin-bottom: 48px;
}

.explore-title {
    font-family: 'Merriweather', serif;
    font-size: 42px;
    font-weight: 700;
    color: var(--explore-text-primary);
    margin: 0 0 12px 0;
    letter-spacing: -0.02em;
}

.explore-subtitle {
    font-family: 'Work Sans', sans-serif;
    font-size: 16px;
    color: var(--explore-text-secondary);
    margin: 0;
}

/* ============================================
   CATEGORY SECTIONS - VERTICAL LIST
   ============================================ */

.category-sections {
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.category-section {
    width: 100%;
}

/* --- Category Header Row --- */
.category-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--explore-divider);
}

.category-title {
    font-family: 'Merriweather', serif;
    font-size: 24px;
    font-weight: 600;
    color: var(--explore-text-primary);
    margin: 0;
    white-space: nowrap;
}

.category-header-line {
    flex: 1;
    height: 0px;
    background: var(--explore-divider);
}

.category-view-all {
    font-family: 'Work Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--explore-accent);
    text-decoration: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--explore-transition);
}

.category-view-all:hover {
    color: #D4A85F;
}

.category-view-all i {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.category-view-all:hover i {
    transform: translateX(3px);
}

/* ============================================
   PRODUCTS HORIZONTAL STRIP
   ============================================ */

.products-strip-container {
    position: relative;
    width: 100%;
}

.products-strip {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    padding: 4px 0 16px;
    scroll-snap-type: x proximity;
}

.products-strip::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* ============================================
   PRODUCT CARD
   ============================================ */

.product-card {
    flex: 0 0 auto;
    width: 200px;
    background: var(--explore-card-bg);
    border-radius: var(--explore-card-radius);
    box-shadow: var(--explore-card-shadow);
    overflow: hidden;
    transition: var(--explore-transition);
    scroll-snap-align: start;
    text-decoration: none;
    display: block;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.product-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: #f5f5f5;
    overflow: hidden;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-card-image img {
    transform: scale(1.05);
}

.product-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: linear-gradient(135deg, #f5f1eb 0%, #e8e4dd 100%);
}

.product-card-content {
    padding: 12px;
}

.product-card-title {
    font-family: 'Work Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--explore-text-primary);
    margin: 0 0 6px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 36px;
}

.product-card-price {
    font-family: 'Work Sans', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--explore-accent);
    margin: 0;
}

.product-card-store {
    font-family: 'Work Sans', sans-serif;
    font-size: 12px;
    color: var(--explore-text-muted);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-card-store img {
    width: 14px;
    height: 14px;
    border-radius: 2px;
}

/* ============================================
   SKELETON LOADING
   ============================================ */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.product-card-skeleton {
    flex: 0 0 auto;
    width: 200px;
    background: var(--explore-card-bg);
    border-radius: var(--explore-card-radius);
    box-shadow: var(--explore-card-shadow);
    overflow: hidden;
}

.product-card-skeleton .skeleton-image {
    width: 100%;
    aspect-ratio: 1;
}

.product-card-skeleton .skeleton-content {
    padding: 12px;
}

.product-card-skeleton .skeleton-title {
    height: 16px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.product-card-skeleton .skeleton-price {
    height: 14px;
    width: 60%;
    border-radius: 4px;
}

/* ============================================
   WISHLIST HEART BUTTON
   ============================================ */

.wishlist-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--explore-transition);
    z-index: 2;
}

.product-card:hover .wishlist-btn {
    opacity: 1;
}

.wishlist-btn:hover {
    background: #ffffff;
    transform: scale(1.1);
}

.wishlist-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--explore-accent);
    fill: none;
    stroke-width: 2;
}

.wishlist-btn:hover svg {
    fill: var(--explore-accent);
}

/* ============================================
   NO PRODUCTS / EMPTY STATE
   ============================================ */

.products-empty {
    padding: 32px;
    text-align: center;
    color: var(--explore-text-muted);
    font-size: 14px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: var(--explore-card-radius);
}

.no-categories-message {
    text-align: center;
    padding: 80px 20px;
    color: var(--explore-text-secondary);
}

/* ============================================
   SCROLL ARROWS
   ============================================ */

.scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: var(--explore-card-bg);
    border: 1px solid var(--explore-divider);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: var(--explore-transition);
    opacity: 0;
    pointer-events: none;
}

.products-strip-container:hover .scroll-arrow {
    opacity: 1;
    pointer-events: auto;
}

.scroll-arrow:hover {
    background: var(--explore-accent);
    border-color: var(--explore-accent);
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 12px rgba(155, 96, 124, 0.3);
}

.scroll-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.scroll-arrow i {
    font-size: 14px;
    color: var(--explore-text-primary);
    transition: color 0.2s ease;
}

.scroll-arrow:hover i {
    color: #ffffff;
}

.scroll-arrow-left {
    left: -20px;
}

.scroll-arrow-right {
    right: -20px;
}

/* Hide arrows when at scroll limits */
.scroll-arrow.hidden {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ============================================
   SCROLL INDICATORS (fade edges)
   ============================================ */

.products-strip-container::before,
.products-strip-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 16px;
    width: 60px;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.products-strip-container::before {
    left: 0;
    background: linear-gradient(to right, var(--explore-bg), transparent);
}

.products-strip-container::after {
    right: 0;
    background: linear-gradient(to left, var(--explore-bg), transparent);
}

.products-strip-container.can-scroll-left::before {
    opacity: 1;
}

.products-strip-container.can-scroll-right::after {
    opacity: 1;
}

/* ============================================
   RESPONSIVE - TABLET & MOBILE (≤1024px)
   ============================================ */

@media (max-width: 1024px) {
    .explore-body {
        padding-top: 60px;
    }

    .explore-page {
        padding: 24px 16px 48px;
    }

    .explore-header {
        margin-bottom: 32px;
    }

    .explore-title {
        font-size: 28px;
    }

    .explore-subtitle {
        font-size: 14px;
    }

    .category-sections {
        gap: 32px;
    }

    .category-header {
        gap: 12px;
        margin-bottom: 16px;
    }

    .category-title {
        font-size: 18px;
    }

    .category-view-all {
        font-size: 13px;
    }

    .products-strip {
        gap: 12px;
        padding: 4px 0 12px;
        /* Allow scrolling to edge on mobile */
        margin: 0 -16px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .product-card {
        width: 160px;
    }

    .product-card-title {
        font-size: 13px;
        height: 34px;
    }

    .product-card-price {
        font-size: 14px;
    }

    /* Always show wishlist button on mobile/tablet */
    .wishlist-btn {
        opacity: 1;
    }

    /* Show scroll arrows always on mobile/tablet (no hover) */
    .scroll-arrow {
        opacity: 1;
        pointer-events: auto;
        width: 32px;
        height: 32px;
    }

    .scroll-arrow-left {
        left: 4px;
    }

    .scroll-arrow-right {
        right: 4px;
    }

    .scroll-arrow i {
        font-size: 12px;
    }
}

/* ============================================
   RESPONSIVE - SMALL MOBILE
   ============================================ */

@media (max-width: 480px) {
    .explore-title {
        font-size: 24px;
    }

    .category-title {
        font-size: 16px;
    }

    .category-header-line {
        display: none;
    }

    .product-card {
        width: 140px;
    }

    .product-card-content {
        padding: 10px;
    }

    .product-card-title {
        font-size: 12px;
        height: 32px;
    }

    .product-card-price {
        font-size: 13px;
    }
}

/* ============================================
   WISHLIST DROPDOWN - Compact, next to button
   ============================================ */

.wishlist-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1001; /* Above product detail modal (1000) */
    align-items: flex-start;
    justify-content: flex-start;
    pointer-events: none;
}

.wishlist-modal[style*="flex"] {
    display: flex;
}

.wishlist-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(1px);
    pointer-events: auto;
}

.wishlist-modal-content {
    position: fixed;
    background: var(--explore-card-bg);
    border-radius: 12px;
    width: 280px;
    max-height: 320px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--explore-divider);
    pointer-events: auto;
    z-index: 1002;
    padding: 12px 0 0;
}

.wishlist-loading {
    text-align: center;
    padding: 24px 16px;
}

.wishlist-loading .spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--explore-divider);
    border-top-color: var(--explore-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

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

.wishlist-loading p {
    font-family: 'Work Sans', sans-serif;
    font-size: 13px;
    color: var(--explore-text-muted);
    margin: 0;
}

.wishlists-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
    max-height: 200px;
    overflow-y: auto;
}

.wishlist-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: #f8f6f3;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    text-align: left;
}

.wishlist-item:hover {
    background: #f0ece6;
}

.wishlist-item.selected {
    background: rgba(155, 96, 124, 0.1);
    border-color: var(--explore-accent);
}

.wishlist-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--explore-accent);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.wishlist-item-text {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.wishlist-item-title {
    display: block;
    font-family: 'Work Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--explore-text-primary);
}

.wishlist-item-subtitle {
    display: block;
    font-family: 'Work Sans', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: var(--explore-text-muted);
    margin-top: 2px;
}

.no-wishlists,
.login-required {
    text-align: center;
    padding: 20px 16px;
}

.no-wishlists p,
.login-required p {
    font-family: 'Work Sans', sans-serif;
    font-size: 13px;
    color: var(--explore-text-secondary);
    margin: 0 0 12px 0;
}

.create-wishlist-link,
.login-btn {
    display: inline-block;
    font-family: 'Work Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: white;
    background: var(--explore-accent);
    padding: 8px 18px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.create-wishlist-link:hover,
.login-btn:hover {
    background: #D4A85F;
}

.wishlist-modal-footer {
    padding: 12px 12px 12px;
    border-top: 1px solid var(--explore-divider);
    margin-top: 8px;
    display: flex;
    justify-content: stretch;
}

.wishlist-add-btn {
    padding: 10px 16px;
    border-radius: 8px;
    font-family: 'Work Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--explore-accent);
    border: none;
    color: white;
    flex: 1;
}

.wishlist-add-btn:hover {
    background: #D4A85F;
}

.wishlist-add-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Wishlist dropdown responsive */
@media (max-width: 1024px) {
    .wishlist-modal-content {
        width: min(calc(100vw - 32px), 280px);
        max-height: 280px;
    }

    .wishlists-list {
        max-height: 160px;
    }
}
