/* =========================================================
   PRODUCT DETAIL PAGE
   ========================================================= */

.product-detail {
    --pd-green: #12843c;
    --pd-green-dark: #0a672d;
    --pd-green-light: #e9f7ee;
    --pd-green-pale: #f5faf7;
    --pd-navy: #101827;
    --pd-text: #26342c;
    --pd-muted: #68756d;
    --pd-border: #e1e8e3;
    --pd-surface: #ffffff;
    --pd-background: #f8faf8;
    --pd-danger: #df4e4e;
    --pd-danger-light: #fff0f0;

    position: relative;
    min-height: 75vh;
    padding: 28px 0 70px;
    overflow: hidden;
    background:
        radial-gradient(
            circle at 92% 10%,
            rgba(21, 139, 63, 0.07),
            transparent 27%
        ),
        linear-gradient(
            180deg,
            #ffffff 0%,
            var(--pd-background) 100%
        );
}

.product-detail *,
.product-detail *::before,
.product-detail *::after {
    box-sizing: border-box;
}

.product-detail-container {
    width: min(100% - 48px, 1440px);
    margin-inline: auto;
}

/* =========================================================
   BREADCRUMB
   ========================================================= */

.product-breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    margin-bottom: 22px;
    overflow-x: auto;
    color: var(--pd-muted);
    font-size: 0.83rem;
    scrollbar-width: none;
}

.product-breadcrumb::-webkit-scrollbar {
    display: none;
}

.product-breadcrumb a,
.product-breadcrumb span {
    flex: 0 0 auto;
}

.product-breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--pd-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-breadcrumb a:hover {
    color: var(--pd-green);
}

.product-breadcrumb > i {
    color: #a7b0aa;
    font-size: 0.68rem;
}

.product-breadcrumb [aria-current="page"] {
    max-width: 260px;
    overflow: hidden;
    color: var(--pd-navy);
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =========================================================
   MAIN LAYOUT
   ========================================================= */

.product-detail-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.02fr)
        minmax(460px, 0.98fr);
    align-items: start;
    gap: 10px;
}

.product-detail-media-column,
.product-detail-copy {
    min-width: 0;
}

/* =========================================================
   IMAGE CARD
   ========================================================= */

.product-detail-media-column {
    position: sticky;
    top: 110px;
}

.product-detail-media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80%;
    min-height: 630px;
    padding: 5px;
    overflow: hidden;
    background:
        radial-gradient(
            circle at center,
            #ffffff 0%,
            #f5f6f3 100%
        );
    border: 1px solid var(--pd-border);
    border-radius: 26px;
    box-shadow:
        0 24px 60px rgba(27, 52, 35, 0.08),
        0 5px 18px rgba(27, 52, 35, 0.04);
}

.product-detail-media::after {
    position: absolute;
    inset: 15px;
    pointer-events: none;
    content: "";
    border: 1px solid rgba(18, 132, 60, 0.055);
    border-radius: 19px;
}

.product-detail-media img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    max-width: 680px;
    max-height: 560px;
    object-fit: contain;
    filter: drop-shadow(0 24px 25px rgba(24, 42, 30, 0.11));
    transition:
        transform 0.45s ease,
        filter 0.45s ease;
}

.product-detail-media:hover img {
    filter: drop-shadow(0 30px 30px rgba(24, 42, 30, 0.14));
    transform: scale(1.02);
}

.product-detail-badge {
    position: absolute;
    top: 26px;
    left: 26px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 15px;
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 800;
    background: var(--pd-green);
    border-radius: 10px;
    box-shadow: 0 9px 20px rgba(18, 132, 60, 0.2);
}

/* =========================================================
   PRODUCT CONTENT
   ========================================================= */

.product-detail-copy {
    padding-top: 10px;
}

.product-detail-category {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 15px;
    color: var(--pd-green);
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.075em;
    text-transform: uppercase;
}

.product-detail-category::before {
    width: 22px;
    height: 3px;
    content: "";
    background: var(--pd-green);
    border-radius: 999px;
}

.product-detail-copy h1 {
    max-width: 720px;
    margin: 0;
    color: var(--pd-navy);
    font-size: 30px;
    font-weight: 850;
    line-height: 1.02;
    letter-spacing: -0.055em;
}

