:root {
    --shopee-orange: #f35a2a;
    --shopee-teal: #28b5a7;
    --text-strong: #222222;
    --text-soft: #8f8f8f;
    --line: #ededed;
    --surface: #ffffff;
    --chrome: rgba(76, 76, 76, 0.42);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background: #f4f4f4;
}

body {
    min-height: 100vh;
    background: #f4f4f4;
    color: var(--text-strong);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

body.purchase-modal-open {
    overflow: hidden;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
    background: none;
}

img,
svg {
    display: block;
}

.phone-screen {
    width: 100%;
    max-width: 768px;
    margin: 0 auto;
    background: var(--surface);
    padding-bottom: 138px;
}

.hero-gallery {
    position: relative;
    padding: 0 8px 0;
}

.gallery-actions {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.circle-button-group {
    display: flex;
    gap: 8px;
}

.circle-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--chrome);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.circle-button svg {
    width: 22px;
    height: 22px;
    stroke: #ffffff;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gallery-grid {
    display: block;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1 / 0.76;
    overflow: hidden;
    background: #fafafa;
}

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

.gallery-item.main {
    aspect-ratio: auto;
}

.gallery-item.main img {
    height: auto;
    object-fit: contain;
}

.product-summary {
    padding: 14px 12px 10px;
    background: var(--surface);
}

.variant-strip {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.variant-thumb {
    width: 82px;
    height: 56px;
    border-radius: 4px;
    border: 1px solid #d8d8d8;
    overflow: hidden;
    flex: 0 0 auto;
    padding: 0;
    background: #ffffff;
}

.variant-thumb.active {
    border: 2px solid var(--shopee-orange);
}

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

.flash-offer-banner {
    min-height: 42px;
    margin: 0 -12px 12px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    overflow: hidden;
    background: #ff4b2b;
    color: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
    white-space: nowrap;
}

.flash-offer-brand {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 4px;
    font-size: 12px;
    line-height: 1;
    letter-spacing: 0;
}

.flash-offer-prefix {
    font-weight: 400;
}

.flash-offer-brand strong {
    font-size: 13px;
    font-style: italic;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0;
}

.flash-offer-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.flash-offer-icon path,
.flash-offer-icon circle {
    fill: none;
    stroke: #ffffff;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.flash-offer-icon circle {
    fill: #ffffff;
}

.flash-offer-icon text {
    fill: #ff4b2b;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 22px;
    font-weight: 900;
}

.flash-offer-countdown {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    font-size: 10px;
    line-height: 1;
    letter-spacing: 0;
}

.flash-offer-countdown > span {
    font-weight: 400;
}

.flash-offer-countdown time {
    display: flex;
    align-items: center;
    gap: 3px;
}

.flash-offer-countdown time span {
    min-width: 22px;
    height: 24px;
    padding: 0 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: #050505;
    color: #ffffff;
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
}

.flash-offer-countdown b {
    color: #050505;
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
}

.product-trust-badges {
    margin: 12px 0 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
    border-radius: 6px;
    background: #f5f6f8;
}

.product-trust-badge {
    min-height: 48px;
    padding: 7px 8px;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    color: #243047;
}

.product-trust-badge + .product-trust-badge {
    border-left: 1px solid #e2e4e8;
}

.product-trust-badge svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--shopee-orange);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.product-trust-badge:first-child svg {
    fill: #ffbf1d;
    stroke: #ffbf1d;
}

.product-trust-badge span {
    min-width: 0;
    color: #6d7482;
    font-size: 10px;
    line-height: 1.15;
}

.product-trust-badge strong {
    display: block;
    color: #222222;
    font-size: 12px;
    font-weight: 700;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.price-block {
    min-width: 0;
}

.main-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    flex-wrap: wrap;
}

.currency,
.price-value {
    color: var(--shopee-orange);
    letter-spacing: -0.04em;
}

.currency {
    font-size: 18px;
    font-weight: 500;
}

.price-value {
    font-size: 26px;
    line-height: 0.95;
    font-weight: 500;
}

.old-price {
    color: #a7a7a7;
    font-size: 15px;
    text-decoration: line-through;
    margin-left: 4px;
    letter-spacing: 0;
}

.discount-badge {
    margin-left: 5px;
    padding: 3px 6px;
    border-radius: 3px;
    background: #fff0f0;
    color: var(--shopee-orange);
    font-size: 15px;
    line-height: 1;
    font-weight: 500;
}

.installment-hint {
    margin-top: 5px;
    font-size: 14px;
    color: #2e2e2e;
}

.quantity-selector {
    margin: 0;
    padding: 10px 12px 12px;
    border-top: 1px solid #f0f0f0;
    border-bottom: 0;
    background: #ffffff;
}

.quantity-selector__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.quantity-selector__head h2 {
    min-width: 0;
    font-size: 17px;
    line-height: 1.2;
    font-weight: 500;
    color: #222222;
}

.quantity-selector__head h2 span {
    color: #777777;
    font-weight: 400;
}

.quantity-selector__head svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: #bbbbbb;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.quantity-selector__options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.quantity-option {
    min-height: 40px;
    padding: 6px 5px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: #f5f5f5;
    color: #222222;
    font-size: 12px;
    line-height: 1.15;
    text-align: center;
    cursor: pointer;
}

