/**
 * Shop-Bedding Theme - Main Page Styles
 * Hero banner, category nav, product sections
 *
 * @package shop-bedding
 */

/* ==========================================
   Hero Banner
   ========================================== */
.sb-hero {
    position: relative;
    overflow: hidden;
    background: var(--sb-bg-gray);
}

.sb-hero-swiper {
    width: 100%;
}

.sb-hero-slide {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 5;
    overflow: hidden;
}

.sb-hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sb-hero-pagination {
    bottom: 1rem !important;
}

.sb-hero-pagination .swiper-pagination-bullet {
    width: 0.625rem;
    height: 0.625rem;
    background: rgba(255, 255, 255, 0.6);
    opacity: 1;
}

.sb-hero-pagination .swiper-pagination-bullet-active {
    background: #ffffff;
    width: 1.5rem;
    border-radius: 0.3125rem;
}

.sb-hero-prev,
.sb-hero-next {
    color: #ffffff !important;
    width: 2.5rem !important;
    height: 2.5rem !important;
    background: rgba(0, 0, 0, 0.25) !important;
    border-radius: 50% !important;
}

.sb-hero-prev::after,
.sb-hero-next::after {
    font-size: 1rem !important;
}

/* ==========================================
   Hero Text (fallback when no banner images)
   ========================================== */
.sb-hero-text {
    position: relative;
    background: var(--sb-primary);
    overflow: hidden;
    margin-top: -40px;
}

.sb-hero {
    margin-top: -40px;
}

.sb-hero-text::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(255,255,255,0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.05) 0%, transparent 50%);
    pointer-events: none;
}

.sb-hero-text::after {
    content: '';
    position: absolute;
    right: -5%;
    top: -20%;
    width: 40%;
    height: 140%;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
    pointer-events: none;
}

.sb-hero-text-inner {
    position: relative;
    z-index: 1;
    max-width: var(--sb-container-max);
    margin: 0 auto;
    padding: 4rem 1.5rem;
    text-align: center;
    color: #ffffff;
}

.sb-hero-text-badge {
    display: inline-block;
    padding: 0.375rem 1rem;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
}

.sb-hero-text-title {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 1rem;
    color: #ffffff;
}

.sb-hero-text-desc {
    font-size: 1rem;
    line-height: 1.7;
    opacity: 0.85;
    margin: 0 0 2rem;
}

.sb-hero-text-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.sb-hero-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 2rem;
    border-radius: var(--sb-radius);
    font-size: 0.9375rem;
    font-weight: 600;
    transition: all var(--sb-transition);
}

.sb-hero-btn-primary {
    background: #ffffff;
    color: var(--sb-primary);
}

.sb-hero-btn-primary:hover {
    background: var(--sb-primary-bg);
    color: var(--sb-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.sb-hero-btn-outline {
    background: transparent;
    color: #ffffff;
    border: 1.5px solid rgba(255,255,255,0.5);
}

.sb-hero-btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: #ffffff;
    color: #ffffff;
    transform: translateY(-1px);
}

.sb-hero-text-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.sb-hero-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sb-hero-stat strong {
    font-size: 1.25rem;
    font-weight: 700;
}

.sb-hero-stat span {
    font-size: 0.75rem;
    opacity: 0.7;
}

.sb-hero-stat-divider {
    width: 1px;
    height: 2rem;
    background: rgba(255,255,255,0.25);
}

/* ==========================================
   Category Quick Navigation
   ========================================== */
.sb-category-nav {
    padding: 2rem 0;
    background: var(--sb-bg);
}

.sb-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.sb-category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 0.75rem;
    border-radius: var(--sb-radius-lg);
    background: var(--sb-bg-gray);
    transition: all var(--sb-transition);
    text-align: center;
}

.sb-category-card:hover {
    background: var(--sb-primary-bg);
    transform: translateY(-2px);
    box-shadow: var(--sb-shadow);
    color: var(--sb-primary);
}

.sb-category-card-icon {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--sb-primary-bg);
    color: var(--sb-primary);
    font-size: 1.25rem;
    transition: all var(--sb-transition);
}

.sb-category-card:hover .sb-category-card-icon {
    background: var(--sb-primary);
    color: #ffffff;
}

.sb-category-card-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--sb-text);
    line-height: 1.3;
}

.sb-category-card-count {
    font-size: 0.6875rem;
    color: var(--sb-text-muted);
}

/* ==========================================
   Responsive: Tablet (768px~1023px)
   ========================================== */
@media (min-width: 768px) and (max-width: 1023px) {
    .sb-hero-slide {
        aspect-ratio: 16 / 6;
    }

    .sb-hero-text-inner {
        padding: 3rem 1.25rem;
    }

    .sb-hero-text-title {
        font-size: 1.875rem;
    }

    .sb-category-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.75rem;
    }
}

/* ==========================================
   Responsive: Mobile (360px~767px)
   ========================================== */
@media (max-width: 767px) {
    .sb-hero-slide {
        aspect-ratio: 16 / 9;
    }

    .sb-hero-prev,
    .sb-hero-next {
        display: none !important;
    }

    .sb-hero-text,
    .sb-hero {
        margin-top: 0;
    }

    .sb-hero-text-inner {
        padding: 2.5rem 1rem;
    }

    .sb-hero-text-title {
        font-size: 1.5rem;
    }

    .sb-hero-text-desc {
        font-size: 0.875rem;
        margin-bottom: 1.5rem;
    }

    .sb-hero-btn {
        padding: 0.625rem 1.5rem;
        font-size: 0.875rem;
    }

    .sb-hero-text-actions {
        margin-bottom: 2rem;
    }

    .sb-hero-text-stats {
        gap: 1rem;
    }

    .sb-hero-stat strong {
        font-size: 1.1rem;
    }

    .sb-category-nav {
        padding: 1rem 0;
    }

    .sb-category-grid {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0.5rem;
        padding: 0 1rem;
        scrollbar-width: none;
    }

    .sb-category-grid::-webkit-scrollbar {
        display: none;
    }

    .sb-category-card {
        flex: 0 0 auto;
        min-width: 4.5rem;
        padding: 0.75rem 0.625rem;
    }

    .sb-category-card-icon {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 0.9375rem;
    }

    .sb-category-card-name {
        font-size: 0.6875rem;
        white-space: nowrap;
    }

    .sb-category-card-count {
        font-size: 0.625rem;
    }
}