.product-summary {
    max-width: 700px;
    margin: 21px 0 0;
    color: var(--pd-muted);
    font-size: 1rem;
    line-height: 1.75;
}

.product-price {
    margin-top: 27px;
    color: var(--pd-green);
    font-size: clamp(2rem, 3vw, 2.75rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.04em;
}

/* =========================================================
   PRODUCT META
   ========================================================= */

.product-meta-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 27px;
    padding: 19px 0;
    border-top: 1px solid var(--pd-border);
    border-bottom: 1px solid var(--pd-border);
}

.product-meta-item {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    min-width: 0;
    padding: 0 17px;
}

.product-meta-item:first-child {
    padding-left: 0;
}

.product-meta-item:not(:last-child) {
    border-right: 1px solid var(--pd-border);
}

.product-meta-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--pd-green);
    background: var(--pd-green-light);
    border-radius: 12px;
}

.product-meta-icon.is-empty {
    color: var(--pd-danger);
    background: var(--pd-danger-light);
}

.product-meta-item div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.product-meta-item small {
    color: var(--pd-muted);
    font-size: 0.7rem;
    font-weight: 650;
}

.product-meta-item strong {
    overflow: hidden;
    color: var(--pd-navy);
    font-size: 0.79rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-meta-item .stock-available {
    color: var(--pd-green);
}

.product-meta-item .stock-empty {
    color: var(--pd-danger);
}

/* =========================================================
   PURCHASE CARD
   ========================================================= */

.product-purchase-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 22px;
    margin-top: 28px;
    padding: 23px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--pd-border);
    border-radius: 21px;
    box-shadow:
        0 18px 45px rgba(27, 52, 35, 0.06),
        0 4px 15px rgba(27, 52, 35, 0.03);
}

/* =========================================================
   PURCHASE FORM
   ========================================================= */

.product-purchase-form {
    min-width: 0;
    margin: 0;
}

.product-purchase-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 135px;
    gap: 15px;
}

.product-field {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.product-field > span {
    color: var(--pd-navy);
    font-size: 0.8rem;
    font-weight: 800;
}

.product-select-wrapper {
    position: relative;
}

.product-select-wrapper select,
.product-quantity-field input {
    width: 100%;
    height: 53px;
    color: var(--pd-navy);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 650;
    background: #ffffff;
    border: 1px solid var(--pd-border);
    border-radius: 13px;
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.product-select-wrapper select {
    padding: 0 42px 0 15px;
    cursor: pointer;
    appearance: none;
}

.product-select-wrapper > i {
    position: absolute;
    top: 50%;
    right: 15px;
    color: var(--pd-muted);
    font-size: 0.75rem;
    pointer-events: none;
    transform: translateY(-50%);
}

.product-quantity-field input {
    padding: 0 12px;
    text-align: center;
}

.product-select-wrapper select:focus,
.product-quantity-field input:focus {
    border-color: rgba(18, 132, 60, 0.52);
    box-shadow: 0 0 0 4px rgba(18, 132, 60, 0.08);
}

.product-add-cart-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 56px;
    gap: 10px;
    margin-top: 17px;
    padding: 0 22px;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 850;
    cursor: pointer;
    background:
        linear-gradient(
            135deg,
            var(--pd-green),
            var(--pd-green-dark)
        );
    border: 0;
    border-radius: 13px;
    box-shadow: 0 14px 28px rgba(18, 132, 60, 0.22);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

.product-add-cart-button:hover:not(:disabled) {
    box-shadow: 0 18px 34px rgba(18, 132, 60, 0.28);
    filter: brightness(1.04);
    transform: translateY(-2px);
}

.product-add-cart-button:disabled {
    color: #8f9992;
    cursor: not-allowed;
    background: #e8ece9;
    box-shadow: none;
}

/* =========================================================
   SIDE ACTION PANEL
   ========================================================= */

.product-action-panel {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 11px;
    padding-left: 21px;
    border-left: 1px solid var(--pd-border);
}

.product-action-panel form {
    margin: 0;
}

.product-wishlist-button,
.product-back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    gap: 9px;
    padding: 0 15px;
    font-family: inherit;
    font-size: 0.83rem;
    font-weight: 800;
    text-decoration: none;
    border-radius: 12px;
    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.product-wishlist-button {
    color: var(--pd-green);
    cursor: pointer;
    background: #ffffff;
    border: 1px solid rgba(18, 132, 60, 0.35);
}

.product-wishlist-button:hover {
    color: #ffffff;
    background: var(--pd-green);
    border-color: var(--pd-green);
    transform: translateY(-1px);
}

.product-wishlist-button.is-active {
    color: #ffffff;
    background: var(--pd-danger);
    border-color: var(--pd-danger);
}

.product-back-button {
    color: var(--pd-navy);
    background: #ffffff;
    border: 1px solid var(--pd-border);
}

.product-back-button:hover {
    color: var(--pd-green);
    background: var(--pd-green-light);
    border-color: rgba(18, 132, 60, 0.24);
    transform: translateY(-1px);
}

/* =========================================================
   AVAILABLE SIZES
   ========================================================= */

.available-sizes {
    margin-top: 7px;
    padding-top: 17px;
    border-top: 1px solid var(--pd-border);
}

.available-sizes h2 {
    margin: 0 0 12px;
    color: var(--pd-navy);
    font-size: 0.87rem;
    font-weight: 850;
}

.available-sizes ul {
    display: grid;
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.available-sizes li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--pd-muted);
    font-size: 0.76rem;
    line-height: 1.4;
}

.available-sizes li span {
    position: relative;
    padding-left: 14px;
}

.available-sizes li span::before {
    position: absolute;
    top: 50%;
    left: 0;
    width: 5px;
    height: 5px;
    content: "";
    background: var(--pd-green);
    border-radius: 50%;
    transform: translateY(-50%);
}

.available-sizes li strong {
    color: var(--pd-navy);
    font-size: 0.76rem;
    white-space: nowrap;
}

/* =========================================================
   SERVICE STRIP
   ========================================================= */

.product-service-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 38px;
    padding: 22px 25px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--pd-border);
    border-radius: 20px;
    box-shadow: 0 14px 36px rgba(27, 52, 35, 0.05);
}

