/* --- Layout --- */
.page-wrap {
    display: flex;
    gap: 20px;
    width: 96%;
    margin: 20px auto;
}
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
    gap: 5px;
}

.pagination a {
    display: inline-block;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #ccc;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    transition: 0.2s;
}

.pagination a:hover {
    background: #f0f0f0;
}

.pagination a.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.pagination a.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* --- Filter section --- */
.filter-box {
    width: 240px;
    padding: 15px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #eee;
    height: fit-content;
}

.filter-box h3 {
    margin-bottom: 10px;
    font-size: 18px;
}

.filter-item {
    margin-bottom: 15px;
}

/* --- Product Grid --- */
#productsList {
    width: 100%;
}

/* --- Product Card --- */
.product-card {
    width: 16%;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    margin: 2px;
    height: 300px;
    position: relative;
    padding:10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: border-color 0.3s ease;
    float:left;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    vertical-align: top;
}

.product-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.product-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 5px;
}

/* --- Stream content --- */
.streamconten {
    margin-top: auto;
    width: 100%;
}
#spinner {
    display: none;
    position: fixed;
    top: env(safe-area-inset-top, 50px);     /* respects iPhone notch */
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    padding: 12px 28px;           /* slightly smaller on mobile */
    border-radius: 50px;
    box-shadow: 0 8px 25px rgba(243,156,18,0.4);
    font-weight: 600;
    letter-spacing: 1px;
    text-align: center;
    backdrop-filter: blur(10px);
    white-space: nowrap;
    animation: float 0.4s ease-out;

    /* RESPONSIVE FONT & PADDING */
    font-size: clamp(16px, 4vw, 20px);
    padding: clamp(10px, 3vw, 14px) clamp(20px, 8vw, 35px);
}

@keyframes float {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Optional: darker backdrop on very small screens */
@media (max-width: 480px) {
    #spinner {
        background: rgba(243, 156, 18, 0.98);
        backdrop-filter: blur(8px);
    }
}
.streamconten ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

.prod-name {
    font-size: 14px;
    text-align: left;
    color: black;
    margin: 10px 0;
    height: 40px;
    overflow:hidden;
}

.prod-price {
    font-size: 110%;
    line-height: 16px;
    text-align: center;
    color: black;
}

.buy-yellow {
    background: #ffcc00;
    border: none;
    border-radius: 5px;
    padding: 6px 12px;
    cursor: pointer;
    transition: 0.2s;
    color: white;
    text-decoration: none;
}

.buy-yellow:hover {
    background: #e6b800;
}

/* Pagination buttons */
.page-btn {
    background: #fff;
    border: 1px solid #ccc;
    margin: 3px;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
}

.page-btn:hover:not(:disabled) {
    background: #f0f0f0;
}

/* Mobile */
@media (max-width: 768px) {
    .page-wrap {
        flex-direction: column;
    }
    .filter-box {
        width: 100%;
    }
    .product-card{
        width:48%;
        height:300px;
        padding:5px;
        margin:0.1px;
    }
    .product-card img {
        width: 100%;
        height: 150px;
        object-fit: cover;
        border-radius: 6px;
    }
}