.quantity-option.is-selected {
    border-color: var(--shopee-orange);
    background: #ffffff;
    color: var(--shopee-orange);
}

.store-card {
    padding: 12px 12px 14px;
    border-top: 8px solid #f3f3f3;
    border-bottom: 8px solid #f3f3f3;
    background: #ffffff;
}

.store-card__top {
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.store-logo-wrap {
    position: relative;
    width: 62px;
    height: 62px;
}

.store-logo {
    width: 62px;
    height: 62px;
    padding: 7px;
    border: 1px solid #eeeeee;
    border-radius: 50%;
    object-fit: contain;
    box-sizing: border-box;
    background: #ffffff;
}

.official-store-badge {
    position: absolute;
    left: 50%;
    bottom: -6px;
    transform: translateX(-50%);
    min-width: 66px;
    padding: 2px 5px;
    border-radius: 3px;
    background: #c50025;
    color: #ffffff;
    font-size: 9px;
    line-height: 1;
    font-weight: 700;
    text-align: center;
}

.store-info {
    min-width: 0;
}

.store-info h2 {
    font-size: 18px;
    line-height: 1.2;
    font-weight: 700;
    color: #222222;
}

.store-info p {
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #9a9a9a;
    font-size: 14px;
    line-height: 1;
}

.store-info p span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
}

.authorized-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 30px;
    padding: 6px 9px;
    border-radius: 5px;
    background: #d5002b;
    color: #ffffff;
    font-size: 13px;
    line-height: 1;
    font-weight: 600;
    white-space: nowrap;
}

.authorized-badge svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.authorized-badge svg path:first-child {
    fill: #ffffff;
}

.authorized-badge svg path:last-child {
    fill: none;
    stroke: #d5002b;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.store-stats {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    text-align: center;
}

.store-stats div + div {
    border-left: 1px solid #eeeeee;
}

.store-stats strong {
    display: block;
    color: #222222;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 500;
}

.store-stats span {
    display: block;
    margin-top: 4px;
    color: #9a9a9a;
    font-size: 12px;
    line-height: 1.2;
}

@media (max-width: 380px) {
    .store-card__top {
        grid-template-columns: 62px minmax(0, 1fr);
    }

    .authorized-badge {
        grid-column: 2;
        justify-self: start;
        margin-top: -8px;
        font-size: 12px;
    }
}

.description-gallery-panel {
    padding: 14px 12px 16px;
    border-bottom: 8px solid #f3f3f3;
    background: #ffffff;
}

.description-gallery-panel h2 {
    margin-bottom: 12px;
    color: #222222;
    font-size: 17px;
    line-height: 1.2;
    font-weight: 600;
}

