.header {
    width: 100%;
    top: 0;
    left: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(0, 0, 0, 0.8);
}

.shop-nav {
    position: relative;
    height: 3.5rem;
    display: grid !important;
    align-items: center;
    box-shadow: none;
    width: 100%;
    padding: 0 !important;
    margin-bottom: 0 !important;
    flex-wrap: nowrap !important;
}

.nav-button {
    justify-self: start;
    z-index: 2;
}

.nav-logo {
    justify-self: center;
    font-size: 1rem;
    color: rgba(0, 0, 0, 0.8);
    font-family: var(--font-primary);
    text-decoration: none;
    line-height: 0;
    max-width: 100%;
}

.nav-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    z-index: 2;
}

.nav-logo img {
    width: 155px;
    max-width: calc(100vw - 7rem);
    height: auto;
    border-radius: 0.6rem;
    display: block;
}

.nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.25rem;
    cursor: pointer;
    color: #000000;
}

.nav-toggle i {
    font-size: 26px;
    font-weight: 600;
}

.nav-menu-search {
    display: none;
}

@media screen and (max-width: 767px) {
    .header {
        position: relative;
        overflow: visible;
        border-bottom: none;
    }

    .header:has(.header-search:focus-within) {
        /* 给下方搜索条留出独立一行，不与顶栏/内容串行 */
        padding-bottom: 3.5rem;
    }

    .shop-nav {
        grid-template-columns: 2.75rem 1fr auto;
        position: static;
        height: 3.5rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.8);
    }

    .nav-button {
        grid-column: 1;
        grid-row: 1;
    }

    .nav-logo {
        grid-column: 2;
        grid-row: 1;
    }

    .nav-actions {
        grid-column: 3;
        grid-row: 1;
        position: static;
    }

    .nav-menu {
        position: fixed;
        background-color: #fff7ff;
        width: 100%;
        height: 100%;
        top: 0;
        left: -100%;
        box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
        z-index: 100;
        padding: 4rem 1.5rem 0;
        transition: 0.3s;
        grid-column: unset;
    }

    .nav-menu-search {
        display: flex;
        align-items: center;
        width: 100%;
        max-width: 100%;
        margin: 0 0 1.75rem;
        border: 2px solid rgba(0, 0, 0, 0.8);
        border-radius: 999px;
        overflow: hidden;
        background: #fff;
    }

    .nav-menu-search__input {
        flex: 1;
        border: none;
        outline: none;
        background: transparent;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        min-width: 0;
    }

    .nav-menu-search__btn {
        flex-shrink: 0;
        width: 2.75rem;
        height: 2.75rem;
        border: none;
        background: #000;
        color: #fff;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    .nav-menu-search__btn:hover {
        opacity: 0.85;
    }

    /* 默认：仅图标 */
    .header-search {
        height: 2.75rem;
        width: 2.75rem;
        max-width: 2.75rem;
        overflow: hidden;
    }

    /* 展开：固定在顶栏下方第二行，居中，不压分割线 */
    .header-search:focus-within {
        position: absolute;
        left: 50%;
        right: auto;
        top: 3.5rem;
        transform: translateX(-50%);
        z-index: 40;
        width: calc(100% - 1.5rem);
        max-width: calc(100vw - 1.5rem);
        height: 2.85rem;
        margin: 0.4rem 0 0;
        flex-direction: row;
        border-color: rgba(0, 0, 0, 0.75);
        background: #fff;
        overflow: visible;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .header-search:focus-within .header-search__input {
        order: 2;
        width: auto;
        min-width: 0;
        flex: 1 1 auto;
        padding: 0 0.85rem 0 0.35rem;
        font-size: 0.95rem;
        opacity: 1;
    }

    .header-search:focus-within .header-search__btn {
        display: none;
    }

    .header-search:focus-within .header-search__submit {
        order: 1;
        display: inline-flex;
    }

    .header-search__btn,
    .header-search__submit {
        width: 2.75rem;
        height: 2.75rem;
    }

    .nav-logo img {
        max-width: calc(100vw - 9rem);
    }

    .nav-button {
        margin-top: 0;
    }
}

.nav-close {
    font-size: 1.5rem;
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    cursor: pointer;
}

.nav-list {
    display: flex;
    flex-direction: column;
    row-gap: 1.5rem;
    list-style: none;
    margin-bottom: 0;
    padding-left: 0;
}

.nav-link {
    color: #000000;
    font-weight: 500;
    transition: 0.3s;
    font-size: 0.9rem;
    letter-spacing: 0.1rem;
    font-family: var(--font-secondary);
    font-weight: 400;
    text-transform: uppercase;
}

