/* ==============================================
   Archive Product Page — archive-product.css
   ============================================== */

.archive-product-page {
    background: #f0f0f0;
    padding: 40px 0 60px;
    min-height: 70vh;
}

.ap-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Two-column layout: sidebar + main */
.ap-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
    align-items: start;
}

/* ================================================
   SIDEBAR
   ================================================ */
.ap-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border-radius: 2px;
}

.ap-widget {
    padding: 24px 20px;
    border-bottom: 1px solid #f0f0f0;
}
.ap-widget:last-child { border-bottom: none; }

.ap-widget-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #1a1a1a;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8b800;
    display: inline-block;
}

/* Search */
.ap-search-form { margin: 0; }

.ap-search-wrap {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 2px;
    overflow: hidden;
}

.ap-search-input {
    flex: 1;
    border: none;
    padding: 9px 12px;
    font-size: 13px;
    color: #333;
    outline: none;
    background: #fff;
}
.ap-search-input::placeholder { color: #aaa; }

.ap-search-btn {
    background: #fff;
    border: none;
    border-left: 1px solid #ddd;
    padding: 0 12px;
    cursor: pointer;
    color: #888;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}
.ap-search-btn:hover { color: #1a6fad; }

/* Category list */
.ap-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ap-cat-item {
    border-bottom: 1px solid #f5f5f5;
}
.ap-cat-item:last-child { border-bottom: none; }
.ap-cat-item a {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 9px 4px;
    font-size: 14px;
    color: #444;
    text-decoration: none;
    transition: color 0.2s, padding-left 0.2s;
}
.ap-cat-item a:hover {
    color: #1a6fad;
    padding-left: 8px;
}
.ap-cat-item.active a {
    color: #1a1a1a;
    font-weight: 700;
}
.ap-cat-item.active > a::before {
    content: '— ';
    color: #1a1a1a;
}

.ap-cat-count {
    font-size: 12px;
    color: #aaa;
}

/* ================================================
   MAIN CONTENT
   ================================================ */
.ap-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ap-archive-title {
    font-size: 36px;
    font-weight: 900;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: -0.5px;
}

/* Toolbar */
.ap-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.ap-results-count {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #777;
    margin: 0;
}

.ap-sort-select {
    border: 1px solid #ccc;
    padding: 7px 32px 7px 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.8px;
    color: #444;
    background: #fff;
    border-radius: 2px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
    outline: none;
    text-transform: uppercase;
}

/* ================================================
   Product Grid — 4 columns
   ================================================ */
.ap-product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.ap-product-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 2px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
    overflow: hidden;
}
.ap-product-card:hover {
    box-shadow: 8px 15px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.ap-card-image {
    aspect-ratio: 1 / 1;
    background: #f5f5f5;
    overflow: hidden;
}
.ap-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.ap-no-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 12px;
}

.ap-card-body {
    padding: 25px 30px 40px;
    border-top: 1px solid #f0f0f0;
}

.ap-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.4;
}

/* ================================================
   Pagination
   ================================================ */
.ap-pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 10px 0;
}

.ap-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid #ddd;
    background: #fff;
    color: #444;
    font-size: 13px;
    text-decoration: none;
    border-radius: 2px;
    transition: all 0.2s;
}
.ap-pagination .page-numbers:hover {
    background: #1a6fad;
    color: #fff;
    border-color: #1a6fad;
}
.ap-pagination .page-numbers.current {
    background: #1a6fad;
    color: #fff;
    border-color: #1a6fad;
    font-weight: 700;
}
.ap-pagination .page-numbers.dots {
    border: none;
    background: transparent;
    cursor: default;
}

/* ================================================
   No Results
   ================================================ */
.ap-no-results {
    background: #fff;
    padding: 48px 24px;
    text-align: center;
    border-radius: 4px;
    color: #666;
}
.ap-no-results p { font-size: 15px; margin-bottom: 16px; }

.ap-reset-btn {
    display: inline-block;
    padding: 10px 24px;
    background: #1a6fad;
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}
.ap-reset-btn:hover { background: #145d93; }

/* ================================================
   Responsive
   ================================================ */
@media (max-width: 1024px) {
    .ap-product-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 800px) {
    .ap-layout {
        grid-template-columns: 1fr;
    }
    .ap-product-grid { grid-template-columns: repeat(2, 1fr); }
    .ap-archive-title { font-size: 26px; }
}

@media (max-width: 480px) {
    .ap-product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .ap-toolbar { flex-direction: column; align-items: flex-start; }
}