.product-detail {
    --product-green: #29443a;
    --product-green-dark: #1d3029;
    --product-muted: #56665e;
    --product-line: #e4e6dc;
    --product-accent: #bb9c58;
    --product-surface: #fff;
    --product-radius: 22px;
    max-width: 1080px;
    margin: 0 auto;
    font-family: Vazirmatn, Tahoma, Arial, sans-serif;
    line-height: 1.8;
}

.product-detail [hidden] {
    display: none !important;
}

.product-detail :is(a, button, select):focus-visible {
    outline: 2px solid var(--product-green);
    outline-offset: 3px;
}

.product-breadcrumb {
    display: block;
    padding: 18px 4px;
    color: var(--product-muted);
    font-size: .82rem;
}

.product-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.product-breadcrumb li + li::before {
    content: "/";
    margin-inline-end: 10px;
    color: #78877c;
}

.product-breadcrumb a {
    font-size: inherit;
    text-decoration: underline;
    text-underline-offset: .22em;
}

.product-breadcrumb [aria-current] {
    color: var(--product-green-dark);
    overflow-wrap: anywhere;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, .94fr) minmax(0, 1.16fr);
    gap: clamp(16px, 3vw, 36px);
    align-items: start;
}

.product-gallery,
.product-overview,
.product-copy-card {
    border: 1px solid var(--product-line);
    border-radius: var(--product-radius);
    background: var(--product-surface);
    box-shadow: 0 12px 32px rgb(29 48 41 / 5%);
}

.product-gallery {
    display: grid;
    gap: 12px;
    min-width: 0;
    padding: clamp(10px, 2vw, 16px);
}

.product-gallery-stage {
    overflow: hidden;
    border: 1px solid #e8e9e1;
    border-radius: 16px;
    background: #f3f5ef;
}

.product-gallery-frame {
    display: grid;
    width: 100%;
    aspect-ratio: 3 / 4;
    place-items: center;
}

a.product-gallery-frame {
    position: relative;
    cursor: zoom-in;
    touch-action: pan-y pinch-zoom;
}

a.product-gallery-frame img {
    position: absolute;
    inset: 0;
    padding: 6px;
}

.product-gallery-frame:focus-visible {
    outline-offset: -4px;
}

.product-gallery-frame img,
.product-gallery-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: contain;
    object-position: center;
}

.product-gallery-empty {
    align-content: center;
    gap: 14px;
    color: var(--product-muted);
    font-size: .9rem;
}

.product-gallery-empty img {
    width: min(120px, 40%);
    height: auto;
}

.product-gallery-toolbar,
.product-gallery-navigation,
.product-gallery-modal-bar,
.product-gallery-modal-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-gallery-toolbar,
.product-gallery-modal-bar {
    justify-content: space-between;
}

.product-gallery-count {
    min-width: 44px;
    text-align: center;
    font-size: .83rem;
    color: var(--product-muted);
    white-space: nowrap;
}

.product-icon-button,
.product-gallery-enlarge {
    min-width: 44px;
    min-height: 44px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--product-line);
    border-radius: 12px;
    background: #fff;
    color: var(--product-green);
    font: inherit;
    cursor: pointer;
}

.product-gallery-enlarge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding-inline: 10px;
    font-size: .83rem;
}

.product-icon-button:hover,
.product-gallery-enlarge:hover {
    border-color: #9baa9d;
    background: #f1f5ee;
}

.product-chevron {
    display: block;
    width: 8px;
    height: 8px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
}

.product-chevron-left {
    transform: rotate(-135deg);
}

.product-expand-icon {
    width: 13px;
    height: 13px;
    border: 1.5px solid currentColor;
    border-radius: 3px;
    box-shadow: 2px -2px 0 -1px #fff, 3.5px -3.5px 0 -1px currentColor;
}

.product-gallery-thumbs {
    display: flex;
    gap: 9px;
    margin: 0;
    padding: 4px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    list-style: none;
    scrollbar-width: thin;
    scrollbar-color: #acbbaf transparent;
}

.product-gallery-thumbs li {
    flex: 0 0 clamp(56px, 14%, 72px);
}

