/* ── Products list page ──────────────────────────────────── */
.user-main {
    background: white;
}

.user-header {
    border-bottom: unset;
}

/* Layout */
.pl-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 40px;
}

@media (min-width: 768px) {
    .pl-layout {
        flex-direction: row;
    }
}

/* Sidebar */
.pl-sidebar-track {
    display: none;
}

@media (min-width: 768px) {
    .pl-sidebar-track {
        display: block;
        width: 240px;
        flex-shrink: 0;
    }

    .pl-sidebar {
        position: sticky;
        top: 80px;
    }
}

.pl-main {
    flex: 1;
    min-width: 0;
}

/* Sidebar sections */
.pl-sidebar-section {
    margin-bottom: 28px;
}

.pl-sidebar-title {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pl-sidebar-title svg {
    color: #9ca3af;
    flex-shrink: 0;
}

/* Category buttons */
.pl-cat-btn {
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    border-radius: 6px;
    transition: background 0.15s;
}

.pl-cat-btn:hover {
    background: #f3f4f6;
    color: #111827;
}

.pl-cat-btn.active {
    color: var(--u-primary);
    background: #eff6ff;
    font-weight: 700;
}

.pl-expand-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 4px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: transform 0.2s, color 0.15s;
}

.pl-expand-btn:hover {
    color: #6b7280;
}

.pl-expand-btn.open svg {
    transform: rotate(90deg);
}

.pl-subcat-list {
    margin-left: 16px;
    border-left: 2px solid #e5e7eb;
    padding-left: 6px;
    display: none;
    margin-top: 2px;
    margin-bottom: 4px;
}

.pl-subcat-list.open {
    display: block;
}

.pl-subcat-btn {
    width: 100%;
    text-align: left;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
}

.pl-subcat-btn:hover {
    background: #f3f4f6;
    color: #111827;
}

.pl-subcat-btn.active {
    color: var(--u-primary);
    background: #eff6ff;
    font-weight: 700;
}

.pl-subcat-btn--indent {
    padding-left: 22px;
    font-size: 11px;
    color: #6b7280;
}

.pl-subcat-btn--indent::before {
    content: '└ ';
    color: #d1d5db;
}

.pl-child-item-wrap {
    display: flex;
    flex-direction: column;
}

.pl-child-header {
    display: flex;
    align-items: center;
}

.pl-child-header .pl-subcat-btn {
    flex: 1;
}

.pl-grandchild-list {
    display: none;
}

.pl-grandchild-list.open {
    display: block;
}

/* Selects */
.pl-date-select,
.pl-sort-select {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    background: #fff;
    outline: none;
    cursor: pointer;
    color: #374151;
    appearance: auto;
}

.pl-date-select:focus,
.pl-sort-select:focus {
    border-color: var(--u-primary);
}

/* Price inputs */
.pl-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pl-price-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    width: 100%;
    outline: none;
    color: #374151;
    min-width: 0;
}

.pl-price-input:focus {
    border-color: var(--u-primary);
}

/* Custom date range */
.pl-date-custom-box {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pl-date-custom-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #2563eb;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.pl-date-custom-input {
    width: 100%;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 13px;
    background: #fff;
    outline: none;
    box-sizing: border-box;
}

.pl-date-custom-input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}

.pl-date-picker-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.pl-date-picker-wrap .pl-date-text {
    flex: 1;
    padding-right: 32px;
}

.pl-date-calendar-btn {
    position: absolute;
    right: 6px;
    background: none;
    border: none;
    cursor: pointer;
    color: #60a5fa;
    display: flex;
    align-items: center;
    padding: 2px;
    line-height: 1;
}

.pl-date-calendar-btn:hover {
    color: #2563eb;
}

.pl-date-native {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
    border: none;
}

/* Clear link */
.pl-clear-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #2563eb;
    text-decoration: none;
    white-space: nowrap;
}

.pl-clear-link:hover {
    text-decoration: underline;
}

/* ── Mobile filter bar ─────────────────────────────────── */
.pl-mobile-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

@media (min-width: 768px) {
    .pl-mobile-bar {
        display: none;
    }
}

.pl-mobile-search {
    flex: 1;
    position: relative;
}

.pl-mobile-search-input {
    width: 100%;
    padding: 15px 40px 15px 36px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    color: #374151;
    background: #f3f3f4;
    box-sizing: border-box;
}

.pl-mobile-search-input:focus {
    background: #d1d5db;
}

