* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #ffffff;
    color: #121212;
    font-family: Arial, Helvetica, sans-serif;
}

body.drawer-open {
    overflow: hidden;
}

.page {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding-bottom: 96px;
}

.top {
    position: relative;
    padding: 12px 16px 10px;
    border-top: 4px solid #17458d;
    background: #ffffff;
}

.brand-logo {
    display: block;
    width: min(310px, 72vw);
    height: 32px;
    margin: 0 auto;
    object-fit: contain;
}

.cart-link {
    position: absolute;
    top: 17px;
    right: 13px;
    border: 0;
    background: transparent;
    color: #0b3478;
    font-size: 22px;
    font-weight: 900;
    cursor: pointer;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -6px;
    display: grid;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    place-items: center;
    border-radius: 10px;
    background: #e53935;
    color: #ffffff;
    font-size: 11px;
}

.count {
    padding: 15px 16px;
    background: #0b3478;
    color: #ffffff;
    text-align: center;
}

.count small {
    display: block;
    font-size: 12px;
    opacity: 0.9;
}

.timer {
    margin-top: 4px;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 3px;
}

.limit-note {
    padding: 8px 12px;
    border-bottom: 1px solid #e2e6ee;
    background: #f6f8fc;
    color: #6b7280;
    font-size: 11px;
    text-align: center;
}

.auction {
    padding: 14px 16px;
    border-bottom: 1px solid #dddddd;
}

.auction .code {
    color: #2457a7;
    font-size: 14px;
    font-weight: 700;
}

.auction p {
    margin: 5px 0;
    color: #777777;
    font-size: 13px;
}

.auction h1 {
    margin: 15px 0 2px;
    color: #0b3478;
    font-size: 20px;
}

.auction .ref {
    color: #555555;
    font-size: 12px;
}

.cats {
    position: sticky;
    top: 0;
    z-index: 4;
    display: flex;
    gap: 7px;
    padding: 10px 8px;
    overflow-x: auto;
    border-bottom: 1px solid #dddddd;
    background: #ffffff;
}

.cats a {
    padding: 9px 12px;
    border-radius: 3px;
    background: #0b3478;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.section {
    padding: 11px 10px 22px;
}

.section-title {
    margin: 0 -2px 9px;
    padding: 10px 12px;
    background: #0b3478;
    color: #ffffff;
    font-weight: 800;
}

.hero {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    background: #f3f3f3;
    scroll-snap-type: x mandatory;
}

.hero img {
    width: 100%;
    min-width: 100%;
    height: 245px;
    object-fit: cover;
    scroll-snap-align: start;
}

.meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 8px;
    border: 1px solid #dddddd;
    border-radius: 3px;
}

.meta div {
    padding: 10px 3px;
    border-right: 1px solid #dddddd;
    border-bottom: 1px solid #dddddd;
    color: #777777;
    font-size: 11px;
    text-align: center;
}

.meta div:nth-child(3n) {
    border-right: 0;
}

.meta div:nth-last-child(-n + 3) {
    border-bottom: 0;
}

.meta b {
    display: block;
    margin-top: 4px;
    color: #111111;
    font-size: 13px;
}

.meta .open {
    color: #16914d;
}

.progress-label {
    margin: 12px 0 4px;
    font-size: 12px;
    font-weight: 700;
}

.progress {
    height: 13px;
    overflow: hidden;
    border-radius: 10px;
    background: #e8e8e8;
}

.progress span {
    display: block;
    height: 100%;
    background: #1b4d9a;
}

.products {
    margin-top: 12px;
    border-top: 1px solid #dddddd;
}

.product {
    display: grid;
    grid-template-columns: 108px 1fr;
    gap: 10px;
    padding: 13px 0;
    border-bottom: 1px solid #dddddd;
}

.product img {
    width: 108px;
    height: 108px;
    border-radius: 5px;
    background: #f6f6f6;
    object-fit: contain;
}

.product h3 {
    margin: 0 0 7px;
    color: #001f5b;
    font-size: 13px;
    line-height: 1.3;
}

.price {
    margin-bottom: 8px;
    color: #0b3478;
    font-size: 19px;
    font-weight: 900;
}

