/*
 * Frontend Base Layout — White Label Ecommerce Platform
 * Layout structure only; semua warna dari theme CSS variables.
 */

.site-header {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
}

.site-header .navbar-brand {
    font-weight: 700;
    color: var(--text-color);
}

.site-header .nav-link {
    color: var(--text-color);
}

.site-header .nav-link:hover,
.site-header .nav-link.active {
    color: var(--primary-color);
}

.hero-section {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--primary-color) 8%, var(--background-color)),
        var(--background-color)
    );
    padding: 4.5rem 0;
}

.hero-section h1 {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hero-section .lead {
    color: var(--text-muted-color);
}

.feature-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-base);
    padding: 1.5rem;
    height: 100%;
}

.feature-card i {
    font-size: 1.75rem;
    color: var(--primary-color);
}

.site-footer {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
    color: var(--text-muted-color);
    font-size: 0.9rem;
}

@media (max-width: 575.98px) {
    .hero-section {
        padding: 3rem 0;
    }
}

/* Page header (breadcrumb + judul halaman publik) */
.page-header-section {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
}

.page-header-section .breadcrumb-item a {
    text-decoration: none;
}

/* Baris kategori beranda (chip scroll horizontal ala aplikasi mobile) */
.category-strip {
    display: flex;
    gap: 0.85rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.category-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    min-width: 76px;
    text-decoration: none;
    color: var(--text-color);
    flex-shrink: 0;
}

.category-chip-media {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: color-mix(in srgb, var(--primary-color) 10%, var(--surface-color));
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    font-size: 1.4rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.category-chip-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-chip:hover .category-chip-media {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px color-mix(in srgb, var(--primary-color) 22%, transparent);
}

.category-chip-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
    max-width: 84px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Kartu kategori (halaman /kategori) */
.category-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-base);
    overflow: hidden;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-base), 0 8px 20px color-mix(in srgb, var(--primary-color) 14%, transparent);
    color: var(--text-color);
}

.category-card-media {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: color-mix(in srgb, var(--primary-color) 8%, var(--background-color));
    color: var(--primary-color);
    font-size: 2rem;
    overflow: hidden;
}

.category-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-card-body {
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.category-card-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.category-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted-color);
}

@media (max-width: 575.98px) {
    .category-card-media {
        height: 96px;
    }
}

/* ============================================================
 * Mobile App Shell
 * Aktif hanya di bawah breakpoint lg (< 992px).
 * Desktop tetap menggunakan navbar standar.
 * ============================================================ */

/* Header ala aplikasi mobile */
.mobile-app-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0.65rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.mobile-app-header .app-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-color);
    text-decoration: none;
    min-width: 0;
}

.mobile-app-header .app-brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-app-header .app-brand i {
    color: var(--primary-color);
    font-size: 1.3rem;
}

.mobile-app-header .app-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.mobile-app-header .app-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: var(--text-color);
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    text-decoration: none;
}

.mobile-app-header .app-icon-btn:active {
    background-color: color-mix(in srgb, var(--primary-color) 12%, var(--background-color));
}

/* Bottom Navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.06);
}

.mobile-bottom-nav .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    padding: 0.25rem 0;
    font-size: 0.68rem;
    color: var(--text-muted-color);
    text-decoration: none;
    min-width: 0;
}

.mobile-bottom-nav .bottom-nav-item i {
    font-size: 1.25rem;
    line-height: 1;
}

.mobile-bottom-nav .bottom-nav-item.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* Tombol tengah (Beranda) menonjol seperti FAB */
.mobile-bottom-nav .bottom-nav-item.nav-fab {
    position: relative;
    overflow: visible;
}

.mobile-bottom-nav .bottom-nav-item.nav-fab .fab-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--text-inverse-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-top: -26px;
    border: 4px solid var(--background-color);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--primary-color) 40%, transparent);
}

.mobile-bottom-nav .bottom-nav-item.nav-fab span {
    color: var(--primary-color);
    font-weight: 600;
}

/* Ruang bawah agar konten tidak tertutup bottom nav */
@media (max-width: 991.98px) {
    body.has-bottom-nav {
        padding-bottom: 76px;
    }

    body.has-bottom-nav .site-footer {
        margin-bottom: 0;
    }
}

@media (min-width: 992px) {
    .mobile-app-header,
    .mobile-bottom-nav {
        display: none;
    }
}

/* Kartu produk */
.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-base);
    overflow: hidden;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-base), 0 8px 20px color-mix(in srgb, var(--primary-color) 14%, transparent);
    color: var(--text-color);
}

.product-card-media {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: color-mix(in srgb, var(--primary-color) 6%, var(--background-color));
    color: var(--primary-color);
    font-size: 2rem;
    overflow: hidden;
}