.pl-barcode-icon-btn {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 40px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #494645;
    padding: 0;
}

.pl-barcode-icon-btn:hover {
    color: #374151;
}

.pl-mobile-search .pl-search-icon-btn {
    color: #494645;
}

.pl-search-icon-btn {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 36px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    padding: 0;
}

.pl-search-icon-btn:hover {
    color: #2563eb;
}

.pl-search-icon {
    pointer-events: none;
}

.pl-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    color: #494645;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
}

.pl-filter-btn.active {
    background: var(--u-primary);
    color: #fff;
    border-color: var(--u-primary);
}

.pl-filter-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Mobile filter panel ───────────────────────────────── */
.pl-filter-panel {
    display: none;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.pl-filter-panel.open {
    display: block;
}

.pl-fp-section {
    margin-bottom: 20px;
}

.pl-fp-section:last-child {
    margin-bottom: 0;
}

.pl-fp-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.pl-date-btns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.pl-date-btn {
    padding: 6px 4px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    color: #4b5563;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s, color 0.15s;
}

.pl-date-btn:hover {
    background: #f3f4f6;
}

.pl-date-btn.active {
    background: var(--u-primary);
    color: #fff;
    border-color: var(--u-primary);
}

.pl-btn-clear-all {
    width: 100%;
    padding: 10px;
    font-size: 13px;
    font-weight: 700;
    color: #ef4444;
    background: #fff;
    border: 1px solid #fecaca;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    transition: background 0.15s;
}

.pl-btn-clear-all:hover {
    background: #fff1f1;
    text-decoration: none;
    color: #ef4444;
}

/* ── PC search bar ─────────────────────────────────────── */
.pl-pc-search {
    display: none;
    margin-bottom: 16px;
}

@media (min-width: 768px) {
    .pl-pc-search {
        display: block;
    }
}

.pl-pc-search-input {
    width: 100%;
    padding: 12px 36px 12px 40px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    color: #374151;
    background: #fff;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.pl-pc-search-input:focus {
    border-color: var(--u-primary);
    box-shadow: 0 0 0 3px rgba(31, 94, 255, 0.1);
}

.pl-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    padding: 4px;
}

.pl-search-clear:hover {
    color: #6b7280;
}

/* ── Result bar ────────────────────────────────────────── */
.pl-result-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 8px;
    flex-wrap: wrap;
}

.pl-result-count {
    font-size: 17px;
    font-weight: 500;
    color: #494645;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.pl-result-count strong {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

/* ── Product grid ──────────────────────────────────────── */
.pl-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .pl-grid {
        gap: 16px;
    }
}