.nav-link:hover {
    color: #000000b9;
}

.show-menu {
    top: 0;
    right: 0;
    left: 0;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-actions--empty {
    visibility: hidden;
    pointer-events: none;
}

.header-search {
    position: relative;
    display: flex;
    align-items: center;
    flex-direction: row-reverse;
    border: 1.5px solid transparent;
    border-radius: 999px;
    background: transparent;
    height: 2.75rem;
    width: 2.75rem;
    max-width: 2.75rem;
    overflow: hidden;
    transition: width 0.25s ease, max-width 0.25s ease, border-color 0.2s ease, background 0.2s ease;
}

.header-search:focus-within {
    width: 14rem;
    max-width: 14rem;
    border-color: rgba(0, 0, 0, 0.75);
    background: #fff;
    overflow: visible;
}

.header-search__input {
    border: none;
    outline: none;
    background: transparent;
    padding: 0;
    font-size: 0.9rem;
    width: 0;
    min-width: 0;
    flex: 1 1 auto;
    opacity: 0;
    color: #000;
    transition: width 0.25s ease, padding 0.25s ease, opacity 0.2s ease;
}

.header-search:focus-within .header-search__input {
    width: auto;
    min-width: 8rem;
    padding: 0 0.5rem 0 0.85rem;
    opacity: 1;
}

.header-search__btn,
.header-search__submit {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    border: none;
    background: transparent;
    color: #000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    margin: 0;
}

.header-search__submit {
    display: none;
}

.header-search:focus-within .header-search__btn {
    display: none;
}

.header-search:focus-within .header-search__submit {
    display: inline-flex;
}

.header-search__btn:hover,
.header-search__submit:hover {
    opacity: 0.75;
}

.header-search__btn .bi-search,
.header-search__submit .bi-search {
    font-size: 1.25rem;
    pointer-events: none;
}

.nav-telegram-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    color: #000;
    line-height: 1;
}

.nav-telegram-link:hover {
    opacity: 0.75;
    color: #000;
}

.nav-telegram-link .bi-telegram {
    font-size: 26px;
}

.container-medium {
    max-width: 968px;
    margin-left: 1.5rem;
    margin-right: 1.5rem;
}

@media screen and (min-width: 768px) {
    /* Base */

    .container-medium {
        margin-left: auto;
        margin-right: auto;
    }

    /* Header */

    .header .shop-nav.container {
        height: 4rem;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        align-items: center;
        width: 100%;
    }

    .header .shop-nav .nav-button {
        display: none !important;
    }

    .header .shop-nav .nav-close {
        display: none;
    }

    .header .shop-nav .nav-logo {
        position: static;
        transform: none;
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
        align-self: center;
    }

    .header .shop-nav .nav-menu {
        position: static;
        transform: none;
        grid-column: 2;
        grid-row: 1;
        justify-self: center;
        align-self: center;
        width: auto;
    }

    .header .shop-nav .nav-list {
        flex-direction: row;
        column-gap: 3rem;
        justify-content: center;
    }

    .header .shop-nav .nav-actions {
        position: static;
        transform: none;
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
        align-self: center;
    }

    .header .shop-nav .header-search:focus-within {
        width: 14rem;
        max-width: 14rem;
    }

    .header .shop-nav .header-search:focus-within .header-search__input {
        min-width: 9rem;
    }
}

.search {
    --easing: cubic-bezier(0.4, 0, 0.2, 1);
    --font-size: 1rem;
    --color: var(--color-foreground);
    --color-highlight: rgb(73, 72, 72);
    --transition-time-icon: 0.2s;
    --transition-time-input: 0.3s 0.25s;
    border-radius: 999px;
    border: 2px solid transparent;
    display: flex;
    transition: border-color var(--transition-time-icon) linear,
        padding var(--transition-time-input) var(--easing);
}
.search:not(:focus-within) {
    --transition-time-input: 0.2s 0s;
}
@media (prefers-reduced-motion: reduce) {
    .search {
        --transition-time-icon: 0s !important;
        --transition-time-input: 0s !important;
    }
}
.search__input {
    background: transparent;
    border: none;
    color: var(--color-highlight);
    font-size: var(--font-size);
    opacity: 0;
    outline: none;
    padding: 0;
    transition: width var(--transition-time-input) var(--easing),
        padding var(--transition-time-input) var(--easing),
        opacity var(--transition-time-input) linear;
    width: 0;
}
.search__input::-moz-placeholder {
    color: var(--color);
    opacity: 0.75;
}
.search__input:-ms-input-placeholder {
    color: var(--color);
    opacity: 0.75;
}
.search__input::placeholder {
    color: var(--color);
    opacity: 0.75;
}
.search__icon-container {
    height: 2rem;
    position: relative;
    width: 2rem;
}