.product-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card-badge {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    background-color: var(--danger-color);
    color: var(--text-inverse-color);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
}

.product-card-body {
    padding: 0.8rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex-grow: 1;
}

.product-card-category {
    font-size: 0.72rem;
    color: var(--text-muted-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.product-card-title {
    font-weight: 600;
    font-size: 0.92rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-price {
    margin-top: auto;
    padding-top: 0.35rem;
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.product-card-price .price-now {
    font-weight: 800;
    color: var(--primary-color);
}

.product-card-price .price-old {
    font-size: 0.78rem;
    color: var(--text-muted-color);
    text-decoration: line-through;
}

/* Search bar mobile ala aplikasi */
.mobile-search-bar {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 1rem 0.75rem;
}

.mobile-search-bar .form-control {
    border-radius: 999px;
    background-color: var(--background-color);
}

/* Galeri detail produk */
.product-gallery-main {
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-base);
    overflow: hidden;
    background-color: color-mix(in srgb, var(--primary-color) 6%, var(--background-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 3rem;
}

.product-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-gallery-thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.product-gallery-thumbs button {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
    border-radius: calc(var(--radius-base) * 0.75);
    overflow: hidden;
    padding: 0;
    background: none;
}

.product-gallery-thumbs button.active {
    border-color: var(--primary-color);
}

.product-gallery-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Banner */
.banner-slide {
    position: relative;
    border-radius: var(--radius-base);
    overflow: hidden;
    background-color: color-mix(in srgb, var(--primary-color) 8%, var(--background-color));
}

.banner-slide picture,
.banner-slide img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 1;
    object-fit: cover;
}

.banner-slide-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.55) 0%, rgba(15, 23, 42, 0.15) 55%, transparent 100%);
}

.banner-slide-content {
    padding: 1rem 1.5rem;
    max-width: 60%;
    color: #ffffff;
}

.banner-slide-title {
    font-size: clamp(1rem, 3.5vw, 1.6rem);
    font-weight: 800;
    margin-bottom: 0.25rem;
    color: #ffffff;
}

.banner-slide-subtitle {
    font-size: clamp(0.75rem, 2.2vw, 0.95rem);
    margin-bottom: 0.6rem;
    color: rgba(255, 255, 255, 0.85);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 767.98px) {
    .banner-slide picture,
    .banner-slide img {
        aspect-ratio: 2 / 1;
    }

    .banner-slide-content {
        max-width: 75%;
        padding: 0.75rem 1rem;
    }
}

.banner-top-section .carousel-indicators {
    margin-bottom: 0.4rem;
}

.banner-top-section .carousel-indicators [data-bs-target] {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Kartu artikel blog */
.blog-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-base);
    overflow: hidden;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-base), 0 8px 20px color-mix(in srgb, var(--primary-color) 14%, transparent);
    color: var(--text-color);
}

.blog-card-media {
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: color-mix(in srgb, var(--primary-color) 6%, var(--background-color));
    color: var(--primary-color);
    font-size: 2rem;
    overflow: hidden;
}

.blog-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-card-body {
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex-grow: 1;
}

.blog-card-meta {
    font-size: 0.72rem;
    color: var(--text-muted-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.blog-card-title {
    font-weight: 700;
    font-size: 0.98rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-excerpt {
    font-size: 0.83rem;
    color: var(--text-muted-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-more {
    margin-top: auto;
    padding-top: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Isi artikel */
.blog-content {
    white-space: pre-line;
    line-height: 1.8;
    font-size: 1.02rem;
}

/* Landing Page */
.lp-hero {
    background: linear-gradient(
        150deg,
        color-mix(in srgb, var(--primary-color) 10%, var(--background-color)),
        var(--background-color)
    );
}

.lp-body {
    white-space: pre-line;
    line-height: 1.8;
    font-size: 1.02rem;
}

.lp-lead-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-base);
    box-shadow: var(--shadow-base);
    padding: 1.75rem;
}

/* Tombol + pada kartu produk (checkout cepat, ala referensi mobile) */
.product-card-buy {
    position: absolute;
    right: 0.6rem;
    bottom: 0.6rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--text-inverse-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 3px 8px color-mix(in srgb, var(--primary-color) 40%, transparent);
    transition: transform 0.12s ease;
}

.product-card-buy:hover {
    transform: scale(1.1);
}

/* Checkout */
.checkout-form-card,
.checkout-summary {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-base);
    box-shadow: var(--shadow-base);
    padding: 1.5rem;
}

.checkout-thumb {
    width: 72px;
    height: 72px;
    border-radius: calc(var(--radius-base) * 0.75);
    overflow: hidden;
    background-color: color-mix(in srgb, var(--primary-color) 6%, var(--background-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.6rem;
    flex-shrink: 0;
}

.checkout-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
