/*
Theme Name: TikTok Shop Editable Singapore
Author: OpenAI
Description: Editable single-product storefront for WooCommerce and CheckoutWC, adapted from the supplied static source.
Version: 1.1.4
Requires at least: 6.3
Requires PHP: 7.4
Text Domain: tiktok-shop-editable
WC requires at least: 8.0
WC tested up to: 10.0
*/

html,
body {
    margin: 0;
    padding: 0;
}

body.admin-bar .shop-app {
    min-height: calc(100vh - 32px);
}

.tts-app-header {
    position: sticky;
    top: 0;
    z-index: 90;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 88px;
    align-items: center;
    min-height: 56px;
    padding: 0 8px;
    border-bottom: 1px solid #ededed;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

body.admin-bar .tts-app-header {
    top: 32px;
}

.tts-app-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    color: #121212;
}

.tts-app-brand strong {
    overflow: hidden;
    font-size: 16px;
    font-weight: 750;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tts-app-brand-mark,
.tts-app-brand-mark svg {
    display: block;
    width: 24px;
    height: 24px;
}

.tts-app-verified,
.tts-app-verified svg {
    display: block;
    width: 14px;
    height: 14px;
}

.tts-app-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.tts-app-header-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #121212;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.tts-app-header-button:active {
    background: #f3f3f3;
}

.tts-app-header-button svg {
    display: block;
    width: 24px;
    height: 24px;
}

.tts-share-button > span {
    position: relative;
    top: -3px;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1;
}

.tts-app-cart-count {
    position: absolute;
    top: 4px;
    right: 1px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border: 2px solid #fff;
    border-radius: 10px;
    background: #fe2c55;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 13px;
    text-align: center;
}

.tts-app-toast {
    position: fixed;
    top: 68px;
    left: 50%;
    z-index: 10100;
    transform: translate(-50%, -8px);
    min-width: 120px;
    padding: 9px 14px;
    border-radius: 18px;
    background: rgba(18, 18, 18, 0.9);
    color: #fff;
    font-size: 12px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
}

.tts-app-toast.is-visible {
    transform: translate(-50%, 0);
    opacity: 1;
}

.tts-app-toast[hidden] {
    display: none !important;
}

.tts-deal-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 40px;
    padding: 9px 16px;
    background: linear-gradient(90deg, #ffe9ef 0%, #fff2f5 100%);
    color: #fe2c55;
    font-size: 13px;
}

.tts-deal-primary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 750;
    white-space: nowrap;
}

.tts-deal-primary svg {
    width: 15px;
    height: 15px;
}

.tts-deal-secondary {
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-title-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.product-title-row .product-title {
    flex: 1;
    min-width: 0;
}

.product-title-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 2px;
}

.product-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: -5px 0 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #222;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.product-action-button:active {
    background: #f4f4f4;
}

.product-action-button svg {
    display: block;
    width: 22px;
    height: 22px;
}

.product-action-button.is-saved svg path {
    fill: currentColor;
}

.gallery-nav[hidden],
.photo-lightbox-nav[hidden] {
    display: none !important;
}