.search__icon-container:hover {
    opacity: 0.8;
}

.search__label,
.search__submit {
    color: var(--color);
    cursor: pointer;
    display: block;
    height: 100%;
    padding: 0;
    position: absolute;
    width: 100%;
}
.search__label:hover,
.search__label:focus,
.search__label:active,
.search__submit:hover,
.search__submit:focus,
.search__submit:active {
    color: var(--color-highlight);
}
.search__label {
    transition: transform var(--transition-time-icon) var(--easing), color 0.1s;
}
.search__submit {
    background: none;
    border-radius: 50%;
    border: none;
    box-shadow: 0 0 0 4px inset transparent;
    display: none;
    outline: none;
    transition: color 0.1s, box-shadow 0.1s;
}
.search__submit svg {
    transform: scale(0.5);
}
.search__submit:focus {
    box-shadow: 0 0 0 4px inset var(--color-highlight);
}
.search:focus-within {
    border-color: var(--color);
}
.search:focus-within .search__input {
    opacity: 1;
    padding: 0 2rem 0 2rem;
    width: calc(var(--font-size) * 20);
}

.search:focus-within .nav-menu {
    display: none !important;
}

.search:focus-within .search__label {
    transform: scale(0.5);
}
.search:focus-within .search__submit {
    -webkit-animation: unhide var(--transition-time-icon) steps(1, end);
    animation: unhide var(--transition-time-icon) steps(1, end);
    display: block;
}

.search.search--expanded {
    border-color: rgba(0, 0, 0, 0.8);
    width: min(22rem, 100%);
    max-width: 100%;
}

.search.search--expanded .search__input {
    opacity: 1 !important;
    width: auto !important;
    flex: 1 1 auto !important;
    min-width: 10rem;
    padding: 0 1rem 0 2rem !important;
    transition: none !important;
}

.search.search--expanded .search__label {
    transform: scale(0.5);
}

.search.search--expanded .search__submit {
    display: block !important;
}

@-webkit-keyframes unhide {
    from {
        height: 0;
        opacity: 0;
    }
    to {
        height: auto;
        opacity: 1;
    }
}

@keyframes unhide {
    from {
        height: 0;
        opacity: 0;
    }
    to {
        height: auto;
        opacity: 1;
    }
}

.sub-footer {
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.8);
}

.short-about h1 {
    font-family: var(--font-primary);
    color: #000000c2;
    font-size: 36px;
    font-weight: 400;
}

.short-about p {
    font-family: var(--font-secondary);
    font-size: 14px;
    color: #000000ab;
}

.sub-footer h6 {
    color: #000000d0;
}

.sub-footer p {
    color: #000000b1;
}
footer {
    margin-top: 30px;
    padding-bottom: 1px;
    color: rgba(0, 0, 0, 0.823);
    text-align: center;
}

.card {
    border: 2px solid transparent;
}

.card:hover {
    border: 2px solid #435ebe;
    cursor: pointer;
}

@media screen and (max-width: 576px) {
    .card-produk .card-body {
        padding: 8px;
    }

    .card-produk .card-body h5 {
        font-size: 16px;
    }

    .card-produk .card-body p {
        font-size: 12px;
    }

    .search:focus-within .search__input {
        opacity: 1;
        padding: 0 2rem 0 2rem;
        width: calc(var(--font-size) * 14);
    }

    .search.search--expanded {
        width: min(18rem, calc(100vw - 2rem));
    }

    .search.search--expanded .search__input {
        min-width: 8rem;
        padding: 0 0.75rem 0 1.5rem !important;
    }

    .py-custom {
        padding-top: 60px;
        padding-bottom: 20px;
    }

    .swal2-header {
        padding: 0 0.6em !important;
    }
    .swal2-title {
        font-size: 1.3rem !important;
    }
}

.cart {
    position: relative;
    display: block;
    width: 28px;
    height: auto;
    margin-left: 4px;
    margin-top: -8px;
}

.cart:hover {
    opacity: 0.8;
}

.cart .bi-cart2 {
    position: relative;
    top: 8px;
    z-index: 1;
    font-size: 24px;
    color: #000;
}
.cart .count {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    font-size: 11px;
    border-radius: 32px;
    background: #d60b28;
    padding: 4px;

    display: block;
    text-align: center;
    color: white;
}

.container {
    padding-left: var(--bs-gutter-x, 0.75rem) !important;
}