.product-service-item {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 13px;
    padding: 0 24px;
}

.product-service-item:first-child {
    padding-left: 0;
}

.product-service-item:not(:last-child) {
    border-right: 1px solid var(--pd-border);
}

.product-service-item > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    color: var(--pd-green);
    font-size: 1.1rem;
    background: var(--pd-green-light);
    border-radius: 50%;
}

.product-service-item div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.product-service-item strong {
    color: var(--pd-navy);
    font-size: 0.8rem;
    font-weight: 800;
}

.product-service-item small {
    color: var(--pd-muted);
    font-size: 0.71rem;
    line-height: 1.4;
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1160px) {
    .product-detail-grid {
        grid-template-columns:
            minmax(0, 0.95fr)
            minmax(430px, 1.05fr);
        gap: 38px;
    }

    .product-detail-media {
        min-height: 560px;
    }

    .product-purchase-card {
        grid-template-columns: 1fr;
    }

    .product-action-panel {
        display: grid;
        grid-template-columns: 1fr 1fr;
        padding-top: 19px;
        padding-left: 0;
        border-top: 1px solid var(--pd-border);
        border-left: 0;
    }

    .available-sizes {
        grid-column: 1 / -1;
    }

    .product-service-item {
        padding: 0 15px;
    }
}

@media (max-width: 920px) {
    .product-detail {
        padding-top: 20px;
    }

    .product-detail-grid {
        grid-template-columns: 1fr;
        gap: 34px;
    }

    .product-detail-media-column {
        position: relative;
        top: auto;
    }

    .product-detail-media {
        min-height: 520px;
    }

    .product-detail-copy {
        padding-top: 0;
    }

    .product-service-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px 0;
    }

    .product-service-item:nth-child(2) {
        border-right: 0;
    }

    .product-service-item:nth-child(3),
    .product-service-item:nth-child(4) {
        padding-top: 20px;
        border-top: 1px solid var(--pd-border);
    }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 680px) {
    .product-detail {
        padding: 14px 0 42px;
    }

    .product-detail-container {
        width: min(100% - 26px, 1440px);
    }

    .product-breadcrumb {
        margin-bottom: 13px;
        font-size: 0.75rem;
    }

    .product-breadcrumb [aria-current="page"] {
        max-width: 150px;
    }

    .product-detail-grid {
        gap: 25px;
    }

    .product-detail-media {
        min-height: 360px;
        padding: 18px;
        border-radius: 20px;
    }

    .product-detail-media::after {
        inset: 9px;
        border-radius: 14px;
    }

    .product-detail-media img {
        max-height: 320px;
    }

    .product-detail-badge {
        top: 17px;
        left: 17px;
    }

    .product-detail-category {
        margin-bottom: 10px;
        font-size: 0.7rem;
    }

    .product-detail-copy h1 {
        font-size: 2.15rem;
        line-height: 1.06;
    }

    .product-summary {
        margin-top: 14px;
        font-size: 0.9rem;
        line-height: 1.65;
    }

    .product-price {
        margin-top: 19px;
        font-size: 2rem;
    }

    .product-meta-row {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 22px;
        padding: 16px 0;
    }

    .product-meta-item {
        padding: 0;
    }

    .product-meta-item:not(:last-child) {
        border-right: 0;
    }

    .product-purchase-card {
        gap: 17px;
        margin-top: 22px;
        padding: 17px;
        border-radius: 17px;
    }

    .product-purchase-fields {
        grid-template-columns: minmax(0, 1fr) 110px;
        gap: 11px;
    }

    .product-select-wrapper select,
    .product-quantity-field input {
        height: 50px;
    }

    .product-add-cart-button {
        min-height: 53px;
    }

    .product-action-panel {
        gap: 9px;
        padding-top: 16px;
    }

    .product-service-strip {
        grid-template-columns: 1fr;
        gap: 0;
        margin-top: 27px;
        padding: 8px 17px;
    }

    .product-service-item,
    .product-service-item:first-child {
        padding: 15px 0;
        border-right: 0;
    }

    .product-service-item:not(:last-child) {
        border-bottom: 1px solid var(--pd-border);
    }

    .product-service-item:nth-child(3),
    .product-service-item:nth-child(4) {
        border-top: 0;
    }
}