.buy {
    display: inline-flex;
    padding: 10px 17px;
    border: 0;
    border-radius: 3px;
    background: #0b3478;
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.buy.added {
    background: #16894e;
}

.footer {
    padding: 30px 10px 50px;
    border-top: 3px solid #164a99;
    color: #9098ad;
    font-size: 13px;
    text-align: center;
}

.toast {
    position: fixed;
    bottom: 92px;
    left: 50%;
    z-index: 80;
    padding: 12px 18px;
    border-radius: 6px;
    background: #102f68;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    opacity: 0;
    transform: translateX(-50%) translateY(80px);
    transition: 0.25s;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.selection-bar {
    position: fixed;
    bottom: 10px;
    left: 50%;
    z-index: 30;
    display: flex;
    width: min(540px, calc(100% - 20px));
    padding: 9px 10px;
    align-items: center;
    gap: 10px;
    border: 1px solid #d8dee9;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 8px 28px rgba(0, 24, 68, 0.22);
    transform: translateX(-50%);
}

.selection-info {
    min-width: 0;
    flex: 1;
}

.selection-info small {
    display: block;
    color: #687083;
    font-size: 11px;
}

.selection-info b {
    display: block;
    overflow: hidden;
    color: #001f5b;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selection-action {
    padding: 12px 15px;
    border: 0;
    border-radius: 7px;
    background: #0b3478;
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
}

.selection-bar.empty .selection-action {
    pointer-events: none;
    opacity: 0.55;
}

.drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 89;
    visibility: hidden;
    background: rgba(4, 15, 36, 0.48);
    opacity: 0;
    transition: 0.25s;
}

.drawer-overlay.open {
    visibility: visible;
    opacity: 1;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 90;
    display: flex;
    width: min(410px, 92vw);
    height: 100dvh;
    flex-direction: column;
    background: #ffffff;
    box-shadow: -18px 0 45px rgba(0, 18, 55, 0.18);
    transform: translateX(102%);
    transition: 0.28s ease;
}

.cart-drawer.open {
    transform: translateX(0);
}

.drawer-head {
    display: flex;
    padding: 17px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e1e5ec;
}

.drawer-head h2 {
    margin: 0;
    color: #001f5b;
    font-size: 21px;
}

.drawer-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #eef2f8;
    color: #153b75;
    font-size: 22px;
    cursor: pointer;
}

.drawer-items {
    flex: 1;
    overflow-y: auto;
}

.drawer-empty {
    padding: 50px 25px;
    color: #687083;
    text-align: center;
}

.drawer-item {
    display: grid;
    grid-template-columns: 66px 1fr auto;
    gap: 10px;
    padding: 13px;
    align-items: center;
    border-bottom: 1px solid #e5e8ee;
}

.drawer-item img {
    width: 66px;
    height: 66px;
    border-radius: 7px;
    background: #f2f4f7;
    object-fit: contain;
}

.drawer-name {
    color: #102a56;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
}

.drawer-qty {
    display: inline-flex;
    margin-top: 7px;
    overflow: hidden;
    border: 1px solid #d6dce6;
    border-radius: 7px;
}

.drawer-qty button,
.drawer-qty span {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 0;
    background: #ffffff;
}

.drawer-qty button {
    cursor: pointer;
}

.drawer-remove {
    display: block;
    padding: 7px 0 0;
    border: 0;
    background: transparent;
    color: #b42318;
    font-size: 11px;
    cursor: pointer;
}

.drawer-price {
    color: #001f5b;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.drawer-foot {
    padding: 14px 16px 18px;
    border-top: 1px solid #e1e5ec;
    background: #ffffff;
}

.drawer-total {
    display: flex;
    margin-bottom: 11px;
    justify-content: space-between;
    color: #001f5b;
    font-size: 18px;
    font-weight: 900;
}

.drawer-limit {
    margin-bottom: 11px;
    padding: 9px 10px;
    border-radius: 7px;
    background: #f4f7fb;
    color: #617086;
    font-size: 11px;
    line-height: 1.4;
}

.drawer-checkout {
    display: block;
    width: 100%;
    padding: 15px;
    border: 0;
    border-radius: 7px;
    background: #0b3478;
    color: #ffffff;
    font-size: 15px;
    font-weight: 900;
    text-align: center;
    text-decoration: none;
}

.drawer-checkout.disabled {
    pointer-events: none;
    opacity: 0.45;
}

@media (min-width: 700px) {
    .page {
        max-width: 760px;
    }

    .product {
        grid-template-columns: 140px 1fr;
    }

    .product img {
        width: 140px;
        height: 140px;
    }

    .hero img {
        height: 360px;
    }
}
