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

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

.product-gallery {
    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 img,
.product-gallery__main video,
.product-gallery__main .product-gallery__iframe {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-gallery__iframe {
    border: 0;
}

.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 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.product-gallery__thumb--video::after {
    content: '▶';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.4);
    color: #fff;
    font-size: 1rem;
}

.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;
}

.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;
}

.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;
    height: 320px;
}

.upsell-grid .product-card__name {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

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