/**
 * Front Page Styles - Extracted from front-page.php inline CSS for caching
 * @package Astra Child (isakib Pro)
 */

/* Scope all styles under the custom-homepage class */
.custom-homepage {
    font-family: 'Hind Siliguri', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f7f9fa;
    color: #2c3e50;
    padding-bottom: 50px;
}

/* Top Offer Ticker Bar */
.hp-ticker-bar {
    background: linear-gradient(90deg, #d97706, #dc2626);
    color: #ffffff;
    text-align: center;
    padding: 8px 12px;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
    line-height: 1.35;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}
.hp-ticker-bar span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Dynamic Slider Styling */
.hp-slider-section {
    position: relative;
    max-width: 1200px;
    margin: 15px auto 25px;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    background-color: #e2e8f0;
}

.hp-slider-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1200 / 480;
}

.hp-slide-item {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
    z-index: 1;
}
.hp-slide-item.active {
    opacity: 1;
    visibility: visible;
    position: relative;
    z-index: 2;
}

.hp-slide-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none !important;
}

.hp-slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Fallback slide background gradient and content styling */
.hp-slide-fallback {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
    position: relative;
    overflow: hidden;
}
.hp-slide-fallback::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 10%, transparent 10.01%);
    background-size: 20px 20px;
    opacity: 0.3;
}
.hp-slide-fallback-content {
    max-width: 700px;
    z-index: 2;
}
.hp-slide-fallback-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}
.hp-slide-fallback-desc {
    font-size: 15px;
    margin-bottom: 20px;
    opacity: 0.9;
    line-height: 1.5;
}
.hp-slide-fallback-btn {
    display: inline-block;
    background-color: #EA7236;
    color: #ffffff !important;
    padding: 10px 28px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(234, 114, 54, 0.4);
    transition: all 0.3s ease;
}
.hp-slide-fallback-btn:hover {
    background-color: #f2864f;
    transform: translateY(-2px);
}

/* Slider controls */
.hp-slider-prev,
.hp-slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: #ffffff;
    color: #1e293b !important;
    border: 1px solid #e2e8f0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    pointer-events: auto;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    user-select: none;
}
.hp-slider-prev:hover,
.hp-slider-next:hover {
    background-color: #EA7236;
    color: #ffffff !important;
    border-color: #EA7236;
    transform: translateY(-50%) scale(1.1);
}
.hp-slider-prev { left: 12px; }
.hp-slider-next { right: 12px; }

/* Slider Pagination dots */
.hp-slider-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.25);
    padding: 4px 10px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}
.hp-slider-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
}
.hp-slider-dot.active {
    background-color: #EA7236;
    width: 18px;
    border-radius: 10px;
}

/* Container */
.hp-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
}

/* Category Quick Navigation Cards Section */
.hp-cat-nav-section {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 18px 16px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid #edf2f7;
    width: 100%;
    box-sizing: border-box;
}
.hp-cat-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.hp-cat-nav-title {
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.hp-cat-nav-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}
.hp-cat-nav-grid > * {
    min-width: 0;
}
.hp-cat-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 9px 12px;
    text-decoration: none !important;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
    min-width: 0;
    box-sizing: border-box;
}
.hp-cat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(234, 114, 54, 0.12);
    border-color: #EA7236;
}
.hp-cat-card-icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    background: #f8fafc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #f1f5f9;
}
.hp-cat-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.hp-cat-card-name {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hp-cat-card-offer {
    font-size: 11px;
    font-weight: 600;
    color: #dc2626;
    background: #fef2f2;
    padding: 2px 6px;
    border-radius: 10px;
    display: inline-block;
    width: fit-content;
}

/* Section Styling */
.hp-section {
    margin-bottom: 40px;
}
.hp-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 2px solid #eaeaea;
    padding-bottom: 10px;
    gap: 8px;
}
.hp-section-title {
    font-size: 19px;
    font-weight: 700;
    color: #1e293b;
    position: relative;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.hp-section-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 50px;
    height: 2.5px;
    background-color: #EA7236;
}
.hp-view-all-link {
    background-color: #EA7236 !important;
    color: #ffffff !important;
    font-size: 12.5px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 18px;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.25s ease;
    box-shadow: 0 3px 8px rgba(234, 114, 54, 0.25);
    white-space: nowrap;
    flex-shrink: 0;
}
.hp-view-all-link:hover {
    background-color: #d96228 !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(234, 114, 54, 0.35);
}

.hp-section-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.hp-carousel-arrows {
    display: flex;
    align-items: center;
    gap: 5px;
}
.hp-arrow-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    outline: none;
}
.hp-arrow-btn svg {
    display: block;
    width: 14px;
    height: 14px;
    pointer-events: none;
}
.hp-arrow-btn:hover,
.hp-arrow-btn:active {
    background-color: #EA7236;
    border-color: #EA7236;
    color: #ffffff;
    transform: scale(1.06);
    box-shadow: 0 3px 8px rgba(234, 114, 54, 0.25);
}