.related-products {
    margin-top: 58px;
}

.related-products-container {
    width: min(100% - 52px, 1440px);
    margin-inline: auto;
}

.related-products-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.related-products-grid > * {
    flex: 0 0 auto;
    min-width: 220px;
    width: min(280px, calc(33.333% - 12px));
    scroll-snap-align: start;
}

.related-products-grid::-webkit-scrollbar {
    height: 10px;
}

.related-products-grid::-webkit-scrollbar-thumb {
    background: rgba(18, 132, 60, 0.3);
    border-radius: 999px;
}

.related-products-grid::-webkit-scrollbar-track {
    background: transparent;
}

@media (max-width: 920px) {
    .related-products-grid > * {
        width: min(260px, calc(45% - 10px));
    }
}

@media (max-width: 680px) {
    .related-products-grid {
        gap: 14px;
    }

    .related-products-grid > * {
        width: min(240px, calc(75% - 10px));
    }
}

@media (max-width: 450px) {
    .related-products-grid > * {
        width: min(220px, calc(90% - 10px));
    }
}

.related-products-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 18px;
}

.related-products-scroll-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    gap: 10px;
    padding: 0 18px;
    color: var(--pd-navy);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 800;
    background: #ffffff;
    border: 1px solid var(--pd-border);
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.related-products-scroll-button:hover {
    transform: translateY(-1px);
    background: var(--pd-green-light);
}

.related-products-scroll-button:focus-visible {
    outline: 3px solid rgba(18, 132, 60, 0.24);
    outline-offset: 3px;
}

@media (max-width: 680px) {
    .related-products-toolbar {
        justify-content: center;
        margin-bottom: 14px;
    }
}

@media (max-width: 450px) {
    .related-products-scroll-button {
        width: 100%;
    }

    .product-detail-container {
        width: min(100% - 18px, 1440px);
    }

    .product-detail-media {
        min-height: 300px;
    }

    .product-detail-media img {
        max-height: 270px;
    }

    .product-detail-copy h1 {
        font-size: 1.82rem;
    }

    .product-purchase-fields {
        grid-template-columns: 1fr;
    }

    .product-action-panel {
        grid-template-columns: 1fr;
    }

    .available-sizes {
        grid-column: auto;
    }
}

/* =========================================================
   ACCESSIBILITY
   ========================================================= */

.product-detail a:focus-visible,
.product-detail button:focus-visible,
.product-detail input:focus-visible,
.product-detail select:focus-visible {
    outline: 3px solid rgba(18, 132, 60, 0.24);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .product-detail *,
    .product-detail *::before,
    .product-detail *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}