/* ============================================
   Shop Wrapper
============================================ */
.shop-wrapper {
    padding-top: 1rem;
    padding-bottom: 3rem;
}

/* ============================================
   Sticky Filter Bar
============================================ */
.sticky-product-filter {
    position: sticky;
    top: 60px;
    z-index: 100;
    background-color: #fff;
    margin-bottom: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}

/* ============================================
   Topbar
============================================ */
.starcross-shop-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.starcross-product-filter-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    border: 1px solid #212529;
    padding: 0.35rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    margin-right: 0.5rem;
    font-family: 'Poppins', sans-serif;
}

.starcross-product-filter-btn:hover {
    background-color: #212529;
    color: #fff;
}

.woocommerce-result-count {
    font-size: 0.875rem;
    color: #6c757d;
    margin: 0;
    flex: 1;
}

/* ============================================
   Search Bar
============================================ */
.shop-search-bar {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
    min-width: 220px;
    transition: border-color 0.2s;
}

.shop-search-bar:focus-within { border-color: #212529; }

.shop-search-icon {
    padding: 0 0.6rem;
    color: #6c757d;
    font-size: 0.9rem;
    pointer-events: none;
}

.shop-search-input {
    border: none;
    outline: none;
    padding: 0.35rem 0.5rem 0.35rem 0;
    font-size: 0.875rem;
    width: 100%;
    background: transparent;
    font-family: 'Poppins', sans-serif;
}

.shop-search-input::placeholder { color: #adb5bd; }

.shop-search-clear {
    background: transparent;
    border: none;
    padding: 0 0.5rem;
    cursor: pointer;
    color: #6c757d;
    font-size: 1rem;
    line-height: 1;
}

.shop-search-clear:hover { color: #212529; }

/* ============================================
   Filter Dropdowns
============================================ */
.filter-bar-col { margin-top: 0.75rem; }

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.product-filter-dropdown .btn {
    border: 1px solid #dee2e6;
    font-size: 0.8rem;
    padding: 0.3rem 0.75rem;
    background-color: #fff;
    color: #212529;
    font-family: 'Poppins', sans-serif;
}

.product-filter-dropdown .btn:hover,
.product-filter-dropdown .btn:focus,
.product-filter-dropdown .btn.filter-active {
    background-color: #212529;
    color: #fff;
    border-color: #212529;
}

.product-filter-dropdown .dropdown-menu {
    min-width: 200px;
    padding: 0.5rem 0;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.filter-clear-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 0.75rem;
}

.filter-values  { margin: 0; font-size: 0.8rem; }
.filter-count   { font-weight: 700; }

.filter-clear-btn {
    font-size: 0.75rem;
    padding: 0;
    color: #212529;
    background: transparent;
    border: none;
    text-decoration: underline;
    cursor: pointer;
}

.starcross-text-dark { color: #212529 !important; }

.filter-check-item {
    display: flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
}

.filter-check-label {
    font-size: 0.85rem;
    padding-left: 0.25rem;
    cursor: pointer;
}

.filter-active-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background-color: #212529;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 50%;
    margin-left: 6px;
    vertical-align: middle;
}

/* ============================================
   Product Grid
============================================ */
.shop-grid {
    padding-left: 0;
    padding-right: 0;
    margin-top: 1rem;
}

.single-product-box {
    margin-bottom: 1.5rem;
    border: 1px solid #e2e2e2;
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    background: #fff;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.single-product-box:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.10);
    transform: translateY(-3px);
}

/* Gambar rasio konsisten */
.product-thumb {
    position: relative;
    overflow: hidden;
    background-color: #f5f5f5;
    aspect-ratio: 3 / 4;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease, opacity 0.3s ease;
}

.product-thumb:hover img:first-child {
    transform: scale(1.04);
    opacity: 0;
}

.hover-image {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hover-image img {
    width: 100%; height: 100%;
    object-fit: cover;
}

.product-thumb:hover .hover-image { opacity: 1; }

/* Badge stok */
.stock-badge {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 2px;
    z-index: 2;
}

.stock-badge.out  { background: #212529; color: #fff; }
.stock-badge.back { background: #f0ad4e; color: #fff; }

/* Action overlay */
.product_action {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
    background: rgba(0,0,0,0.6);
    padding: 0.6rem 0;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 3;
}

.product-thumb:hover .product_action { transform: translateY(0); }

.product_action ul {
    list-style: none;
    padding: 0; margin: 0;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.product_action ul li a {
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    padding: 0.3rem 0.9rem;
    border: 1px solid rgba(255,255,255,0.7);
    transition: all 0.2s;
    font-family: 'Poppins', sans-serif;
}

.product_action ul li a:hover {
    background: #fff;
    color: #212529;
}

/* Nama & Harga */
.product-content {
    padding: 0.85rem 1rem;
    border-top: 1px solid #f0f0f0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.pro-rating { margin-bottom: 0.25rem; }

.product-content h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    flex: 1;
}

.product-content h4 a {
    color: #212529;
    text-decoration: none;
    transition: color 0.2s;
}

.product-content h4 a:hover { color: #555; }

.price-box {
    font-size: 0.875rem;
    margin-top: auto;
}

.price-box .price { font-weight: 700; color: #212529; }
.woocommerce-Price-currencySymbol { font-size: 0.8rem; }

/* ============================================
   Pagination
============================================ */
.starcross-shop-pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2.5rem;
    margin-bottom: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f0f0f0;
}

.shop-pagination-info {
    font-size: 0.8rem;
    color: #adb5bd;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.shop-pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.shop-page-btn {
    width: 38px; height: 38px;
    border: 1px solid #dee2e6;
    background: #fff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #212529;
    transition: all 0.2s;
    flex-shrink: 0;
}

.shop-page-btn:hover:not(:disabled) {
    background: #212529;
    color: #fff;
    border-color: #212529;
}

.shop-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.shop-page-numbers {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: center;
}

.shop-page-num {
    width: 38px; height: 38px;
    border: 1px solid #dee2e6;
    background: #fff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: #212529;
    transition: all 0.2s;
    flex-shrink: 0;
}

.shop-page-num:hover         { background: #f8f9fa; border-color: #212529; }
.shop-page-num.active        { background: #212529; color: #fff; border-color: #212529; font-weight: 700; }

.shop-page-dots {
    width: 38px; height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #adb5bd;
    cursor: default;
}

/* ════════════════════════════════════════════
   RESPONSIVE — Tablet L  (≤ 991px)
════════════════════════════════════════════ */
@media (max-width: 991.98px) {
    .shop-wrapper           { padding-bottom: 2rem; }
    .sticky-product-filter  { top: 56px; padding: 0.85rem 0; }
    .starcross-shop-topbar  { gap: 0.5rem; }
    .filter-bar             { gap: 0.5rem; }
    .product-content        { padding: 0.75rem 0.85rem; }
}

/* ════════════════════════════════════════════
   RESPONSIVE — Tablet S / Mobile L  (≤ 767px)
════════════════════════════════════════════ */
@media (max-width: 767.98px) {
    .starcross-shop-topbar  { flex-direction: column; align-items: flex-start; }
    .shop-search-bar        { min-width: 100%; width: 100%; }
    .woocommerce-result-count { width: 100%; }

    /* Sembunyikan action overlay di touch device (tap tidak support hover) */
    .product_action         { display: none; }

    .shop-pagination-controls { gap: 0.3rem; }
    .shop-page-btn, .shop-page-num { width: 34px; height: 34px; font-size: 0.8rem; }
    .shop-pagination-info   { font-size: 0.75rem; }

    .single-product-box     { margin-bottom: 1.25rem; }
    .product-content h4     { font-size: 0.8rem; }
    .price-box              { font-size: 0.8rem; }
}

/* ════════════════════════════════════════════
   RESPONSIVE — Mobile M  (≤ 575px)
════════════════════════════════════════════ */
@media (max-width: 575.98px) {
    .shop-wrapper           { padding-top: 0.5rem; padding-bottom: 1.5rem; }
    .sticky-product-filter  { top: 52px; padding: 0.65rem 0; }

    .product-item           { padding-left: 6px; padding-right: 6px; }
    .single-product-box     { margin-bottom: 0.85rem; }

    .filter-bar             { gap: 0.4rem; }
    .product-filter-dropdown .btn { font-size: 0.75rem; padding: 0.25rem 0.6rem; }
    .starcross-product-filter-btn { font-size: 0.8rem; padding: 0.3rem 0.65rem; }
    .filter-active-badge    { width: 15px; height: 15px; font-size: 0.6rem; margin-left: 4px; }

    .shop-page-btn, .shop-page-num { width: 30px; height: 30px; font-size: 0.75rem; }
    .shop-page-dots         { width: 24px; }

    .product-content        { padding: 0.6rem 0.75rem; }
    .product-content h4     { font-size: 0.78rem; }
    .price-box              { font-size: 0.78rem; }
}

/* ════════════════════════════════════════════
   RESPONSIVE — Mobile S  (≤ 374px)
════════════════════════════════════════════ */
@media (max-width: 374px) {
    .sticky-product-filter  { top: 48px; }
    .product-filter-dropdown .btn { font-size: 0.7rem; padding: 0.2rem 0.5rem; }
    .starcross-product-filter-btn { font-size: 0.75rem; padding: 0.25rem 0.5rem; margin-right: 0; }
    .shop-page-btn, .shop-page-num { width: 28px; height: 28px; font-size: 0.7rem; }
    .product-content h4     { font-size: 0.75rem; }
    .price-box              { font-size: 0.75rem; }
    .filter-bar             { gap: 0.3rem; }
}
