/* ====================================================
   PRODUCTS PAGE — MODERN DESIGN
   ==================================================== */

/* ---- Page Shell ---- */

.products-page {
    background: #f8fafc;
    min-height: 100vh;
}

/* ---- Breadcrumb ---- */

.prd-breadcrumb {
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    padding: 14px 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.breadcrumb a:hover { color: #13618C; }

.breadcrumb-sep { flex-shrink: 0; }

.breadcrumb .current {
    color: #334155;
    font-weight: 600;
}

/* ---- Container ---- */

.products-page-container {
    padding: 28px 0 64px;
}

/* ---- Layout: sidebar + main ---- */

.products-content {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    align-items: flex-start;
}

/* ====================================================
   SIDEBAR
   ==================================================== */

.products-sidebar {
    position: sticky;
    top: 24px;
}

.prd-filter-toggle {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 12px;
}

.prd-filter-panel {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.prd-sidebar-section {
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
}

.prd-sidebar-title {
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px 16px 10px;
    margin: 0;
}

/* ---- Category Links ---- */

.category-links {
    display: flex;
    flex-direction: column;
    padding: 0 16px 16px;
}

.category-links a {
    font-size: 13px;
    color: #475569;
    text-decoration: none;
    padding: 7px 0;
    border-bottom: 1px solid #f8fafc;
    transition: color 0.15s;
}

.category-links a:last-child { border-bottom: none; }

.category-links a:hover { color: #13618C; font-weight: 600; }

/* ---- Filter Groups ---- */

.filter-group { border: none; }

.prd-filter-heading {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
}

.prd-chevron {
    flex-shrink: 0;
    transition: transform 0.2s;
    color: #94a3b8;
}

.filter-group.collapsed .prd-chevron {
    transform: rotate(-90deg);
}

.filter-group.collapsed .filter-options {
    display: none;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 16px 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: #475569;
    padding: 5px 0;
    user-select: none;
    transition: color 0.15s;
}

.checkbox-label:hover { color: #1e293b; }

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #13618C;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + span {
    color: #13618C;
    font-weight: 600;
}

/* ====================================================
   MAIN AREA
   ==================================================== */

.products-main { min-width: 0; }

/* ---- Header ---- */

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 14px 20px;
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.prd-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.products-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.prd-count-badge {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 3px 10px;
    border-radius: 20px;
}

.sort-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-select {
    padding: 8px 28px 8px 10px;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    color: #334155;
    background: #f8fafc;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.sort-select:focus { border-color: #13618C; background-color: #fff; }

/* ====================================================
   PRODUCTS GRID
   ==================================================== */

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

/* ---- Product Card ---- */

.product-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
    cursor: pointer;
}

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

/* ---- Product Image / Slider ---- */

.product-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    max-width: 82%;
    max-height: 82%;
    object-fit: contain;
}

.product-slider { position: relative; }

.slider-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10%;
    opacity: 0;
    transition: opacity 0.3s;
}

.slider-image.active {
    opacity: 1;
    z-index: 2;
}

.slider-dots {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 5px;
    z-index: 5;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    padding: 0;
}

.dot.active {
    background: #13618C;
    width: 14px;
    border-radius: 3px;
}

/* ---- Discount Badge ---- */

.discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #13618C, #297B35);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    z-index: 10;
    letter-spacing: 0.3px;
}

/* ---- Product Info ---- */

.product-info {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    border-top: 1px solid #f8fafc;
    position: relative;
}

.product-info h3 {
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 6px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-right: 36px;
}

/* ---- Rating ---- */

.product-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
}

.stars { display: flex; gap: 1px; }

