.product-page {
    padding-top: 16px;
    padding-bottom: 32px;
}

.product-detail {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.product-gallery {
    position: relative;
}

.product-gallery__stage {
    position: relative;
}

.product-gallery__main {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--color-bg-white);
}

.product-gallery__main picture {
    display: block;
    width: 100%;
    height: 100%;
}

.product-gallery__main img,
.product-gallery__main video,
.product-gallery__main .product-gallery__iframe {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-gallery__iframe {
    border: 0;
    display: block;
    max-width: 100%;
}

.product-gallery__video {
    background: #000;
}

.product-gallery__badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 2;
}

.product-gallery__nav {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.product-gallery__nav::-webkit-scrollbar {
    display: none;
}

.product-gallery__thumb {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
    transition: all var(--transition);
}

.product-gallery__thumb.is-active,
.product-gallery__thumb:hover {
    border-color: var(--color-accent);
    opacity: 1;
}

.product-gallery__thumb picture {
    display: block;
    width: 100%;
    height: 100%;
}

.product-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-gallery__thumb--video {
    position: relative;
}

.product-gallery__thumb--video::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.28);
    z-index: 1;
    pointer-events: none;
}

.product-gallery__thumb--video::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: 28px;
    height: 28px;
    margin-top: -14px;
    margin-left: -14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    font-size: 0.7rem;
    line-height: 1;
    padding-left: 2px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.92), 0 2px 6px rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

.product-gallery__counter {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 4;
    min-width: 44px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.62);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    pointer-events: none;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.product-gallery__play-video {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 6px 12px 6px 10px;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

.product-gallery__play-video:hover,
.product-gallery__play-video:focus-visible {
    background: rgba(0, 0, 0, 0.88);
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.product-gallery__play-video-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    color: #111;
    font-size: 0.65rem;
    padding-left: 2px;
}

.product-gallery__play-video.is-hidden {
    display: none;
}

.product-gallery__thumb--video .thumb-empty {
    width: 100%;
    height: 100%;
    background: #1a1a1a;
}

@media (min-width: 768px) {
    .product-gallery__thumb--video::after {
        width: 32px;
        height: 32px;
        margin-top: -16px;
        margin-left: -16px;
        font-size: 0.8rem;
    }

    .product-gallery__play-video {
        min-height: 40px;
        padding: 8px 14px 8px 12px;
        font-size: 0.875rem;
    }

    .product-gallery__counter {
        font-size: 0.8125rem;
        padding: 5px 12px;
    }
}

@media (max-width: 389px) {
    .product-gallery__play-video {
        max-width: calc(100% - 72px);
    }
}

.product-gallery__arrows {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 8px;
    pointer-events: none;
    z-index: 3;
}

.product-gallery__arrow {
    pointer-events: auto;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: background var(--transition);
}

.product-gallery__arrow:hover {
    background: var(--color-bg-white);
}

.product-gallery__arrow svg {
    width: 18px;
    height: 18px;
}

.product-info {
    background: var(--color-bg-white);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.product-info__sku {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.product-info__title {
    font-size: 1.125rem;
    line-height: 1.35;
    margin-bottom: 4px;
}

.product-info__stock {
    margin-bottom: 8px;
    max-width: 100%;
    min-width: 0;
}

.product-info__shipping {
    margin-top: 4px;
    max-width: 100%;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--color-text-muted);
    overflow-wrap: anywhere;
}

@media (min-width: 768px) {
    .product-info__shipping {
        font-size: 0.8125rem;
    }
}

.product-info__short {
    font-size: 0.875rem;
    color: var(--color-text-light);
    line-height: 1.6;
    margin-bottom: 12px;
}

.product-info__short p {
    margin-bottom: 6px;
}

.product-info__short p:last-child {
    margin-bottom: 0;
}

.product-info__short ul,
.product-info__short ol {
    padding-left: 18px;
    margin-bottom: 6px;
    list-style: disc;
}

.product-info__short ol {
    list-style: decimal;
}

.product-info__price-block {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 16px;
}

.product-info__price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-accent);
}

.product-info__old-price {
    font-size: 1rem;
    color: var(--color-text-muted);
    text-decoration: line-through;
}

.product-info__discount-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: var(--color-badge-sale);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 700;
}

.product-info__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.product-info__oneclick {
    font-size: 0.8125rem;
    color: var(--color-accent);
    text-decoration: underline;
    text-align: center;
    background: none;
    padding: 6px;
}

.product-info__phones {
    border-top: 1px solid var(--color-border-light);
    padding-top: 12px;
}

.product-info__phone {
    display: block;
    padding: 4px 0;
    color: var(--color-accent);
    font-size: 0.875rem;
}