.product-gallery-thumb {
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border: 1px solid var(--product-line);
    border-radius: 10px;
    background: #f4f5ef;
}

.product-gallery-thumb:hover {
    border-color: var(--product-green);
}

.product-gallery-thumb img {
    padding: 3px;
}

.product-gallery-thumb[aria-current] {
    border-color: var(--product-green);
    box-shadow: 0 0 0 2px var(--product-green);
}

.product-gallery-dialog {
    width: min(920px, calc(100% - 24px));
    max-width: none;
    margin: auto;
    padding: 0;
    border: 1px solid var(--product-line);
    border-radius: 18px;
    background: #f8f9f4;
    color: var(--product-green-dark);
}

.product-gallery-dialog::backdrop {
    background: rgb(15 25 21 / 83%);
}

body:has(.product-gallery-dialog[open]) {
    overflow: hidden;
}

.product-gallery-modal {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 8px;
    height: min(880px, 92vh);
    height: min(880px, 92dvh);
    padding: clamp(8px, 2vw, 16px);
}

.product-gallery-modal-photo {
    display: grid;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    min-height: 0;
    place-items: center;
    touch-action: pan-y pinch-zoom;
}

.product-gallery-modal-photo img {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: contain;
}

.product-gallery-close {
    font-size: 1.75rem;
    line-height: 1;
}

.product-gallery-modal-nav {
    justify-content: center;
}

.product-details {
    display: grid;
    min-width: 0;
    gap: 16px;
}

.product-overview,
.product-copy-card {
    min-width: 0;
    padding: clamp(16px, 3vw, 30px);
}

.product-overview h1 {
    margin: 0;
    color: var(--product-green-dark);
    font-size: clamp(1.45rem, 3vw, 2.2rem);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.product-brand {
    margin: 0 0 5px;
    color: var(--product-muted);
    font-size: .88rem;
    font-weight: 700;
}

.product-purchase {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--product-line);
}

.product-price-row,
.product-price-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px 12px;
}

.product-price-row {
    justify-content: space-between;
}

.product-price {
    color: var(--product-green-dark);
    font-size: clamp(1.2rem, 2.5vw, 1.65rem);
}

.product-price-before {
    color: var(--product-muted);
    font-size: .85rem;
}

.product-discount,
.product-unavailable {
    padding: 2px 10px;
    border-radius: 24px;
    background: #f8ede6;
    color: #8d3d2c;
    font-size: .78rem;
    font-weight: 700;
}

.product-cart-form {
    margin-top: 14px;
}

.product-model-field {
    display: grid;
    gap: 5px;
    margin-bottom: 12px;
}

.product-model-field label {
    color: var(--product-green-dark);
    font-weight: 700;
    font-size: .9rem;
}

.product-model-field select {
    width: 100%;
    min-height: 48px;
    padding: 8px 12px;
    border: 1px solid var(--product-line);
    border-radius: 12px;
    background: #fafbf7;
    color: var(--product-green-dark);
    font: inherit;
}

.product-cart-button {
    width: 100%;
    min-height: 48px;
    padding: 8px 14px;
    border: 0;
    border-radius: 12px;
    background: var(--product-green);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.product-cart-button:hover {
    background: var(--product-green-dark);
}

.product-cart-button:disabled {
    opacity: .7;
    cursor: wait;
}

.product-cart-feedback {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 10px;
    color: var(--product-green);
    font-size: .88rem;
}

.product-cart-feedback[data-error] {
    color: #8d3d2c;
}

.product-cart-feedback a {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: .2em;
}

.product-copy-summary {
    background: #fafbf7;
}

.product-copy-card h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 8px;
    color: var(--product-green-dark);
    font-size: clamp(1.02rem, 2.3vw, 1.23rem);
    line-height: 1.6;
}

.product-copy-card h2::before {
    flex: 0 0 4px;
    height: 1.05em;
    border-radius: 5px;
    background: var(--product-accent);
    content: "";
}