.star { font-size: 11px; color: #f59e0b; }
.star.empty { color: #e2e8f0; }

.review-count { font-size: 10px; color: #94a3b8; }

/* ---- Price ---- */

.product-price {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.original-price {
    font-size: 10px;
    color: #94a3b8;
    text-decoration: line-through;
}

.sale-price {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.currency { font-size: 11px; font-weight: 600; }

/* ---- Add to Cart Button ---- */

.add-to-cart {
    position: absolute;
    bottom: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.add-to-cart img {
    width: 14px;
    height: 14px;
    object-fit: contain;
    transition: filter 0.2s;
}

.add-to-cart:hover {
    background: linear-gradient(135deg, #13618C, #297B35);
    border-color: transparent;
}

.add-to-cart:hover img { filter: brightness(0) invert(1); }

.add-to-cart.loading { opacity: 0.6; pointer-events: none; }

.add-to-cart.added {
    background: linear-gradient(135deg, #13618C, #297B35);
    border-color: transparent;
}

.add-to-cart.added img { filter: brightness(0) invert(1); }

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

.skeleton-card { pointer-events: none; cursor: default; }
.skeleton-card:hover { transform: none !important; box-shadow: none !important; }

.skeleton-box,
.skeleton-line {
    background: linear-gradient(90deg, #f1f5f9 25%, #e8edf2 50%, #f1f5f9 75%);
    background-size: 400% 100%;
    animation: prd-shimmer 1.3s ease-in-out infinite;
    border-radius: 6px;
}

.skeleton-box {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 0;
}

.skeleton-line { display: block; }
.skeleton-title  { height: 12px; width: 85%; margin-bottom: 8px; }
.skeleton-subtitle { height: 10px; width: 55%; margin-bottom: 16px; }
.skeleton-price  { height: 12px; width: 45%; }

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

/* ====================================================
   PAGINATION
   ==================================================== */

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    background: #f8fafc;
    transition: all 0.15s;
    white-space: nowrap;
    cursor: pointer;
}

.pagination-btn:hover {
    color: #13618C;
    border-color: #13618C;
    background: rgba(19,97,140,0.04);
}

.pagination-numbers {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.page-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    background: #f8fafc;
    transition: all 0.15s;
}

.page-number:hover {
    color: #13618C;
    border-color: #13618C;
    background: rgba(19,97,140,0.04);
}

.page-number.active {
    background: linear-gradient(135deg, #13618C, #297B35);
    color: #fff;
    border-color: transparent;
}

/* ====================================================
   RESPONSIVE
   ==================================================== */

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

@media (max-width: 960px) {
    .products-content {
        grid-template-columns: 200px 1fr;
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .products-page-container { padding: 16px 0 48px; }

    .products-content {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .products-sidebar { position: static; }

    .prd-filter-toggle { display: flex; }

    .prd-filter-panel { display: none; }
    .prd-filter-panel.open { display: flex; }

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

    .products-header {
        padding: 12px 14px;
        border-radius: 12px;
    }

    .products-header h2 { font-size: 14px; }

    .pagination {
        border-radius: 12px;
        padding: 12px 14px;
    }

    .pagination-btn span { display: none; }
    .pagination-btn { padding: 8px 10px; }
}

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

    .product-info { padding: 10px 12px 12px; }
    .product-info h3 { font-size: 11px; }
    .sale-price { font-size: 12px; }

    .add-to-cart { width: 26px; height: 26px; bottom: 10px; right: 10px; }
    .add-to-cart img { width: 12px; height: 12px; }
}

/* ====================================================
   SEARCH BAR
   ==================================================== */

.prd-search-section {
    padding: 12px 14px;
}

.prd-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    padding: 8px 12px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.prd-search-wrap:focus-within {
    border-color: #13618C;
    box-shadow: 0 0 0 3px rgba(19,97,140,0.08);
    background: #fff;
}

.prd-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13px;
    color: #334155;
    outline: none;
    min-width: 0;
}

.prd-search-input::placeholder { color: #94a3b8; }

.prd-search-input::-webkit-search-cancel-button { display: none; }

.prd-search-clear {
    display: none;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #e2e8f0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #64748b;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.15s;
}

.prd-search-clear:hover { background: #cbd5e1; color: #334155; }

/* ====================================================
   CATEGORY TREE
   ==================================================== */

.prd-cat-list {
    display: flex;
    flex-direction: column;
    padding: 0 0 12px;
}

/* ---- All Parts button ---- */

.prd-cat-all {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: color 0.15s, background 0.15s;
    border-radius: 0;
}

.prd-cat-all:hover { color: #13618C; background: #f8fafc; }

.prd-cat-all.selected {
    color: #13618C;
    background: rgba(19,97,140,0.06);
}

.prd-cat-all span { flex: 1; }

/* ---- Main Category ---- */

.prd-main-cat { display: flex; flex-direction: column; }

.prd-main-cat-btn {
    display: flex;
    align-items: center;
    gap: 0;
    width: 100%;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: color 0.15s, background 0.15s;
}

.prd-main-cat-btn span { flex: 1; }

.prd-main-cat-btn:hover { color: #13618C; background: #f8fafc; }

.prd-main-cat-btn.active { color: #13618C; }

.prd-cat-chev {
    flex-shrink: 0;
    color: #94a3b8;
    transition: transform 0.2s;
}

.prd-main-cat.open .prd-cat-chev { transform: rotate(-180deg); }

/* ---- Sub Categories ---- */

.prd-sub-list {
    display: none;
    flex-direction: column;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 2px;
}

.prd-main-cat.open .prd-sub-list { display: flex; }

.prd-sub-btn {
    width: 100%;
    padding: 8px 16px 8px 28px;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: color 0.15s, background 0.15s;
    position: relative;
}

.prd-sub-btn::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #cbd5e1;
    transition: background 0.15s;
}

.prd-sub-btn:hover {
    color: #13618C;
    background: rgba(19,97,140,0.04);
}

.prd-sub-btn:hover::before { background: #13618C; }

.prd-sub-btn.active {
    color: #13618C;
    font-weight: 600;
    background: rgba(19,97,140,0.06);
}

.prd-sub-btn.active::before {
    background: #13618C;
    width: 6px;
    height: 6px;
}