.product-tabs {
    background: var(--color-bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.product-tabs__nav {
    display: flex;
    border-bottom: 2px solid var(--color-border-light);
    overflow-x: auto;
    scrollbar-width: none;
}

.product-tabs__nav::-webkit-scrollbar {
    display: none;
}

.product-tabs__btn {
    flex-shrink: 0;
    padding: 12px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-light);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color var(--transition), border-color var(--transition);
    white-space: nowrap;
}

.product-tabs__btn.is-active,
.product-tabs__btn:hover {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.product-tabs__panel {
    display: none;
    padding: 16px;
}

.product-tabs__panel.is-active {
    display: block;
}

.product-tabs__panel p,
.product-tabs__panel li,
.product-info__short p,
.product-info__short li {
    font-size: 0.875rem;
    line-height: 1.6;
}

.product-tabs__panel p {
    margin-bottom: 10px;
}

.product-tabs__panel p:last-child {
    margin-bottom: 0;
}

.product-tabs__panel ul,
.product-tabs__panel ol {
    padding-left: 20px;
    margin-bottom: 10px;
}

.product-tabs__panel ul {
    list-style: disc;
}

.product-tabs__panel ol {
    list-style: decimal;
}

.product-tabs__panel li {
    margin-bottom: 4px;
}

.product-tabs__panel h1,
.product-tabs__panel h2,
.product-tabs__panel h3,
.product-tabs__panel h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 14px 0 6px;
    line-height: 1.35;
}

/* Former order-info h1 look after demote_h1 → h2.seo-h2 */
.product-tabs__panel h2.seo-h2,
.product-tabs__panel .seo-h2 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    margin: 14px 0 6px;
    line-height: 1.35;
    color: var(--color-accent);
}

.product-tabs__panel h1:first-child,
.product-tabs__panel h2:first-child,
.product-tabs__panel h3:first-child,
.product-tabs__panel p:first-child {
    margin-top: 0;
}

.product-tabs__panel blockquote {
    border-left: 3px solid var(--color-border);
    padding-left: 12px;
    margin: 0 0 10px;
    color: var(--color-text-light);
    font-style: italic;
}

.product-tabs__panel strong,
.product-tabs__panel b {
    font-weight: 600;
}

/* ---- Tables from TinyMCE rich-text ---- */
.product-tabs__panel,
.product-info__short {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.product-tabs__panel table,
.product-info__short table {
    width: 100%;
    border-collapse: collapse;
    border: none;
    outline: none;
    margin-bottom: 12px;
    font-size: 0.875rem;
    line-height: 1.6;
}

.product-tabs__panel table td,
.product-tabs__panel table th,
.product-info__short table td,
.product-info__short table th {
    border: none;
    background: none;
    padding: 4px 12px 4px 0;
    vertical-align: top;
    text-align: left;
    color: var(--color-text);
}

.product-tabs__panel table th,
.product-info__short table th {
    font-weight: 600;
}

.product-tabs__panel table tr:nth-child(even) td,
.product-info__short table tr:nth-child(even) td {
    background: none;
}

.product-attrs {
    width: 100%;
    border-collapse: collapse;
}

.product-attrs tr {
    border-bottom: 1px solid var(--color-border-light);
}

.product-attrs td {
    padding: 8px 0;
    font-size: 0.875rem;
    vertical-align: top;
}

.product-attrs td:first-child {
    color: var(--color-text-light);
    padding-right: 16px;
    width: 40%;
}

.product-info__manager {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--color-text-light);
    padding: 8px 0;
    border-top: 1px solid var(--color-border-light);
}

.product-info__manager svg {
    flex-shrink: 0;
    color: var(--color-accent);
}

.product-info__schedule {
    border-top: 1px solid var(--color-border-light);
    padding-top: 12px;
    margin-top: 4px;
}

.product-info__schedule-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
}

.product-info__schedule-text {
    font-size: 0.8125rem;
    color: var(--color-text-light);
    line-height: 1.6;
}

.product-info__return-policy {
    border-top: 1px solid var(--color-border-light);
    padding-top: 12px;
    margin-top: 4px;
}

.product-info__return-policy summary {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-accent);
    cursor: pointer;
    padding: 4px 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.product-info__return-policy summary::-webkit-details-marker {
    display: none;
}

.product-info__return-policy summary::before {
    content: '▸';
    font-size: 0.75rem;
    transition: transform var(--transition);
}

.product-info__return-policy[open] summary::before {
    transform: rotate(90deg);
}

.return-policy__content {
    font-size: 0.8125rem;
    color: var(--color-text-light);
    line-height: 1.6;
    padding: 8px 0 4px 18px;
}

.upsell-section {
    padding: 24px 0;
}

.upsell-section__title {
    font-size: 1.125rem;
    margin-bottom: 16px;
}

.upsell-grid {
    display: flex;
    align-items: stretch;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
}

.upsell-grid::-webkit-scrollbar {
    display: none;
}

.upsell-grid .product-card {
    flex: 0 0 160px;
    align-self: stretch;
    height: auto;
    display: flex;
    flex-direction: column;
}

.upsell-grid .product-card__stock {
    margin-top: auto;
}

.product-tabs--top {
    margin-top: 24px;
}

.product-info__unavailable {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}