.description-images {
    display: grid;
    gap: 10px;
}

.description-images img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    background: #f5f5f5;
}

.sales-block {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 8px;
    flex-shrink: 0;
}

.sales-block p {
    font-size: 14px;
    white-space: nowrap;
}

.favorite-button {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.favorite-button svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: #7a7a7a;
    stroke-width: 1.7;
}

.product-title {
    margin-top: 12px;
    font-size: 16px;
    line-height: 1.3;
    font-weight: 400;
    letter-spacing: -0.03em;
}

.category-rank-badge {
    width: fit-content;
    max-width: 100%;
    margin-top: 9px;
    padding: 4px 8px;
    border-radius: 5px;
    background: #fff4ef;
    color: #5c3d31;
    font-size: 11px;
    line-height: 1.2;
}

.category-rank-badge::before {
    content: "*";
    margin-right: 4px;
    color: var(--shopee-orange);
    font-weight: 700;
}

.badge {
    display: inline-block;
    margin-right: 8px;
    padding: 2px 6px 1px;
    border-radius: 4px;
    background: var(--shopee-orange);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    vertical-align: 2px;
}

.info-list {
    border-top: 10px solid #f3f3f3;
    border-bottom: 0;
    background: var(--surface);
}

.info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 0 14px 0 12px;
    border-bottom: 1px solid var(--line);
}

.info-row:last-child {
    border-bottom: 0;
}

.info-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-icon svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.7;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.shipping-mark svg {
    stroke: var(--shopee-teal);
}

.wallet-mark svg {
    stroke: var(--shopee-orange);
}

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

.info-copy p {
    font-size: 14px;
    line-height: 1.25;
}

.info-copy strong {
    color: var(--shopee-teal);
    font-weight: 500;
}

.wallet-mark + .info-copy strong {
    color: var(--text-strong);
}

.muted {
    color: #9d9d9d;
}

.strike {
    text-decoration: line-through;
}

.chevron svg {
    width: 18px;
    height: 18px;
    stroke: #b4b4b4;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.reviews-summary {
    position: relative;
    background: var(--surface);
    min-height: 68px;
    padding: 14px 14px 16px;
}

.rating-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rating-score {
    font-size: 18px;
    font-weight: 500;
}

.star {
    color: #ffbf1d;
    font-size: 20px;
    line-height: 1;
}

.rating-text {
    font-size: 15px;
    font-weight: 600;
}

.reviews-link {
    position: absolute;
    right: 16px;
    bottom: 16px;
    color: #7c7c7c;
    font-size: 14px;
    background: none;
    padding: 0;
    cursor: pointer;
}

.reviews-link.is-hidden {
    display: none;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.review-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    background: #ffffff;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.review-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #f3f3f3;
    color: #555555;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.review-meta {
    min-width: 0;
}

.review-author {
    font-size: 14px;
    font-weight: 600;
}

.review-date {
    margin-top: 2px;
    color: var(--text-soft);
    font-size: 12px;
}

.review-stars {
    margin-top: 10px;
    color: #ffbf1d;
    font-size: 14px;
    letter-spacing: 0.08em;
}

.review-text {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.45;
    color: #2d2d2d;
}

.review-variation {
    display: block;
    margin-top: 8px;
    color: var(--text-soft);
    font-size: 13px;
}

.review-photo {
    width: min(100%, 344px);
    height: min(78vw, 344px);
    margin-top: 12px;
    border-radius: 5px;
    object-fit: cover;
    border: 1px solid #ececec;
}

.purchase-modal {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    visibility: hidden;
    pointer-events: none;
}

.purchase-modal.is-open {
    visibility: visible;
    pointer-events: auto;
}

.purchase-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.22s ease;
}

.purchase-modal.is-open .purchase-modal__backdrop {
    opacity: 1;
}

