/* ==========================================================================
   PLP (Product Listing Page) — AtrAroma Luxury
   ========================================================================== */

/* Prevent FOUC: hide Alpine-managed elements until Alpine.js processes the DOM. */
[x-cloak] {
    display: none !important;
}

/* Layout */
.plp-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.plp-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    align-items: start;
}

/* Mobile filter button */
.plp-mobile-filter-btn {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--color-primary, #1A1A1A);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-body, 'Inter', sans-serif);
    letter-spacing: 0.05em;
    cursor: pointer;
    margin-bottom: 24px;
    width: 100%;
    justify-content: center;
    transition: background 0.2s;
}

.plp-mobile-filter-btn:hover {
    background: #2a2a2a;
}

.plp-badge {
    background: var(--color-accent, #C5A059);
    color: #fff;
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

/* Sidebar */
.plp-sidebar {
    position: sticky;
    top: 20px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--color-light-border, #EDE8DE);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

/* Gold top accent */
.plp-sidebar::before {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent-dark, #A88B4A), var(--color-accent, #C5A059), var(--color-accent-light, #D4B76A));
}

.plp-sidebar__header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--color-light-border, #EDE8DE);
}

.plp-sidebar__header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font-heading, 'Playfair Display', serif);
    color: var(--color-primary, #1A1A1A);
}

.plp-close-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--color-warm-gray, #8A8680);
    padding: 4px;
    transition: color 0.2s;
}