.product-copy-card p {
    margin: 0;
    color: var(--product-muted);
    font-size: .96rem;
    line-height: 2.05;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.product-copy-full h2 {
    margin-bottom: 14px;
    padding-bottom: 11px;
    border-bottom: 1px solid var(--product-line);
}

.product-description-text {
    max-width: 80ch;
}

.product-description-text p + p {
    margin-top: 12px;
}

@media (max-width: 700px) {
    .product-detail-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .product-gallery {
        width: 100%;
        max-width: 480px;
        margin-inline: auto;
    }

    .product-details {
        gap: 14px;
    }

    .product-breadcrumb {
        padding: 12px 2px;
    }
}

.product-review-jump {
    display: inline-block;
    margin-top: 6px;
    color: var(--product-green);
    font-size: .85rem;
    text-decoration: underline;
    text-underline-offset: .22em;
}

.product-review-section {
    margin-top: clamp(18px, 3.5vw, 36px);
    scroll-margin-top: 94px;
}

.product-review-heading {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 5px 16px;
    margin-bottom: 15px;
}

.product-review-heading h2 {
    margin: 0;
}

.product-review-summary {
    color: var(--product-green-dark);
    font-weight: 700;
    font-size: .87rem;
}

.product-review-stars,
.product-review-summary > span:first-child {
    color: #806120;
}

.product-review-muted {
    color: var(--product-muted);
    font-size: .87rem;
    font-weight: normal;
}

.product-review-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.product-review-list {
    display: grid;
    gap: 12px;
}

.product-review-item,
.product-review-write,
.product-review-empty {
    padding: clamp(13px, 2.2vw, 20px);
    border: 1px solid var(--product-line);
    border-radius: 15px;
    background: #fff;
    min-width: 0;
}

.product-review-write {
    background: #fafbf7;
}

.product-review-item h3,
.product-review-write h3 {
    margin: 0 0 5px;
    color: var(--product-green-dark);
    font-size: 1rem;
    overflow-wrap: anywhere;
}

.product-review-byline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    font-size: .87rem;
    color: var(--product-green-dark);
    overflow-wrap: anywhere;
}

.product-review-byline time {
    margin-inline-start: auto;
    color: var(--product-muted);
    font-size: .8rem;
}

.product-review-verified {
    padding: 1px 7px;
    border-radius: 8px;
    background: #e9f1e7;
    color: #32513e;
    font-size: .75rem;
}

.product-review-stars {
    width: fit-content;
    margin-block: 4px;
    letter-spacing: 1px;
}

.product-review-reply {
    margin-top: 10px;
    padding: 8px 12px;
    border-inline-start: 3px solid var(--product-accent);
    background: #f7f8f3;
    border-radius: 6px;
    font-size: .87rem;
}

.product-review-link {
    display: inline-block;
    margin-top: 6px;
    color: var(--product-green);
    font-size: .9rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: .22em;
}

.product-review-form,
.product-review-form .review-challenge {
    display: grid;
    gap: 5px;
}

.product-review-form label {
    margin-top: 3px;
    font-size: .88rem;
    font-weight: 700;
}

.product-review-form :is(input, select, textarea) {
    width: 100%;
    padding: 8px 10px;
    color: var(--product-green-dark);
    background: #fff;
    border: 1px solid #cdd8cf;
    border-radius: 9px;
    font: inherit;
    resize: vertical;
}

.product-review-form :is(input, select, textarea):focus-visible {
    outline: 2px solid var(--product-green);
    outline-offset: 2px;
}

.product-review-form input[name="captcha_answer"] {
    width: 82px;
    text-align: center;
}

.product-review-form .review-challenge {
    margin-block: 3px 6px;
}

.review-challenge-question {
    display: inline-block;
    margin-inline-start: 5px;
    padding-inline: 8px;
    border-radius: 6px;
    background: #e8efe7;
    color: var(--product-green-dark);
    font-weight: 800;
}

.product-review-section .product-review-feedback {
    margin-bottom: 12px;
    padding: 7px 10px;
    border-radius: 9px;
    background: #e9f1e7;
    color: #29443a;
}

.product-review-section .product-review-error {
    background: #f9ece6;
    color: #8d3d2c;
}

@media (max-width: 700px) {
    .product-review-columns { grid-template-columns: 1fr; gap: 12px }
}
