/* ===== Products Page Specific Styles ===== */

/* ===== Product Section ===== */
.product-section {
    background: #f6f4f1;
    padding: 50px 0 80px;
    position: relative;
    z-index: 1;
}

/* ===== Category Navigation ===== */
.category-wrap {
    max-width: 1400px;
    margin: 0 auto 36px;
    padding: 0 40px;
    overflow: visible;
    position: relative;
    z-index: 10;
}
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    background: #fff;
    border-radius: 16px;
    padding: 22px 28px;
    box-shadow: 0 2px 20px rgba(90,70,50,0.07);
    border: 1px solid #ebe8e2;
    overflow: visible;
    position: relative;
    z-index: 10;
}
.cat-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid var(--gray-200);

    background: #fff;
    min-width: 80px;
}
.cat-tab:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}
.cat-tab.active {
    background: var(--primary);
    border-color: var(--primary);
}
.cat-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}
.cat-icon svg {
    width: 26px;
    height: 26px;
    stroke: var(--primary);
    stroke-width: 1.5;
    fill: none;
    transition: stroke 0.3s;
}
.cat-tab.active .cat-icon svg {
    stroke: #fff;
}
.cat-tab:hover .cat-icon svg {
    stroke: var(--primary-bright);
}
.cat-tab.active:hover .cat-icon svg {
    stroke: #fff;
}
.cat-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-700);
    text-align: center;
    line-height: 1.3;
    white-space: nowrap;
}
.cat-tab.active .cat-name { color: #fff; }
.cat-tab:hover .cat-name { color: var(--primary); }
.cat-tab.active:hover .cat-name { color: #fff; }

/* Category with Sub-menu */
.cat-tab.has-sub {
    position: relative;
}
.cat-submenu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 6px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(26,60,122,0.15);
    padding: 5px 12px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    z-index: 100;
    margin-top: 0;
    white-space: nowrap;
}
.cat-tab.has-sub:hover .cat-submenu,
.cat-submenu:hover {
    opacity: 1;
    visibility: visible;
    margin-top: 6px;
}
.cat-subitem {
    display: inline-block;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 500;
    color: var(--gray-700);
    white-space: nowrap;
    transition: all 0.2s;
    border-radius: 14px;
    cursor: pointer;
}
.cat-subitem:hover {
    color: var(--primary);
    background: var(--primary-light);
}

/* ===== Products Container ===== */
.products-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}
.products-container {
    background: #fff;
    border-radius: 16px;
    padding: 36px;
    box-shadow: 0 2px 24px rgba(90,70,50,0.07);
    border: 1px solid #ebe8e2;
}
.products-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 2px solid var(--gray-100);
}
.products-title {
    display: flex;
    align-items: center;
    gap: 12px;
}
.products-title .icon-bar {
    width: 4px;
    height: 26px;
    background: var(--primary);
    border-radius: 2px;
}
.products-title h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 2px;
}
.products-title .badge {
    background: var(--gold-light);
    color: var(--gold);
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 600;
}
.products-count {
    font-size: 14px;
    color: var(--gray-500);
}
.products-count span {
    color: var(--primary);
    font-weight: 700;
}

/* ===== Product Grid — 4 columns ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* ===== Product Card ===== */
.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.07);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 48px rgba(0,0,0,0.12);
    border-color: rgba(200,164,92,0.40);
}

/* Product Image Area */
.product-img-wrap {
    position: relative;
    height: 220px;
    background: transparent;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-img-wrap img {
    height: 170px;
    width: auto;
    max-width: 88%;
    object-fit: contain;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}
.product-card:hover .product-img-wrap img {
    transform: scale(1.08);
}

/* Product Info */
.product-info {
    padding: 14px 16px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.product-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.4;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-name a {
    color: inherit;
    transition: color 0.3s;
}
.product-name a:hover {
    color: var(--primary);
}

/* View Details Button */
.product-btn-wrap {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--gray-100);
}
.product-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    padding: 7px 16px;
    border-radius: 16px;
    transition: all 0.3s;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.product-btn:hover {
    background: var(--primary-dark);
    transform: translateX(3px);
}
.product-btn svg {
    width: 12px;
    height: 12px;
    stroke: #fff;
    stroke-width: 2;
    fill: none;
}

/* ===== No Result ===== */
.no-result {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
    font-size: 15px;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-100);
}
.pagination.hidden { display: none; }
.page-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid var(--gray-300);
    background: #fff;
    color: var(--gray-700);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
    font-family: inherit;
}
.page-btn:hover:not(:disabled) {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}
.page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.page-numbers {
    display: flex;
    gap: 6px;
    align-items: center;
}
.page-num {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid var(--gray-300);
    background: #fff;
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
    font-family: inherit;
}
.page-num:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}
.page-num.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.page-ellipsis {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    font-size: 14px;
    letter-spacing: 2px;
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
    .product-img-wrap { height: 200px; }
    .product-img-wrap img { height: 155px; }
}
@media (max-width: 900px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .product-img-wrap { height: 190px; }
    .product-img-wrap img { height: 145px; }
    .products-wrap { padding: 0 20px; }
    .products-container { padding: 24px; }
    .category-wrap { padding: 0 20px; }
}
@media (max-width: 768px) {
    .product-section { padding: 30px 0 60px; }
    .category-wrap { padding: 0 16px; margin-bottom: 24px; }
    .category-tabs { padding: 16px; gap: 6px; }
    .cat-tab { min-width: 64px; padding: 10px 8px; gap: 5px; border-radius: 10px; }
    .cat-name { font-size: 10px; }
    .cat-icon { width: 34px; height: 34px; }
    .cat-icon svg { width: 20px; height: 20px; }
    .cat-tab.has-sub { position: relative; }
    .cat-submenu {
        position: absolute; top: 100%; left: 50%;
        transform: translateX(-50%);
        display: flex; flex-wrap: nowrap;
        justify-content: center; gap: 4px;
        padding: 4px 8px; z-index: 100;
        box-shadow: 0 4px 16px rgba(26,60,122,0.15);
    }
    .cat-subitem { font-size: 10px; padding: 3px 8px; }
    .cat-tab.has-sub:hover .cat-submenu,
    .cat-submenu:hover { margin-top: 4px; }
    .products-wrap { padding: 0 16px; }
    .products-container { padding: 16px; border-radius: 12px; }
    .products-header { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 20px; padding-bottom: 12px; }
    .products-title h3 { font-size: 17px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .product-img-wrap { height: 170px; }
    .product-img-wrap img { height: 130px; }
    .product-name { font-size: 13px; }
    .product-info { padding: 10px 12px 8px; }
    .product-btn { font-size: 11px; padding: 5px 12px; }
}
@media (max-width: 480px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .product-img-wrap { height: 160px; }
    .product-img-wrap img { height: 120px; }
    .product-name { font-size: 12px; }
    .category-tabs { padding: 10px; gap: 4px; }
    .cat-tab { min-width: 52px; padding: 8px 5px; }
    .cat-name { font-size: 9px; }
    .cat-icon { width: 28px; height: 28px; }
    .cat-icon svg { width: 16px; height: 16px; }
    .page-btn, .page-num { width: 34px; height: 34px; font-size: 12px; }
    .page-ellipsis { width: 34px; height: 34px; font-size: 12px; }
}
