﻿.container {
    --demo-blue-50: #f4f8ff;
    --demo-blue-100: #e8f1ff;
    --demo-blue-200: #d2e4ff;
    --demo-blue-300: #b7d3ff;
    --demo-blue-400: #88b6fb;
    --demo-blue-500: #67a1f7;
    --demo-blue-600: #468cf5;
    --demo-blue-700: #3676d8;
    --demo-blue-shadow: rgba(70, 140, 245, 0.22);
    max-width: 1280px;
    margin: auto;
}

.main-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    grid-column-gap: 20px;
    padding: 0 20px;
}

/* Sidebar */
.sidebar-column {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.sidebar {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #111827;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 12px;
}

.sidebar-dataset {
    list-style: none;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: #4b5563;
}

.sidebar-dataset:hover {
    background: #f9fafb;
    color: #111827;
}

.sidebar-dataset.active {
    background: linear-gradient(135deg, var(--demo-blue-500), var(--demo-blue-600));
    color: white;
    font-weight: 500;
}

.total-products {
    margin-top: 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    padding-bottom: 12px;
}

.content-area {
    grid-column: 2;
    flex: 1;
    min-width: 0;
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 40px 0;
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.header-center {
    max-width: 600px;
}

.brand-name {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    color: #4b5563;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.main-title {
    font-size: 36px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 12px;
    line-height: 1.2;
}

.subtitle {
    font-size: 16px;
    color: #4b5563;
    line-height: 1.5;
    margin-bottom: 40px;
}

/* Main content */
.main-content {
    padding: 32px 0;
}

/* Navigation Arrows */
.navigation-arrows {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 60px;
}

.navigation-arrows.hidden {
    display: none !important;
}

.nav-arrow {
    width: 40px;
    height: 40px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #4b5563;
}

.nav-arrow:hover:not(:disabled) {
    background: #111827;
    color: white;
    border-color: #111827;
}

.nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pagination-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e5e7eb;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-dot.active {
    background: #111827;
    transform: scale(1.2);
}

/* Product Popup */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.popup-overlay.active {
    display: flex;
}

.popup-content {
    background: white;
    border-radius: 8px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.popup-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
}

.popup-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
    transition: all 0.3s ease;
}

.popup-close:hover {
    background: #f9fafb;
    color: #111827;
}

.popup-body {
    padding: 20px;
    display: flex;
    gap: 30px;
}

.popup-image {
    flex: 1;
    max-width: 350px;
}

.popup-image img {
    width: 100%;
    height: auto;
    max-height: 400px;
    padding: 40px;
    border-radius: 6px;
    object-fit: contain;
}

.popup-details {
    flex: 1;
}

.popup-product-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--demo-blue-700);
    margin-bottom: 10px;
    line-height: 1.4;
}

.popup-product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--demo-blue-600);
    margin-bottom: 16px;
}

.popup-product-description {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 14px;
    white-space: pre-line;
}

.popup-product-note {
    font-size: 12px;
    color: #4b5563;
    margin-bottom: 10px;
    line-height: 1.2;
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid #4b5563;
    border-radius: 9999px;
    background: #ffffff;
}

@media (max-width: 768px) {
    .popup-body {
        flex-direction: column;
        gap: 20px;
    }

    .popup-image {
        max-width: 100%;
    }
}


/* Viewpoint Buttons */
.viewpoint-section {
    background: transparent;
    border: none;
    border-radius: 0;
    margin-bottom: 24px;
    overflow: visible;
}

.viewpoint-buttons-container {
    padding: 0;
}

.viewpoint-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
    align-items: flex-start;
}