/* Horizontal Scroll Wrapper & Carousel Grid */
.hp-product-slider-wrapper {
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding: 4px 2px 10px 2px;
    scrollbar-width: thin;
    scrollbar-color: #EA7236 #f1f5f9;
}
.hp-product-slider-wrapper::-webkit-scrollbar {
    height: 4px;
    display: block;
}
.hp-product-slider-wrapper::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}
.hp-product-slider-wrapper::-webkit-scrollbar-thumb {
    background: #EA7236;
    border-radius: 4px;
}

.hp-product-carousel {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 16px;
    flex-wrap: nowrap;
}

.hp-product-carousel .hp-product-card {
    flex: 0 0 210px;
    max-width: 210px;
    scroll-snap-align: start;
}

/* Product Card Styling (front-page specific overrides) */
.custom-homepage .hp-product-card {
    padding: 12px;
}

/* Product Image Wrapper (front-page context) */
.custom-homepage .hp-product-info {
    padding: 10px 0 0 0;
}
.custom-homepage .hp-product-title {
    height: 40px;
    line-height: 1.35;
}

/* Offer & Sale Badges */
.hp-offer-badge-wrapper {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 3;
}
.hp-discount-percent-badge {
    background-color: #dc2626;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.3);
}

/* Star ratings (front-page) */
.custom-homepage .hp-product-rating {
    margin-bottom: 6px;
}

/* Trust & Guarantee Banner */
.hp-trust-banner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 16px;
    margin-top: 40px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}
.hp-trust-item {
    display: flex;
    align-items: center;
    gap: 12px;
}
.hp-trust-icon {
    font-size: 28px;
    line-height: 1;
}
.hp-trust-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.hp-trust-text strong {
    font-size: 14px;
    color: #1e293b;
}
.hp-trust-text span {
    font-size: 12px;
    color: #64748b;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hp-product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    .hp-cat-nav-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .hp-trust-banner {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    .hp-slider-wrapper {
        aspect-ratio: 1200 / 480;
    }
}

@media (max-width: 768px) {
    .hp-ticker-bar {
        font-size: 12px;
        padding: 6px 10px;
    }
    .hp-cat-nav-section {
        padding: 14px 12px;
        margin-bottom: 20px;
    }
    .hp-cat-nav-header {
        margin-bottom: 10px;
    }
    .hp-cat-nav-title {
        font-size: 15px;
    }
    .hp-cat-nav-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .hp-cat-card {
        padding: 7px 8px;
        gap: 6px;
        border-radius: 8px;
    }
    .hp-cat-card-icon {
        width: 26px;
        height: 26px;
        font-size: 15px;
    }
    .hp-cat-card-name {
        font-size: 11.5px;
    }
    .hp-section-header {
        margin-bottom: 12px;
        padding-bottom: 6px;
        gap: 6px;
    }
    .hp-section-title {
        font-size: 14.5px;
        font-weight: 700;
        flex: 1;
        min-width: 0;
    }
    .hp-section-title::after {
        bottom: -8px;
        width: 35px;
        height: 2px;
    }
    .hp-section-header-right {
        gap: 6px;
    }
    .hp-carousel-arrows {
        gap: 4px;
    }
    .hp-arrow-btn {
        width: 26px;
        height: 26px;
    }
    .hp-arrow-btn svg {
        width: 12px;
        height: 12px;
    }
    .hp-view-all-link {
        font-size: 11px;
        padding: 4px 10px;
        border-radius: 14px;
    }
    .hp-product-carousel {
        gap: 10px;
    }
    /* Exactly 2 products visible side by side on mobile */
    .hp-product-carousel .hp-product-card {
        flex: 0 0 calc(50% - 5px);
        max-width: calc(50% - 5px);
        width: calc(50% - 5px);
    }
    .custom-homepage .hp-product-card {
        padding: 8px;
    }
    .custom-homepage .hp-product-info {
        padding: 6px 0 0 0;
    }
    .custom-homepage .hp-product-title {
        font-size: 12.5px;
        height: 34px;
        line-height: 1.35;
        margin-bottom: 4px;
    }
    .custom-homepage .hp-product-rating {
        font-size: 10px;
        margin-bottom: 4px;
    }
    .hp-discount-percent-badge {
        font-size: 9.5px;
        padding: 2px 5px;
    }
    .hp-trust-banner {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .hp-container {
        padding: 0 10px;
    }
    .hp-cat-nav-section {
        padding: 10px 8px;
    }
    .hp-cat-nav-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    .hp-cat-card {
        padding: 6px 6px;
        gap: 5px;
    }
    .hp-cat-card-icon {
        width: 24px;
        height: 24px;
        font-size: 13.5px;
    }
    .hp-cat-card-name {
        font-size: 11px;
    }
    .hp-section-title {
        font-size: 14px;
    }
}