.purchase-sheet {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 768px;
    max-height: 88vh;
    overflow-y: auto;
    border-radius: 22px 22px 0 0;
    background: #ffffff;
    box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.18);
    transform: translateY(100%);
    transition: transform 0.24s ease;
}

.purchase-modal.is-open .purchase-sheet {
    transform: translateY(0);
}

.purchase-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8d8d8d;
    cursor: pointer;
}

.purchase-close svg {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.purchase-head {
    display: grid;
    grid-template-columns: 118px 1fr;
    gap: 12px;
    padding: 18px 46px 18px 14px;
    align-items: end;
    border-bottom: 1px solid #eeeeee;
}

.purchase-preview {
    position: relative;
    aspect-ratio: 1 / 1;
    border: 1px solid #e9e9e9;
    border-radius: 10px;
    overflow: hidden;
    background: #fafafa;
}

.purchase-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.purchase-expand {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.38);
}

.purchase-expand svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.purchase-info {
    min-width: 0;
    padding-bottom: 4px;
}

.purchase-old-price {
    margin-bottom: 5px;
    color: #a7a7a7;
    font-size: 15px;
    line-height: 1;
    text-decoration: line-through;
}

.purchase-price {
    color: var(--shopee-orange);
    font-size: 27px;
    line-height: 1;
    font-weight: 500;
    letter-spacing: 0;
}

.purchase-stock {
    margin-top: 18px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #999999;
    font-size: 15px;
    line-height: 1.2;
    flex-wrap: wrap;
}

.purchase-stock span {
    width: 1px;
    height: 22px;
    background: #dddddd;
}

.purchase-section {
    padding: 24px 14px 28px;
    border-bottom: 1px solid #eeeeee;
}

.purchase-section h2 {
    margin-bottom: 18px;
    color: #222222;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 400;
}

.purchase-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.purchase-option {
    min-height: 58px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: #f7f7f7;
    color: #222222;
    font-size: 14px;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
}

.purchase-option.is-selected {
    border-color: var(--shopee-orange);
    background: #ffffff;
    color: var(--shopee-orange);
}

.purchase-action {
    padding: 18px 10px 20px;
    background: #ffffff;
}

.purchase-confirm {
    width: 100%;
    min-height: 56px;
    border-radius: 8px;
    background: #f04b2f;
    color: #ffffff;
    font-size: 22px;
    font-weight: 400;
    cursor: pointer;
}

.bottom-action-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: block;
    width: 100%;
    background: var(--surface);
    border-top: 1px solid #e8e8e8;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
}

.fixed-service-badges {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    background: #ffffff;
    border-bottom: 1px solid #eeeeee;
}

.fixed-service-badge {
    min-height: 52px;
    padding: 8px 6px;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: center;
    gap: 5px;
    color: #243047;
}

.fixed-service-badge + .fixed-service-badge {
    border-left: 1px solid #eeeeee;
}

.fixed-service-badge svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #1da79d;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.fixed-service-badge span {
    min-width: 0;
    color: #5c6472;
    font-size: 9px;
    line-height: 1.15;
}

.fixed-service-badge strong {
    display: block;
    color: #1da79d;
    font-size: 11px;
    font-weight: 700;
}

.bottom-action-buttons {
    display: grid;
    grid-template-columns: 28% 1fr;
    gap: 0;
    padding: 8px 10px 10px;
    background: #ffffff;
}

.cart-button,
.buy-button {
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.cart-button {
    border-radius: 8px 0 0 8px;
    background: #24ada3;
}

.cart-button svg {
    width: 29px;
    height: 29px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.buy-button {
    width: 100%;
    border-radius: 0 8px 8px 0;
    background: #f55325;
    color: #ffffff;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.02em;
}

@media (min-width: 768px) {
    body {
        padding: 18px 0;
    }

    .phone-screen {
        max-width: 430px;
        border-radius: 24px 24px 0 0;
        overflow: hidden;
        box-shadow: 0 18px 50px rgba(0, 0, 0, 0.08);
    }

    .purchase-sheet {
        max-width: 430px;
    }
}
