/*
 * Mobile layout, following the mobile frames of the Figma design (375px wide).
 * Loaded after style.css on the storefront layouts; everything here applies below 768px only,
 * so the desktop layout is unchanged.
 */
@media (max-width: 767.98px) {
    /* ---------- shared ---------- */

    /* bars fixed to the bottom of the screen (product detail, cart, checkout) */
    .mobile-sticky-bar,
    .pd-actions {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1030;
        padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
        background: #fff;
        border-top: 1px solid var(--stroke-primary);
        box-shadow: 0 -6px 16px rgba(3, 7, 18, 0.04);
    }

    .mobile-sticky-bar .btn,
    .pd-actions .btn {
        padding: 0.75rem 1rem;
        font-size: 16px;
    }

    /* room so the page's last content isn't hidden behind a bottom bar,
       and the floating WhatsApp button sits above it */
    body:has(.mobile-sticky-bar, .pd-actions) {
        padding-bottom: 88px;
    }

    body:has(.mobile-sticky-bar, .pd-actions) .btn-float {
        bottom: 104px;
    }

    body:has(.mobile-sticky-bar .mb-2) {
        padding-bottom: 124px;
    }

    body:has(.mobile-sticky-bar .mb-2) .btn-float {
        bottom: 140px;
    }

    .card {
        border-radius: 16px;
    }

    .card > .list-group:first-child,
    .card > .list-group:last-child {
        border-radius: 16px;
    }

    /* ---------- navbar ---------- */

    .navbar-toggler {
        border: 0;
        padding: 0.25rem;
        box-shadow: none !important;
    }

    .navbar-toggler-icon {
        width: 1.75rem;
        height: 1.75rem;
    }

    /* ---------- home ---------- */

    /* hero slider: shorter than the screen like the Figma mobile frame, centred text,
       controls as "‹ • • • ›" under it */
    .home-bg {
        height: 480px;
        min-height: 0;
    }

    .hero-slide-content {
        padding-bottom: 72px;
        text-align: center;
    }

    .hero-swiper:not(:has(.hero-controls)) .hero-slide-content {
        padding-bottom: 40px;
    }

    .hero-title {
        font-size: 24px;
        line-height: 140%;
        margin: 0 auto 0.75rem;
    }

    /* the admin's line breaks are for the wide desktop title only */
    .hero-title br {
        display: none;
    }

    .hero-subtitle {
        font-size: 14px;
        margin: 0 auto;
    }

    .hero-controls {
        bottom: 16px;
        justify-content: center;
    }

    .hero-pagination {
        order: 2;
        gap: 6px;
        margin: 0 0.5rem;
    }

    .hero-pagination .swiper-pagination-bullet {
        width: 7px;
        height: 7px;
    }

    .hero-prev {
        order: 1;
    }

    .hero-next {
        order: 3;
    }

    .hero-nav {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    /* instagram feed: full-width handle button, tight 3-column grid */
    .instagram-section {
        padding: 3rem 0;
    }

    .instagram-title {
        font-size: 20px;
        margin-bottom: 0.75rem;
    }

    .instagram-subtitle {
        font-size: 14px;
    }

    .instagram-handle {
        display: flex;
        justify-content: center;
        width: 100%;
        padding: 0.625rem 1rem;
    }

    .instagram-grid {
        gap: 0.5rem;
        margin-top: 1.25rem;
    }

    .instagram-item {
        border-radius: 4px;
    }

    .instagram-type {
        top: 6px;
        right: 6px;
        font-size: 12px;
    }

    .main-content {
        margin-top: 2rem;
        padding-top: 2rem;
        margin-bottom: 3rem;
    }

    .main-content-body h5 {
        font-weight: 600;
        line-height: 140%;
    }

    .main-content .btn-outline-primary-enable {
        padding: 0.75rem 2rem;
        font-size: 16px;
    }

    /* product cards (home, /products, "Produk Lainnya"): fluid 2-column grid */
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.5rem 1rem;
    }

    .card-product {
        max-width: none;
        border: 0;
    }

    .card-product img,
    .card-product .card-img {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        border-radius: 8px;
    }

    /* category line (not the struck-through price, which is a <small> inside the price) */
    .card-product .card-body-news > small {
        display: block;
        margin-top: 0.25rem;
        font-size: 14px;
        color: var(--typography-tertiary);
    }

    .card-product .card-title,
    .card-product .card-title.fw-bold {
        margin: 0.25rem 0;
        font-size: 14px;
        font-weight: 400 !important;
        color: var(--typography-secondary);
    }

    .card-product .card-text {
        font-size: 16px;
        font-weight: 600;
    }

    /* partner logos */
    .brand-content {
        padding: 2.5rem 1rem;
    }

    .brand-content h6 {
        font-size: 18px;
        font-weight: 600;
        line-height: 140%;
    }

    .brand-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.75rem 1rem;
        justify-items: center;
        margin-top: 1.75rem !important;
    }

    .brand-image {
        width: 100%;
        max-width: 88px;
        max-height: 48px;
        object-fit: contain;
    }

    /* ---------- footer ---------- */

    /* logo + text side by side (the outer footer row stays stacked) */
    .footer .row .row {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
    }

    .footer .row .row > [class*="col-"]:first-child {
        flex: 0 0 auto;
        width: auto;
        margin-bottom: 0 !important;
    }

    .footer .row .row > [class*="col-"]:last-child {
        flex: 1 1 auto;
        width: auto;
        margin-bottom: 0 !important;
    }

    .footer .row .row .pb-2,
    .footer .row .row .pt-3 {
        padding: 0.5rem 0 !important;
    }

    .footer .logo-footer-size {
        height: 56px;
    }

    .footer .row .row p {
        margin-bottom: 0.125rem;
    }

    .footer a:not(.btn) {
        color: var(--typography-secondary);
        font-weight: 400 !important;
        margin-bottom: 0.5rem;
    }

    .footer .footer-body p.fw-semibold {
        margin-bottom: 0.75rem;
    }

    /* ---------- product detail ---------- */

    .card-size {
        width: 100%;
    }

    /* the info column is sticky on desktop only. A sticky box is its own stacking layer, which
       trapped the fixed .pd-actions bar inside it below the gallery (Swiper uses z-index 1),
       so product images scrolled over the bar. */
    .pd-info .sticky {
        position: static;
    }

    .product-gallery .mySwiper2,
    .product-gallery .mySwiper2 .swiper-slide {
        border-radius: 8px;
    }

    .product-gallery .thumbSwiper {
        margin-top: 0.75rem !important;
    }

    .product-gallery .thumbSwiper .swiper-slide {
        border-radius: 6px;
    }

    .pd-info h6 {
        font-size: 18px;
        font-weight: 400;
        color: var(--typography-secondary);
        margin-bottom: 0.25rem;
    }

    .pd-info h4 {
        font-size: 24px;
    }

    .pd-info .my-4 {
        margin: 1rem 0 !important;
    }

    .pd-details h4 {
        font-size: 20px;
    }

    .pd-actions {
        display: flex;
        gap: 0.75rem;
    }

    .pd-actions form {
        flex: 1;
    }

    .pd-actions .btn-share {
        order: -1;
        flex: 1;
        margin-top: 0 !important;
        border-color: var(--stroke-secondary);
        color: var(--typography-primary);
    }

    .pd-actions .btn-share i {
        color: var(--icon-tertiary);
    }

    .btn-check-ongkir {
        border: 0;
        padding: 0.25rem 0.5rem;
        color: var(--icon-tertiary);
    }

    .size-label {
        font-size: 14px;
        color: var(--typography-secondary);
        border-bottom: 0;
    }

    .size-value {
        font-weight: 600;
    }

    /* ---------- cart ---------- */

    .card-striped {
        padding: 3rem 1.5rem;
    }

    .card-striped .icon-size {
        width: 96px;
        height: auto;
        margin-bottom: 1rem;
    }

    .cart-item-img {
        width: 72px;
    }

    .cart-item-name {
        font-size: 16px;
    }

    .cart-item-body h5 {
        font-size: 16px;
    }

    .cart-item-footer {
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px dashed var(--stroke-primary);
        align-items: center;
    }

    .cart-item-footer .quantity-selector {
        height: 2.25rem;
        width: 6.25rem;
    }

    .cart-item-footer h4 {
        font-size: 18px;
    }

    .cart-item-footer .text-end {
        margin-left: auto !important;
        text-align: right !important;
    }

    /* ---------- checkout ---------- */

    .mobile-sticky-bar--md-static {
        margin-bottom: 0;
    }

    /* ---------- profile ---------- */

    .profile-tabs .nav-link {
        font-size: 16px;
    }

    .status {
        white-space: nowrap;
        font-size: 12px;
    }

    /* date filter shows only a square calendar button next to the search field */
    .date-filter {
        width: 50px;
        height: 50px;
        padding: 0;
        border-radius: 12px;
        justify-content: center;
    }

    .date-filter input[type="date"] {
        width: 48px;
        min-width: 0;
        height: 48px;
        padding: 0;
        color: transparent;
        background: transparent;
    }

    .date-filter input[type="date"]::-webkit-calendar-picker-indicator {
        margin: 0 auto;
        cursor: pointer;
    }

    .order-date {
        font-size: 13px;
        white-space: nowrap;
    }

    /* order details open as a bottom sheet */
    .modal-sheet .modal-dialog {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
        margin: 0;
        max-height: 90vh;
    }

    .modal-sheet .modal-content {
        border: 0;
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-sheet.fade .modal-dialog {
        transform: translateY(100%);
    }

    .modal-sheet.show .modal-dialog {
        transform: none;
    }

    /* ---------- login / register / forgot password ---------- */

    .login-bg {
        align-items: flex-start;
        padding: 2.5rem 0 2rem;
        background: #fff;
    }

    .login-bg > .card {
        width: 100% !important;
        border: 0;
        box-shadow: none;
    }

    .login-bg h3 {
        font-size: 20px;
        font-weight: 600;
    }

    .login-bg .form-control {
        min-height: 48px;
        border-radius: 12px;
    }
}