.viewpoint-button {
    padding: 5px 10px;
    border: 2px solid #e5e7eb;
    background: white;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #4b5563;
    border-radius: 24px;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-align: center;
    position: relative;
    min-width: 120px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.viewpoint-button:hover {
    background: #f9fafb;
    color: #111827;
    border-color: #9ca3af;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.viewpoint-button.active {
    color: white;
    border-color: var(--demo-blue-500);
    background: linear-gradient(135deg, var(--demo-blue-500), var(--demo-blue-600));
    font-weight: 600;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px var(--demo-blue-shadow);
}

.viewpoint-button.active:hover {
    background: linear-gradient(135deg, var(--demo-blue-600), var(--demo-blue-700));
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(92, 143, 232, 0.28);
}

@media (max-width: 768px) {
    .viewpoint-buttons {
        gap: 8px;
    }

    .viewpoint-button {
        padding: 10px 16px;
        font-size: 13px;
        min-width: 100px;
    }

    .viewpoint-buttons-container {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .viewpoint-buttons {
        justify-content: center;
        gap: 6px;
    }

    .viewpoint-button {
        padding: 8px 14px;
        font-size: 12px;
        min-width: 80px;
    }
}


/* FAQ Widget */
.faq-widget-container {
    margin-bottom: 24px;
}

/* Products grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    animation: fadeInUp 0.6s ease-out;
    align-items: stretch;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInCard {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Note: base is 2 columns; larger breakpoints override below */

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

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


/* Product card */
.product-card {
    animation: slideInCard 0.4s ease-out;
    animation-fill-mode: both;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card .ribbon {
    position: absolute;
    top: 12px;
    left: -30px;
    width: 120px;
    padding: 4px 0;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: white;
    transform: rotate(-45deg);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.ribbon-1 {
    background: #cf0000;
}

.ribbon-2 {
    background: #ff6600ec;
}

.ribbon-3 {
    background: #ffa600;
}


.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15),
        0 10px 10px -5px rgba(0, 0, 0, 0.1);
    border-color: var(--demo-blue-400);
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--demo-blue-400), var(--demo-blue-600));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover::before {
    opacity: 1;
}

.product-image-container {
    aspect-ratio: 1;
    background: white;
    position: relative;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 15px;
    transition: transform 0.3s ease;
}

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

.product-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-info {
    flex-grow: 1;
    text-align: center;
}

.product-mall-product-id {
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 6px;
    background: #f1f5f9;
    padding: 1px 4px;
    border-radius: 2px;
    display: inline-block;
    font-family: monospace;
}

.product-name {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 12px;
    min-height: 36px;
    color: #374151;
    transition: all 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.2px;
}

.product-card:hover .product-name {
    color: #1f2937;
    font-weight: 600;
}

.product-footer {
    padding-top: 8px;
    flex-shrink: 0;
    text-align: center;
}

.product-price {
    color: var(--demo-blue-600);
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 0;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

.product-card:hover .product-price {
    color: var(--demo-blue-700);
    font-weight: 700;
}

.product-price-suffix {
    font-size: 14px;
    color: #6b7280;
}

.product-card[draggable="true"] {
    cursor: move;
}

.product-card[draggable="true"]:active {
    opacity: 0.7;
}

.error-message {
    text-align: center;
    display: inline-block;
    padding: 20px;
    font-size: 16px;
    color: #6b7280;
    white-space: nowrap;
}

/* Layout: mobile-first adjustments */
@media (max-width: 1023px) {
    .main-layout {
        grid-template-columns: 1fr;
        grid-column-gap: 0;
    }

    .sidebar-column {
        position: static;
        top: auto;
        height: auto;
        margin-bottom: 16px;
    }

    /* Ensure content area stays in the single column */
    .content-area {
        grid-column: 1;
    }
}

/* Mobile Filters - Hidden on desktop */
.mobile-filters {
    display: none;
}

.mobile-filter-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.mobile-filter {
    flex: 1;
}

.mobile-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    color: #374151;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.mobile-select:focus {
    outline: none;
    border-color: var(--demo-blue-500);
    box-shadow: 0 0 0 3px rgba(156, 192, 255, 0.2);
}

.mobile-select:disabled {
    background-color: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

.mobile-total-products {
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
    text-align: center;
    padding: 8px;
    background: #f8fafc;
    border-radius: 6px;
}

@media (max-width: 768px) {
    .header {
        padding: 24px 0;
    }

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

    .subtitle {
        font-size: 14px;
        margin-bottom: 24px;
    }

    /* Hide desktop sidebar on mobile */
    .sidebar-column {
        display: none;
    }

    /* Show mobile filters */
    .mobile-filters {
        display: block;
        margin-bottom: 24px;
        padding: 0 4px;
    }

    /* Hide desktop viewpoint buttons on mobile */
    .viewpoint-section {
        display: none !important;
    }

    /* Card tweaks cho mobile */
    .product-content {
        padding: 10px;
    }

    .product-name {
        font-size: 12px;
        min-height: auto;
    }

    .product-price {
        font-size: 16px;
    }

    /* Popup image smaller */
    .popup-image img {
        padding: 16px;
        max-height: 280px;
    }

    /* Navigation arrows smaller */
    .navigation-arrows {
        gap: 12px;
        margin-top: 32px;
    }

    /* Products grid tweaks on mobile */
    .products-grid {
        gap: 16px;
    }

    /* Adjust ribbon for mobile tablet */
    .product-card .ribbon {
        font-size: 11px;
        padding: 3px 0;
        width: 110px;
        left: -28px;
        top: 10px;
    }
}

@media (max-width: 480px) {

    /* Adjust ribbon for mobile */
    .product-card .ribbon {
        font-size: 10px;
        padding: 2px 0;
        width: 100px;
        left: -25px;
        top: 8px;
    }

    /* Reduce card size to avoid ribbon overlap */
    .product-image {
        padding: 10px;
    }
}

/* Tablet layout refinements: 769px-1023px */
@media (min-width: 769px) and (max-width: 1023px) {

    /* Use a compact two-column layout with a slimmer sidebar */
    .main-layout {
        grid-template-columns: 220px 1fr;
        grid-column-gap: 16px;
        padding: 0 16px;
    }

    /* Ensure the content area sits in the second column on tablets */
    .content-area {
        grid-column: 2;
    }

    /* Keep sidebar sticky for easier navigation on tablets */
    .sidebar-column {
        position: sticky;
        top: 16px;
        height: fit-content;
        margin-bottom: 0;
    }

    /* Slightly denser product grid for better use of space */
    .products-grid {
        gap: 20px;
    }

    /* Tighter spacing and sizing for viewpoint controls */
    .viewpoint-buttons {
        gap: 10px;
    }

    .viewpoint-button {
        min-width: 110px;
        padding: 8px 12px;
        font-size: 12px;
    }

    /* Reduce top spacing around pagination on tablets */
    .navigation-arrows {
        margin-top: 40px;
    }

    /* Subtle ribbon size tweak to avoid overlap on smaller tablets */
    .product-card .ribbon {
        font-size: 11px;
        padding: 3px 0;
        width: 110px;
        left: -28px;
        top: 10px;
    }

    /* Slightly tighter header */
    .header {
        padding: 32px 0;
    }

    .main-title {
        font-size: 32px;
    }
}

/* Promote 3 columns for wider tablets without affecting desktops */
@media (min-width: 900px) and (max-width: 1023px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

a.product-card {
    text-decoration: none;
    color: inherit;
}

/* --- Product Detail Page Styles --- */
.page-title {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    margin: 12px 0 0;
}

.page-title h2 {
    font-size: 28px;
    margin: 8px 0 6px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #dbe1ec;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
    color: var(--demo-blue-600);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(14, 21, 32, 0.06);
    transition: box-shadow .15s ease, border-color .15s ease, transform .03s ease, background .15s ease;
}

.back-link .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--demo-blue-100);
    color: inherit;
    transition: transform .15s ease, background .15s ease;
}

.back-link:hover {
    border-color: var(--demo-blue-300);
    box-shadow: 0 3px 10px rgba(14, 21, 32, 0.08);
    background: linear-gradient(180deg, #ffffff 0%, #f2f7ff 100%);
}

.back-link:hover .icon {
    transform: translateX(-2px);
    background: var(--demo-blue-200);
}

.back-link:active {
    transform: translateY(1px);
}

.back-link:focus-visible {
    outline: 3px solid rgba(92, 143, 232, .22);
    outline-offset: 2px;
    border-color: var(--demo-blue-600);
}

.product-detail-card {
    grid-template-rows: auto 1fr;
    max-width: 1080px;
    margin: 20px auto 48px;
    padding: 24px;
    background: #fff;
    border: 1px solid #e9edf3;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(14, 21, 31, 0.06);
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 32px;
}

.card-toolbar {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.product-detail-media {
    position: sticky;
    top: 88px;
    align-self: start;
}

.image-zoom {
    aspect-ratio: 1 / 1;
    background: linear-gradient(180deg, #fbfcfe 0%, #f5f7fb 100%);
    border: 1px solid #eef2f7;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.image-zoom img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .25s ease;
}

.image-zoom:hover img {
    transform: scale(1.03);
}

.product-detail-info {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.product-title {
    font-size: 24px;
    line-height: 1.4;
    margin: 0;
}

.price-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.price {
    color: #e5483e;
    font-weight: 700;
    font-size: 26px;
}

.badge {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--demo-blue-100);
    color: var(--demo-blue-600);
    border: 1px solid var(--demo-blue-200);
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: #5b677a;
    font-size: 13px;
}

.ec-btn {
    appearance: none;
    border: 1px solid #d7deea;
    background: #fff;
    color: #0e1520;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: box-shadow .15s ease, transform .02s ease;
}

.ec-btn:hover {
    box-shadow: 0 2px 8px rgba(14, 21, 32, .08);
}

.ec-btn:active {
    transform: translateY(1px);
}

.ec-btn.primary {
    background: var(--demo-blue-600);
    color: #fff;
    border-color: var(--demo-blue-600);
}

.ec-btn.outline {
    background: #fff;
    color: var(--demo-blue-600);
    border-color: var(--demo-blue-300);
}

.section {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px dashed #e9edf3;
}

.section h3 {
    font-size: 18px;
    margin: 10px 0 6px;
}

.section .description {
    font-size: 15px;
    line-height: 1.8;
    color: #2d3643;
}

.detail-toolbar {
    max-width: 1080px;
    margin: 8px auto 10px;
    padding-left: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

/* Responsive */
@media (max-width: 960px) {
    .detail-toolbar {
        max-width: 100%;
        padding: 0 14px;
    }

    .product-detail-card {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 18px;
    }

    .product-detail-media {
        position: static;
    }

    .product-title {
        font-size: 20px;
    }

    .price {
        font-size: 22px;
    }
}

/* =========================
   Product Search Page
   ========================= */
.ps-tabs-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.ps-tabs {
    display: flex;
    background: #f3f4f6;
    border-radius: 12px;
    padding: 6px;
    flex: 1;
    gap: 8px;
    min-width: 0;
}

.ps-tab {
    flex: 1;
    appearance: none;
    border: none;
    background: transparent;
    color: #6b7280;
    font-weight: 700;
    font-size: 15px;
    padding: 14px 20px;
    cursor: pointer;
    transition: all .2s ease;
    border-radius: 8px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    min-width: 0;
}

.ps-tab-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ps-tab-label-short {
    display: none;
}

.ps-tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.ps-tab:hover {
    color: #374151;
    background: rgba(255, 255, 255, 0.6);
}

.ps-tab.active {
    background: #ffffff;
    color: #4f46e5;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    font-weight: 800;
}

.ps-tab.active .ps-tab-icon {
    opacity: 1;
    color: #4f46e5;
}

.ps-hint-container {
    position: relative;
}

.ps-hint-btn {
    appearance: none;
    border: 2px solid #fbbf24;
    background: #fffbeb;
    color: #d97706;
    font-weight: 800;
    font-size: 14px;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all .2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    white-space: nowrap;
}

.ps-hint-btn svg {
    color: #f59e0b;
}

.ps-hint-btn:hover {
    background: #fef3c7;
    border-color: #f59e0b;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

/* Tooltip (Hover) */
.ps-hint-tooltip {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    padding: 20px;
    z-index: 50;
    margin-top: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ps-hint-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    border-left: 1px solid #e5e7eb;
    transform: rotate(45deg);
}

.ps-hint-container:hover .ps-hint-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ps-hint-item {
    margin-bottom: 16px;
}

.ps-hint-item:last-child {
    margin-bottom: 0;
}

.ps-hint-item-title {
    font-weight: 800;
    font-size: 13px;
    color: #111827;
    margin-bottom: 4px;
}

.ps-hint-item-text {
    font-size: 12px;
    line-height: 1.5;
    color: #6b7280;
}


.ps-panel {
    display: none;
}

.ps-panel.active {
    display: block;
    min-width: 0;
}

.ps-searchbar {
    display: flex;
    gap: 10px;
    align-items: stretch;
    margin-bottom: 16px;
}

/* Store + Filter blocks (split layout) */
.ps-page .sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: transparent;
    border: none;
    padding: 0;
}

.ps-sidebar-block.ps-store-block {
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

.ps-sidebar-block {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 6px 18px rgba(17, 24, 39, 0.05);
}

.ps-sidebar-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
}

.ps-sidebar-block-title {
    font-size: 14px;
    font-weight: 800;
    color: #111827;
    letter-spacing: 0.2px;
}

.ps-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Store selector */
.ps-store-selector {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ps-store-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.ps-store-select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 44px 12px 14px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    height: 48px;
    color: #111827;
    background-color: #ffffff;
    background-image:
        linear-gradient(180deg, rgba(249, 250, 251, 0.85) 0%, rgba(255, 255, 255, 0.0) 60%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat, no-repeat;
    background-position: 0 0, right 14px center;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.06);
    cursor: pointer;
    transition: transform .05s ease, border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.ps-store-select:hover {
    border-color: #d1d5db;
    box-shadow: 0 6px 18px rgba(17, 24, 39, 0.08);
}

.ps-store-select:active {
    transform: translateY(1px);
}

.ps-store-select:focus {
    outline: none;
    border-color: var(--demo-blue-500);
    box-shadow: 0 0 0 3px rgba(156, 192, 255, 0.2), 0 6px 18px rgba(17, 24, 39, 0.08);
}

.ps-store-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Filter block tweaks (reduce stacked borders) */
.ps-filter-block .ps-sidebar-header-row {
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 10px;
    margin-bottom: 12px;
}


.ps-filter-block .ps-sidebar-section {
    margin-bottom: 0;
}

.ps-page .ps-sidebar-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.ps-page .ps-sidebar-header-row .sidebar-title {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.ps-page .ps-filter-close-btn {
    appearance: none;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #6b7280;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .05s ease;
}

.ps-page .ps-filter-close-btn:hover {
    background: #f3f4f6;
    color: #374151;
    border-color: #d1d5db;
}

.ps-page .ps-filter-close-btn:active {
    transform: translateY(1px);
}

.ps-page .ps-sidebar-backdrop {
    display: none;
}

.ps-search-input {
    flex: 1;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    height: 48px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.2;
    outline: none;
    background: #ffffff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.ps-search-input:focus {
    border-color: var(--demo-blue-500);
    box-shadow: 0 0 0 3px rgba(156, 192, 255, 0.18);
}

.ps-search-btn,
.ps-clear-btn,
.ps-filter-toggle-btn,
.ps-loadmore-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    appearance: none;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #111827;
    height: 48px;
    padding: 0 14px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: transform .05s ease, box-shadow .15s ease, border-color .15s ease;
    white-space: nowrap;
}

.ps-search-btn {
    background: linear-gradient(135deg, var(--demo-blue-500), var(--demo-blue-600));
    border-color: transparent;
    color: #ffffff;
}

.ps-filter-toggle-btn {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ps-filter-toggle-btn svg {
    opacity: 0.85;
}

.ps-search-btn:hover,
.ps-clear-btn:hover,
.ps-filter-toggle-btn:hover,
.ps-loadmore-btn:hover {
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.ps-search-btn:active,
.ps-clear-btn:active,
.ps-filter-toggle-btn:active,
.ps-loadmore-btn:active {
    transform: translateY(1px);
}


.ps-products-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin: 12px 0 10px;
}

.ps-products-title {
    font-size: 16px;
    font-weight: 800;
    color: #111827;
}

.ps-products-count {
    font-size: 12px;
    color: #6b7280;
}

.ps-loadmore {
    display: flex;
    justify-content: center;
    margin: 20px 0 40px;
}

.ps-pagination-wrap {
    display: flex;
    justify-content: center;
    margin: 18px 0 40px;
}

.ps-pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 12px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.ps-page-btn {
    appearance: none;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #374151;
    font-weight: 800;
    font-size: 13px;
    padding: 8px 10px;
    border-radius: 999px;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .05s ease;
    min-width: 34px;
}

.ps-page-btn:hover:not(:disabled) {
    border-color: #c7d2fe;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
}

.ps-page-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.ps-page-btn.active {
    background: linear-gradient(135deg, var(--demo-blue-500), var(--demo-blue-600));
    border-color: transparent;
    color: #ffffff;
}

.ps-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ps-page-ellipsis {
    color: #9ca3af;
    font-weight: 900;
    padding: 0 2px;
}

.ps-dev-box {
    border: 1px dashed #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    background: #fafafa;
}

.ps-dev-title {
    font-weight: 800;
    font-size: 13px;
    color: #111827;
    margin-bottom: 10px;
}

.ps-dev-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    font-weight: 800;
    font-size: 12px;
    margin-bottom: 6px;
}

.ps-dev-note {
    font-size: 12px;
    color: #6b7280;
}

.ps-sidebar-section {
    margin-bottom: 24px;
}

.ps-filter-section {
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #f3f4f6;
}

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


.ps-filter-title {
    font-weight: 800;
    font-size: 13px;
    color: #111827;
    margin-bottom: 12px;
}

.ps-price-ranges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.ps-price-chip {
    appearance: none;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #374151;
    font-weight: 600;
    font-size: 12px;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: all .2s ease;
    white-space: nowrap;
}

.ps-price-chip:hover {
    border-color: var(--demo-blue-500);
    background: var(--demo-blue-100);
    color: var(--demo-blue-600);
}

.ps-price-chip.active {
    background: linear-gradient(135deg, var(--demo-blue-500), var(--demo-blue-600));
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 4px 10px var(--demo-blue-shadow);
}

.ps-filter-custom-price {
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px dashed #e5e7eb;
}

.ps-filter-price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ps-filter-input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    background: #ffffff;
    transition: border-color .2s ease;
}

.ps-filter-input:focus {
    outline: none;
    border-color: var(--demo-blue-500);
}

.ps-filter-input::placeholder {
    color: #9ca3af;
    font-weight: 500;
}

.ps-filter-separator {
    color: #6b7280;
    font-weight: 800;
    font-size: 14px;
}

.ps-filter-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    background: #ffffff;
    cursor: pointer;
    transition: border-color .2s ease;
}

.ps-filter-select:focus {
    outline: none;
    border-color: var(--demo-blue-500);
}

.ps-filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 18px;
}

.ps-filter-btn {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: all .2s ease;
}

.ps-filter-btn-primary {
    background: linear-gradient(135deg, var(--demo-blue-500), var(--demo-blue-600));
    color: #ffffff;
}

.ps-filter-btn-primary:hover {
    box-shadow: 0 6px 14px rgba(92, 143, 232, 0.28);
    transform: translateY(-1px);
}

.ps-filter-btn-primary:active {
    transform: translateY(0);
}

.ps-filter-btn-secondary {
    background: #f3f4f6;
    color: #6b7280;
}

.ps-filter-btn-secondary:hover {
    background: #e5e7eb;
}


@media (max-width: 768px) {
    .ps-searchbar {
        flex-wrap: wrap;
    }

    .ps-search-input {
        flex-basis: 100%;
    }

    .ps-page .ps-filter-toggle-btn {
        display: inline-flex;
        flex: 1;
    }

    .ps-search-btn,
    .ps-clear-btn {
        flex: 1;
    }

    .ps-tabs-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .ps-hint-container {
        display: none !important;
    }

    .ps-tab {
        font-size: 14px;
        padding: 12px 14px;
    }

    .ps-tab-label-long {
        display: none;
    }

    .ps-tab-label-short {
        display: inline;
    }

    .ps-page .ps-filter-close-btn {
        display: inline-flex;
    }

    .ps-page .ps-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(17, 24, 39, 0.55);
        opacity: 0;
        pointer-events: none;
        transition: opacity .18s ease;
        z-index: 900;
    }

    .ps-page.ps-filters-open .ps-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .ps-page.ps-no-scroll {
        overflow: hidden;
    }

    .ps-page .sidebar-column {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(380px, 92vw);
        z-index: 1000;
        transform: translateX(-105%);
        transition: transform .22s cubic-bezier(0.16, 1, 0.3, 1);
        padding: 10px 8px;
        margin: 0;
        height: auto;
        overscroll-behavior: contain;
    }

    .ps-page .sidebar {
        height: 100%;
        border-radius: 0 16px 16px 0;
        padding: 16px;
        overflow-y: auto;
    }

    .ps-page.ps-filters-open .sidebar-column {
        transform: translateX(0);
    }
}

@media (max-width: 480px) {
    .ps-page .main-layout {
        padding: 0 12px;
    }

    .ps-page .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .ps-page .product-image {
        padding: 8px;
    }

    .ps-page .product-content {
        padding: 8px;
    }

    .ps-page .product-mall-product-id {
        font-size: 10px;
        margin-bottom: 4px;
    }

    .ps-page .product-name {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .ps-page .product-price {
        font-size: 15px;
    }
}
