/* ============================================================
   HOMEPAGE LAYOUT — Category Sections + Flash Strip
   ============================================================ */

/* ---- Flash Sale Strip ---- */
.home-flash-strip {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 20px 0;
    margin-bottom: 0;
    overflow: hidden; /* prevent any child from overflowing */
}

.flash-strip-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0; /* allow flex children to shrink */
}

.flash-strip-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 72px;
    flex-shrink: 0;
    color: #fbbf24;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    padding: 0 4px;
}

.flash-bolt {
    font-size: 22px;
    line-height: 1;
}

.flash-strip-swiper {
    flex: 1 1 0;   /* allow the swiper to shrink as needed */
    min-width: 0;
    overflow: hidden;
}

/* Cards inside flash strip inherit white bg — just need smaller shadow */
.home-flash-strip .pc-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.flash-strip-cta {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: max-content;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    color: #fbbf24;
    text-decoration: none;
    padding: 8px 14px;
    border: 1.5px solid rgba(251, 191, 36, 0.4);
    border-radius: 8px;
    transition: background 0.18s ease, color 0.18s ease;
    white-space: nowrap;
}

.flash-strip-cta:hover {
    background: #fbbf24;
    color: #0f172a;
    text-decoration: none;
    border-color: #fbbf24;
}

/* Tablet: hide CTA, tighten gap */
@media (max-width: 767px) {
    .flash-strip-inner {
        gap: 12px;
    }

    .flash-strip-label {
        min-width: 52px;
        font-size: 11px;
    }

    .flash-strip-cta {
        display: none;
    }
}

/* Small mobile: strip down label to bolt icon only */
@media (max-width: 479px) {
    .flash-strip-inner {
        gap: 8px;
        padding: 0 4px;
    }

    .flash-strip-label {
        min-width: 30px;
        padding: 0;
    }

    .flash-strip-label span:not(.flash-bolt) {
        display: none; /* hide "Flash Sale" text, keep bolt */
    }

    .flash-bolt {
        font-size: 20px;
    }
}

/* ============================================================
   HOMEPAGE CATEGORY SECTIONS  (hcs-*)
   ============================================================ */

.hcs-section {
    padding: 48px 0 16px;
}

.hcs-section + .hcs-section {
    padding-top: 32px;
    border-top: 1px solid #f1f5f9;
}

/* ---- Section header ---- */
.hcs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    gap: 12px;
}

.hcs-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.hcs-cat-thumb {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f1f5f9;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.hcs-cat-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hcs-title {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 2px;
    line-height: 1.2;
    letter-spacing: -0.3px;
}

.hcs-subtitle {
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
}

.hcs-view-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 600;
    color: #0f766e;
    text-decoration: none;
    white-space: nowrap;
    padding: 7px 14px;
    border: 1.5px solid #0f766e;
    border-radius: 8px;
    transition: background 0.18s ease, color 0.18s ease;
    flex-shrink: 0;
}

.hcs-view-all:hover {
    background: #0f766e;
    color: #ffffff;
    text-decoration: none;
}

.hcs-view-all svg {
    transition: transform 0.18s ease;
}

.hcs-view-all:hover svg {
    transform: translateX(3px);
}

/* ---- Products swiper row ---- */
.hcs-products {
    position: relative;
}

.hcs-swiper {
    overflow: visible;
    padding-bottom: 8px;
}

/* ---- Prev / Next nav arrows ---- */
.hcs-nav {
    position: absolute;
    top: 50%;
    transform: translateY(calc(-50% - 4px));
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #0f172a;
    z-index: 10;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
    user-select: none;
}

.hcs-nav:hover {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

.hcs-nav--prev {
    left: -18px;
}

.hcs-nav--next {
    right: -18px;
}

.hcs-nav.swiper-button-disabled {
    opacity: 0.35;
    pointer-events: none;
}

@media (max-width: 767px) {
    .hcs-nav {
        display: none;
    }

    .hcs-section {
        padding-top: 32px;
    }

    .hcs-title {
        font-size: 18px;
    }

    .hcs-cat-thumb {
        width: 38px;
        height: 38px;
    }
}

/* Very small screens: stack header, shrink text, hide thumb */
@media (max-width: 479px) {
    .hcs-section {
        padding-top: 24px;
    }

    .hcs-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 14px;
    }

    .hcs-header-left {
        gap: 8px;
        width: 100%;
    }

    .hcs-cat-thumb {
        display: none; /* remove thumbnail to save space */
    }

    .hcs-title {
        font-size: 15px;
        letter-spacing: 0;
    }

    .hcs-subtitle {
        font-size: 12px;
    }

    .hcs-view-all {
        font-size: 12px;
        padding: 5px 10px;
        align-self: flex-start;
    }

    /* Ensure product cards don't overflow */
    .hcs-swiper {
        overflow: hidden;
    }
}

/* ---- Skeleton loader strip ---- */
.hcs-skeleton-wrap {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    padding: 40px 0 20px;
}

@media (max-width: 991px) {
    .hcs-skeleton-wrap {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .hcs-skeleton-wrap {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ---- "End of categories" message ---- */
.hcs-all-done {
    text-align: center;
    padding: 24px 0 8px;
    font-size: 14px;
    color: #94a3b8;
}

/* ============================================================
   HOMEPAGE INFINITE PRODUCT SCROLL
   ============================================================ */

.hips-section {
    position: relative; /* anchor the overlay */
    padding: 48px 0 56px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

/* ---- Initial loading overlay ---- */
#hips-overlay {
    position: absolute;
    inset: 0;
    min-height: 240px;
    background: rgba(248, 250, 252, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.4s ease;
    pointer-events: auto;
}

#hips-overlay.hips-overlay--hidden {
    opacity: 0;
    pointer-events: none;
}

/* CSS-only spinner — no image dependency */
.hips-spinner {
    width: 52px;
    height: 52px;
    border: 4px solid #e2e8f0;
    border-top-color: #0f766e;
    border-radius: 50%;
    animation: hipsSpinAnim 0.75s linear infinite;
}

@keyframes hipsSpinAnim {
    to { transform: rotate(360deg); }
}

.hips-header {
    text-align: center;
    margin-bottom: 32px;
}

.hips-title {
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px;
}

.hips-sub {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

.hips-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 20px;
}

@media (max-width: 1199px) {
    .hips-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
}

@media (max-width: 767px) {
    .hips-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
}

@media (max-width: 479px) {
    .hips-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

.hips-loader {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 1199px) {
    .hips-loader { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
}

@media (max-width: 767px) {
    .hips-loader { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
}

@media (max-width: 479px) {
    .hips-loader { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

.hips-done {
    text-align: center;
    padding: 28px 0 4px;
    font-size: 14px;
    color: #94a3b8;
}
