/* ====================== LAYOUT ====================== */
#productContainer {
    opacity: 0;
    transition: opacity 0.4s ease;
}
#productContainer.has-content,
#productContainer.loaded {
    opacity: 1;
}
.h-vh-100 {
    height: 100dvh;
    overflow-x: hidden;
    box-sizing: border-box;
    scrollbar-width: none;
}
#index-section {
    display: flex;
    flex-direction: column;
}
.header-wrapper {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    flex: 1;
    overflow: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.header-wrapper::-webkit-scrollbar,
.shop-body::-webkit-scrollbar,
.product-content::-webkit-scrollbar,
.search-products::-webkit-scrollbar {
    display: none;
}

/* ====================== SHOPS CONTAINER ====================== */
.shops-container {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    grid-column: span 5;
    position: relative;
}

/* ====================== HEADER & SEARCH ====================== */
.shop-heart {
    padding: 10px;
    width: 100%;
    background: #fd7e14;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.search-info {
    display: flex;
    align-items: center;
    gap: 20px;
}
.shop-heart.expanded {
    width: 100% !important;
    transition: width 0.3s ease;
}
.shop-heart.expanded .shops-cart-messenger {
    opacity: 0;
    visibility: hidden;
}
.shop-heart.expanded .shops-search {
    max-width: 100%;
    flex: 1 0 auto;
}
.shops-search {
    position: relative;
    width: 100%;
    transition: flex 0.3s ease;
}
.shops-search .form-control {
    width: 100%;
    padding-left: 2.5rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    height: 40px;
}
.shops-search .form-control:focus {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-color: #007bff;
}
.shops-search .search-icon {
    position: absolute;
    top: 50%;
    left: 0.75rem;
    transform: translateY(-50%);
    color: #666;
    font-size: 1rem;
    line-height: 1;
    pointer-events: none;
}
.shops-cart-messenger {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
}
.shops-cart-messenger img {
    width: 30px;
}
.cart-count {
    position: relative;
}
.order-count {
    position: absolute;
    top: 0;
    right: -3px;
    background: var(--blue);
    color: #fff;
    font-size: 12px;
    border-radius: 50%;
    padding: 5px;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}
#mobileFilter {
    color: white;
    cursor: pointer;
    display: none;
}
#mobileFilterPopup {
    position: fixed;
    top: 55px;
    left: 50%;
    transform: translateX(-50%);
    width: 98%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 10px;
    display: none;
}
.mobile-filter {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
/* ====================== SEARCH RESULTS POPUP ====================== */
.search-products {
    position: absolute;
    top: 55px;
    width: 98%;
    left: 50%;
    transform: translateX(-50%);
    max-height: 65vh;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.search-products.show {
    display: block;
}
.search-product-item {
    display: grid;
    grid-template-columns: 80px 1fr 80px;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
    gap: 5px;
    text-decoration: none !important;
    color: #000;
}
.search-product-item:hover {
    background: #f8f9fa;
}
.search-product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 1 / 1;
    transition: transform 0.3s;
    vertical-align: middle;
}
.search-product-info {
    display: flex;
    flex-direction: column;
}
.search-product-title {
    font-size: 0.9em;
    font-weight: 500;
    color: #000;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-product-describe {
    font-size: 0.8em;
    font-weight: 400;
    color: #666;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}
.search-product-catalog {
    font-size: 0.8rem;
    color: var(--blue);
}
.search-product-price {
    display: flex;
    flex-direction: column;
    align-items: center;
}
/* ====================== SEARCH OVERLAY ====================== */
.search-overlay {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    pointer-events: auto;
}
.search-overlay.show {
    opacity: 1;
    visibility: visible;
}
/* ====================== CONTENT ====================== */
.shop-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
}
.product-menu {
    height: 30px;
    background: #fd7e14;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    padding: 10px;
    width: 100%;
}
.product-menu-item {
    background: #fff;
    border-radius: 5px;
    padding: 5px 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 5px;
}
.product-menu-item span {
    font-weight: 600;
    font-size: 14px;
}

/* ====================== PRODUCT CONTAINER ====================== */
.product-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    overflow: hidden;
}
.product-filter {
    display: flex;
    flex-direction: column;
    grid-column: span 1;
    gap: 10px;
    padding: 10px;
    border-right: 1px solid rgb(238, 238, 238);
}
.product-content {
    grid-column: span 4;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.product-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px;
}

.product-item {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    text-decoration: none !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 5px;
    box-shadow: 0 2px 5px -1px rgba(50, 50, 93, 0.25), 0 1px 3px -1px rgba(0, 0, 0, 0.3);
    border: 1px solid #ccc;
    background: #fff;
}