.plp-close-btn:hover {
    color: var(--color-primary, #1A1A1A);
}

/* Filter sections */
.plp-filter-section {
    padding: 18px 20px;
    border-bottom: 1px solid var(--color-light-border, #EDE8DE);
}

.plp-filter-section:last-of-type {
    border-bottom: none;
}

.plp-filter-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-size: 11px;
    font-weight: 700;
    color: var(--color-warm-gray, #8A8680);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin: 0;
    padding: 0;
    font-family: var(--font-body, 'Inter', sans-serif);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}

.plp-filter-title:hover {
    color: var(--color-primary, #1A1A1A);
}

.plp-filter-arrow {
    width: 14px;
    height: 14px;
    transition: transform 0.2s;
    flex-shrink: 0;
    color: var(--color-warm-gray, #8A8680);
}

.plp-filter-arrow.is-open {
    transform: rotate(180deg);
}

/* Filter content area */
.plp-filter-content {
    padding-top: 12px;
}

/* Search input */
.plp-search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--color-light-border, #EDE8DE);
    border-radius: 10px;
    font-size: 13px;
    font-family: var(--font-body, 'Inter', sans-serif);
    margin-bottom: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    background: var(--color-bg, #FDFCF8);
    direction: rtl;
}

.plp-search-input:focus {
    outline: none;
    border-color: var(--color-accent, #C5A059);
    box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.1);
    background: #fff;
}

.plp-search-input::placeholder {
    color: #bbb;
}

/* Filter options */
.plp-filter-options {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.plp-scrollable {
    max-height: 240px;
    overflow-y: auto;
    padding-left: 4px;
}

.plp-scrollable::-webkit-scrollbar {
    width: 4px;
}

.plp-scrollable::-webkit-scrollbar-thumb {
    background: var(--color-light-border, #EDE8DE);
    border-radius: 4px;
}

/* Checkboxes */
.plp-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-family: var(--font-body, 'Inter', sans-serif);
    transition: background 0.15s;
    color: var(--color-primary, #1A1A1A);
}

.plp-checkbox:hover {
    background: var(--color-light-bg, #F5F3EE);
}

.plp-checkbox input {
    accent-color: var(--color-accent, #C5A059);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.plp-checkbox--child {
    padding-right: 28px;
    font-size: 12px;
    color: var(--color-warm-gray, #8A8680);
}

.plp-checkbox--parent {
    font-weight: 600;
}

.plp-count {
    margin-right: auto;
    font-size: 11px;
    color: var(--color-warm-gray, #8A8680);
    background: var(--color-light-bg, #F5F3EE);
    padding: 2px 8px;
    border-radius: 50px;
    font-weight: 500;
}

/* Active filters */
.plp-active-filters {
    padding: 14px 20px;
    border-bottom: 1px solid var(--color-light-border, #EDE8DE);
}

.plp-clear-btn {
    background: transparent;
    border: 1px solid #E65A28; /* Hermes Orange */
    color: #E65A28;
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-body, 'Inter', sans-serif);
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.05em;
}

.plp-clear-btn:hover {
    background: #E65A28;
    color: #fff;
}

/* Gender badge */
.plp-badge--gender {
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 50px;
    color: #fff;
}

/* Results bar */
.plp-results-bar {
    font-size: 13px;
    color: var(--color-warm-gray, #8A8680);
    margin-bottom: 24px;
    font-weight: 500;
}

/* Product grid */
.plp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

/* Product card */
.plp-card {
    background: #fff;
    border: 1px solid var(--color-light-border, #EDE8DE);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.plp-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
    border-color: var(--color-accent, #C5A059);
}

.plp-card__img-wrap {
    position: relative;
    background: var(--color-light-bg, #F5F3EE);
    padding-top: 100%;
    overflow: hidden;
}

.plp-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.plp-card:hover .plp-card__img {
    transform: scale(1.08);
}

.plp-card__badges {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: flex;
    gap: 6px;
}

.plp-card__body {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.plp-card__brand {
    font-size: 10px;
    font-weight: 700;
    color: var(--color-accent, #C5A059);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin: 0;
}

.plp-card__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-primary, #1A1A1A);
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.plp-card__en-name {
    font-size: 12px;
    color: var(--color-warm-gray, #8A8680);
    margin: 0;
}

.plp-card__price {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-primary, #1A1A1A);
    margin: 8px 0 0;
    margin-top: auto;
}

/* Skeleton */
.plp-skeleton {
    background: #fff;
    border: 1px solid var(--color-light-border, #EDE8DE);
    border-radius: 16px;
    overflow: hidden;
    padding-bottom: 18px;
}

.plp-skeleton__img {
    width: 100%;
    padding-top: 100%;
    background: linear-gradient(90deg, var(--color-light-bg, #F5F3EE) 25%, #eae7e0 50%, var(--color-light-bg, #F5F3EE) 75%);
    background-size: 200% 100%;
    animation: plp-shimmer 1.5s infinite;
}

.plp-skeleton__text {
    height: 14px;
    margin: 18px 18px 0;
    background: linear-gradient(90deg, var(--color-light-bg, #F5F3EE) 25%, #eae7e0 50%, var(--color-light-bg, #F5F3EE) 75%);
    background-size: 200% 100%;
    animation: plp-shimmer 1.5s infinite;
    border-radius: 6px;
}

.plp-skeleton__text--short {
    width: 60%;
    margin-bottom: 18px;
}

@keyframes plp-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Empty state */
.plp-empty {
    text-align: center;
    padding: 80px 20px;
}

.plp-empty p:first-child {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.plp-empty p:last-of-type {
    font-size: 15px;
    margin-bottom: 20px;
    color: rgba(29, 42, 68, 0.8); /* Deep Midnight Navy 80% */
}

/* Load more */
.plp-load-more {
    text-align: center;
    padding: 40px 0;
}

.plp-load-btn {
    padding: 14px 48px;
    background: #1D2A44; /* Midnight Navy */
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-body, 'Inter', sans-serif);
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.plp-load-btn:hover {
    background: #263656; /* Lighter Navy on hover */
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(29, 42, 68, 0.3);
}

.plp-load-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.plp-all-loaded {
    text-align: center;
    padding: 28px;
    color: var(--color-warm-gray, #8A8680);
    font-size: 13px;
}

/* Mobile overlay */
.plp-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 99;
}

/* Mobile apply button */
.plp-sidebar__footer {
    display: none;
    padding: 18px 20px;
    border-top: 1px solid var(--color-light-border, #EDE8DE);
}

.plp-apply-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--color-accent, #C5A059), var(--color-accent-dark, #A88B4A));
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-body, 'Inter', sans-serif);
    cursor: pointer;
    transition: all 0.2s;
}

.plp-apply-btn:hover {
    background: linear-gradient(135deg, var(--color-accent-light, #D4B76A), var(--color-accent, #C5A059));
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1023px) {

    .plp-mobile-filter-btn {
        display: flex;
    }

    .plp-layout {
        grid-template-columns: 1fr;
    }

    .plp-sidebar {
        position: fixed;
        top: 0;
        right: -100%;
        bottom: 0;
        width: 85%;
        max-width: 360px;
        z-index: 100;
        border-radius: 0;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }

    .plp-sidebar::before {
        display: none;
    }

    .plp-sidebar.is-open {
        right: 0;
    }

    .plp-sidebar__header {
        display: flex;
    }

    .plp-sidebar__footer {
        display: block;
    }

    .plp-overlay {
        display: block;
    }

    .plp-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .plp-card__body {
        padding: 14px;
    }

    .plp-card__title {
        font-size: 13px;
    }

    .plp-card__brand {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .plp-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .plp-card__body {
        padding: 12px;
    }

    .plp-card__title {
        font-size: 12px;
    }

    .plp-card__price {
        font-size: 13px;
    }
}