@media (min-width: 1024px) {
    .pl-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1280px) {
    .pl-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Product card */
.pl-card {
    position: relative;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.15s;
    text-decoration: none;
    color: inherit;
}

.pl-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pl-card-img {
    height: 120px;
    flex-shrink: 0;
    background: #f3f4f6;
    position: relative;
    overflow: hidden;
}

.pl-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pl-soldout-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pl-soldout-label {
    background: rgba(255, 255, 255, 0.9);
    color: #374151;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 9999px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.pl-btn-soldout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 8px;
    background: #f3f4f6;
    color: #9ca3af;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: not-allowed;
    margin-top: 8px;
    box-sizing: border-box;
}

@media (min-width: 640px) {
    .pl-btn-soldout {
        padding: 10px;
        font-size: 14px;
        border-radius: 8px;
    }
}

.pl-badge-group {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    max-width: 90%;
}

.sale-badge {
    font-size: 12px;
    font-weight: 400;
    color: #fff;
    padding: 4px 8px;
    line-height: 1.4;
}

.sale-badge.badge-lottery     { background: #ad971f; letter-spacing: 0.25em; text-indent: 0.25em; }
.sale-badge.badge-reservation { background: #16a34a; }
.sale-badge.badge-store-only  { background: #bd1038; }
.sale-badge.badge-low-stock   { background: #004d99; letter-spacing: 0.25em; text-indent: 0.25em; }
.sale-badge.badge-sold-out    { background: #64748b; letter-spacing: 0.25em; text-indent: 0.25em; }

.sale-badge.badge-coming-soon { background: #b45309; }

.pl-card-body {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

@media (min-width: 640px) {
    .pl-card-body {
        padding: 16px;
    }
}

.pl-card-maker {
    font-size: 10px;
    font-weight: 400;
    line-height: 14px;
    min-height: 14px;
    color: #b8b8b8;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 640px) {
    .pl-card-maker {
        font-size: 12px;
    }
}

.pl-card-name {
    font-size: 14px;
    font-weight: 500;
    line-height: 19px;
    color: #494645;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* Chips */
.pl-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.pl-date-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    font-weight: 700;
    color: var(--u-primary);
    background: #eff6ff;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.pl-cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 9px;
    font-weight: 700;
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.pl-card-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #d1d5db;
    gap: 4px;
}

.pl-card-no-img span {
    font-size: 10px;
    font-weight: 700;
}

.pl-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    overflow: hidden;
}

.pl-card-date {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #494645;
    flex-shrink: 0;
}

/* Price */
.pl-card-price {
    margin-top: auto;
}

.pl-price-val {
    font-size: 16px;
    font-weight: 700;
    color: #494645;
}

.pl-price-val--1         { color: #ad971f; } /* lottery */
.pl-price-val--2         { color: #b7183f; } /* store only */
.pl-price-val--low-stock { color: #004d99; }

@media (min-width: 640px) {
    .pl-price-val {
        font-size: 18px;
    }
}

.pl-price-tax {
    font-size: 12px;
    font-weight: 500;
    color: #494645;
    margin-left: 2px;
}

/* Detail button */
.pl-btn-detail {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    padding: 8px;
    background: var(--u-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    margin-top: 8px;
    text-decoration: none;
    transition: background 0.15s;
    box-sizing: border-box;
}

@media (min-width: 640px) {
    .pl-btn-detail {
        padding: 10px;
        font-size: 14px;
        border-radius: 8px;
    }
}

.pl-btn-detail:hover {
    background: var(--u-primary-hover);
    color: #fff;
    text-decoration: none;
}

/* ── View Toggle Buttons ───────────────────────────────── */
.pl-view-toggle {
    display: inline-flex;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 4px;
}

.pl-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s;
}

.pl-view-btn:hover {
    color: #4b5563;
}

.pl-view-btn.active {
    background: #fff;
    color: var(--u-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ── Product list (no image) ───────────────────────────── */
.pl-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.pl-list-item {
    display: flex;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    position: relative;
    isolation: isolate;
    text-decoration: none !important;
    color: inherit;
    transition: box-shadow 0.15s;
    padding: 16px 40px 16px 16px;
}

.pl-list-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.pl-list-triangle {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-top: 56px solid #3e3a39;
    border-right: 56px solid transparent;
    z-index: 1;
}

.pl-list-triangle svg {
    position: absolute;
    top: -50px;
    left: 5px;
    width: 22px;
    height: 22px;
    color: #fff;
}

.pl-list-content {
    flex: 1;
    min-width: 0;
    margin-left: 36px;
}

.pl-list-maker {
    font-size: 11px;
    color: #b8b8b8;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pl-list-name {
    font-size: 15px;
    font-weight: 500;
    color: #494645;
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pl-list-price-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.pl-list-price {
    align-items: baseline;
}

.pl-list-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    position: relative;
    z-index: 3;
}

.pl-list-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 4px;
    overflow: hidden;
}

.pl-list-date {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #494645;
    flex-shrink: 0;
}

.pl-list-cat {
    gap: 5px;
}

.pl-list-cat-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

.pl-list-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Pagination ────────────────────────────────────────── */
.pl-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.pl-pager-btn,
.pl-pager-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 6px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.pl-pager-btn:hover,
.pl-pager-page:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    text-decoration: none;
    color: #111827;
}

.pl-pager-btn--disabled {
    color: #d1d5db;
    cursor: default;
    pointer-events: none;
}

.pl-pager-btn--disabled:hover {
    background: #fff;
    border-color: #e5e7eb;
}

.pl-pager-page--active {
    background: var(--u-primary);
    border-color: var(--u-primary);
    color: #fff;
    cursor: default;
    pointer-events: none;
}

.pl-pager-page--active:hover {
    background: var(--u-primary);
    border-color: var(--u-primary);
    color: #fff;
}

.pl-pager-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 36px;
    color: #9ca3af;
    font-size: 13px;
    letter-spacing: 0.05em;
}

/* ── Page heading ──────────────────────────────────────── */
.pl-page-h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--u-text, #111827);
    margin: 0 0 12px 0;
    line-height: 1.4;
}

/* ── Empty state ───────────────────────────────────────── */
.pl-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
    text-align: center;
    color: #9ca3af;
}