/* ====================== PRODUCT CARD ====================== */
.product-img {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
}
.product-img img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 5px 5px 0 0;
    transition: transform 0.3s;
}
.card-body {
    padding: 8px;
}
.product-title {
    font-size: 1em;
    font-weight: 400;
    color: #000;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.product-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 5px;
    padding: 5px;
}
.product-voucher {
    display: flex;
    flex-direction: column;
}
.shop-voucher {
    display: flex;
    align-items: center;
    gap: 5px;
}
.product-social {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.product-tiktok,
.product-shopee {
    display: flex;
    align-items: center;
    gap: 5px;
}
.product-info img {
    border-radius: 5px;
    width: 20px;
}
.price-format {
    font-family: Arial, sans-serif;
    color: #fd7e14;
}
.product-piece {
    background: rgba(208, 1, 27, .08);
    align-items: center;
    color: var(--orange);
    cursor: default;
    display: flex;
    padding: 3px 7px;
    position: relative;
    gap: 5px;
}
.product-piece:before {
    left: -4px;
}
.product-piece:after {
    right: -4px;
}
.countdown-box:after, .countdown-box:before, .product-piece:after, .product-piece:before {
    background-image: radial-gradient(#fff 2px, transparent 0);
    background-position-x: 0px;
    background-size: 10px 10px;
    content: "";
    height: 100%;
    position: absolute;
    top: 0;
    width: 10px;
}
.product-discount {
    color: rgb(46, 204, 113);
    font-family: Arial, sans-serif;
    display: flex;
    align-items: center;
    gap: 5px;
}
.social-discount {
    display: flex;
    align-items: center;
    gap: 3px;
    color: #ff0000;
}
.product-ship {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    text-overflow: ellipsis;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
}
.shops-piece-ship, .shops-piece-location {
    display: flex;
    align-items: center;
    text-overflow: ellipsis;
    max-width: 50%;
    color: rgb(40, 167, 69);
    overflow: hidden;
    gap: 5px;
}
/* Badges */
.mining-countdown, .piece-find {
    position: absolute;
    padding: 3px;
    font-size: 12px;
    border-radius: 5px 0;
    display: flex;
    align-items: center;
    gap: 2px;
}
.mining-countdown { background: #007bff; color: #fff; top: 0; left: 0; }
.piece-find { background: #fd7e14; color: #fff; top: 0; right: 0; }

/* ====================== FILTER ====================== */
.filter-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05em;
    font-weight: 600;
    color: #222;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.filter-title {
    font-weight: 600;
    font-size: 1em;
    color: #333;
    margin-bottom: 4px;
}
.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14.5px;
    color: #444;
    user-select: none;
}

.custom-checkbox input {
    display: none;
}
.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 5px;
    position: relative;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.checkmark i {
    color: white;
    font-size: 13px;
    opacity: 0;
    transform: scale(0.6);
    transition: all 0.25s ease;
}

.custom-checkbox input:checked + .checkmark {
    background: #fd7e14;
    border-color: #fd7e14;
}

.custom-checkbox input:checked + .checkmark i {
    opacity: 1;
    transform: scale(1);
}

.custom-checkbox:hover .checkmark {
    border-color: #fd7e14;
}

.clear-filter {
    margin-top: 8px;
    padding: 12px;
    color: #fd7e14;
    border: 1px solid #fd7e14;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.clear-filter:hover {
    background: #fd7e14;
    color: white;
}

.no-products {
    grid-column: span 3;
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-size: 15px;
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}
/* Mobile Filter Popup */
#mobileFilterPopup {
    position: fixed;
    top: 55px;
    left: 50%;
    transform: translateX(-50%);
    width: 98%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 10px;
    display: none;
    z-index: 1050;
}
/* ====================== SKELETON ====================== */
.skeleton {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px -1px rgba(50, 50, 93, 0.1), 0 1px 3px -1px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.product-item.skeleton .product-img {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}
.product-item.skeleton .skeleton-img {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 400% 100%;
    animation: shimmer 1.3s infinite linear;
}
.product-item.skeleton .card-body {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.skeleton-title {
    height: 17px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 400% 100%;
    animation: shimmer 1.3s infinite linear;
    border-radius: 4px;
}
.skeleton-price {
    height: 24px;
    width: 70%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 400% 100%;
    animation: shimmer 1.3s infinite linear;
    border-radius: 4px;
}
.skeleton-piece {
    height: 15px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 400% 100%;
    animation: shimmer 1.3s infinite linear;
    border-radius: 4px;
}
@keyframes shimmer {
    0%   { background-position: 400% 0; }
    100% { background-position: -400% 0; }
}
/* ====================== MEDIA QUERIES ====================== */
@media (max-width: 767px) {
    .shops-container { grid-column: span 6; }
    .product-filter#desktopFilter { display: none; }
    .product-container { grid-template-columns: 1fr; }
    .product-content { grid-column: span 1; }
    #mobileFilter {
        display: block;
    }
}

@media (min-width: 768px) and (max-width: 1599px) {
    .header-wrapper {
        grid-template-columns: repeat(5, 1fr);
    }
    .shops-container {
        grid-column: span 4;
    }
    .product-list { grid-template-columns: repeat(3, 1fr); }
    .product-content { grid-column: span 3; }
}
@media (min-width: 1600px) {
    .shops-container {
        grid-column: span 5;
    }
    .product-list,
    .product-container { grid-template-columns: repeat(5, 1fr); }
}