.promo-tags {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-right: -16px;
    padding-right: 16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.promo-tags::-webkit-scrollbar {
    display: none;
}

.promo-tag {
    flex: 0 0 auto;
    white-space: nowrap;
}

.tts-notice,
.tts-empty-product {
    max-width: 720px;
    margin: 48px auto;
    padding: 24px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tts-empty-product a {
    color: #fe2c55;
}

.description-content img {
    max-width: 100%;
    height: auto;
}

.description-content iframe,
.description-content video {
    width: 100%;
    max-width: 100%;
}

.tts-review-hidden {
    display: none;
}

.tts-review-empty {
    margin: 0;
    color: #777;
    font-size: 13px;
}

.tts-cart-form {
    margin: 0 0 16px;
}

.tts-cart-form.is-simple {
    height: 0;
    margin: 0;
    overflow: hidden;
}

.tts-cart-form.has-options {
    margin: 0 -16px;
    padding: 16px;
    border-top: 8px solid #f5f5f5;
}

.tts-cart-form .quantity,
.tts-cart-form form.cart > .single_add_to_cart_button,
.tts-cart-form .woocommerce-variation-add-to-cart .single_add_to_cart_button {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.tts-cart-form table.variations {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.tts-cart-form table.variations th,
.tts-cart-form table.variations td {
    display: block;
    padding: 0;
    text-align: left;
}

.tts-cart-form table.variations th {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
}

.tts-cart-form table.variations tr + tr th {
    margin-top: 14px;
}

.tts-cart-form table.variations select {
    width: 100%;
    min-height: 44px;
    padding: 8px 36px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #121212;
    font-size: 14px;
}

.tts-cart-form table.variations select.tts-variation-select-enhanced {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.tts-variation-selected-label {
    color: #777;
    font-weight: 400;
}

.tts-variation-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tts-variation-chip {
    min-width: 62px;
    min-height: 42px;
    padding: 8px 14px;
    border: 1px solid #dedede;
    border-radius: 7px;
    background: #fff;
    color: #121212;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease,
        background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.tts-variation-chip.is-active {
    border-color: #121212;
    box-shadow: inset 0 0 0 1px #121212;
    background: #fafafa;
}

.tts-variation-chip:disabled {
    border-color: #eee;
    background: #f7f7f7;
    color: #b5b5b5;
    cursor: not-allowed;
    text-decoration: line-through;
}

.tts-variation-chip:focus-visible {
    outline: 2px solid #fe2c55;
    outline-offset: 2px;
}

.tts-cart-form .reset_variations {
    display: inline-block;
    margin-top: 8px;
    color: #777;
    font-size: 12px;
}

.tts-cart-form .woocommerce-variation-price {
    margin: 10px 0;
    font-weight: 700;
}

.btn-buy-cta[disabled] {
    cursor: not-allowed;
    opacity: 0.55;
}

.photo-lightbox[hidden],
.wheel-overlay[hidden] {
    display: none !important;
}

.photo-lightbox:not([hidden]) {
    opacity: 1;
    visibility: visible;
}

.photo-lightbox-image {
    display: block;
    margin: auto;
    max-width: min(92vw, 960px);
    max-height: 88vh;
    object-fit: contain;
}

.review-photos-scroll {
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}

.review-photos-scroll::-webkit-scrollbar {
    display: none;
}

.review-photo-card {
    scroll-snap-align: start;
}

.review-photo-card:focus-visible,
.review-entry-photo-stack:focus-visible {
    outline: 2px solid #fe2c55;
    outline-offset: 3px;
}

.review-entry-photo-stack {
    border: 0;
    background: transparent;
    padding: 0;
}

.review-lightbox[hidden]:not(.open) {
    pointer-events: none;
}

.review-lightbox.open {
    pointer-events: auto;
}

.wheel-close {
    position: absolute;
    top: -8px;
    right: 0;
    z-index: 10;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.18);
    color: #fff;
    font-size: 26px;
    line-height: 34px;
    cursor: pointer;
}

/* Exact mobile proportions from the supplied reference screenshots. */
.shop-app {
    width: 100%;
    box-shadow: 0 0 0 1px rgba(18, 18, 18, 0.04),
        0 12px 40px rgba(18, 18, 18, 0.08);
}

.shop-body {
    padding-top: 14px;
}

.buy-bar {
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.btn-buy-cta {
    min-height: 50px;
    box-shadow: 0 4px 12px rgba(254, 44, 85, 0.18);
}

.reviews-module-title,
.store-section-title,
.description-section > h2,
.shop-services-title,
.shop-protection-title {
    letter-spacing: -0.01em;
}

.store-card {
    overflow: hidden;
}

.store-official-badge svg {
    width: 14px;
    height: 14px;
}

.store-metric-value svg {
    width: 14px;
    height: 14px;
}

.description-content > :first-child {
    margin-top: 0;
}

.description-content ol,
.description-content ul {
    padding-left: 18px;
    margin: 0 0 12px;
}

.description-content li {
    margin: 2px 0;
}

.description-content h2,
.description-content h3 {
    margin: 14px 0 6px;
    color: #121212;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
}

.description-content .tts-description-image {
    display: block;
    width: 100%;
    margin: 28px 0 0;
}

.tts-product-attributes {
    margin: 0 0 16px;
    border-top: 1px solid #f0f0f0;
}

.tts-product-attributes table {
    width: 100%;
    margin: 0;
    border: 0;
    border-collapse: collapse;
}

.tts-product-attributes tr {
    border-bottom: 1px solid #f0f0f0;
}

.tts-product-attributes th,
.tts-product-attributes td {
    padding: 10px 0;
    border: 0;
    background: transparent;
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
    vertical-align: top;
}

.tts-product-attributes th {
    width: 34%;
    padding-right: 12px;
    color: #888;
    font-weight: 400;
}

.tts-product-attributes td {
    color: #222;
    font-weight: 500;
}

.tts-product-attributes p {
    margin: 0;
}

@media (max-width: 480px) {
    .buy-bar {
        padding-bottom: max(14px, env(safe-area-inset-bottom));
    }

    .reviews-module {
        padding-right: 16px;
        padding-left: 16px;
    }

    .review-photos-scroll {
        margin-right: -16px;
        padding-right: 16px;
    }
}

@media (max-width: 380px) {
    .review-photo-card,
    .review-photo-card img {
        width: 92px;
        height: 92px;
        min-width: 92px;
        min-height: 92px;
        max-width: 92px;
        max-height: 92px;
    }

    .review-entry-body {
        gap: 8px;
    }
}

.tts-shop-archive {
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 20px 80px;
    background: #fff;
    min-height: 100vh;
}

@media (max-width: 782px) {
    body.admin-bar .shop-app {
        min-height: calc(100vh - 46px);
    }

    body.admin-bar .tts-app-header {
        top: 46px;
    }
}
