/* Product Detail */

.pd-wrap {
    max-width: 1920px;
    margin: 0 auto;
    /* padding: 120px 60px 120px; */
    padding: 120px clamp(24px, 4vw, 60px) 120px
}

/* Breadcrumb */
.pd-breadcrumb {
    /* display: flex; */
    /* align-items: center; */
    /* gap: 6px; */
    font-size: 13px;
    letter-spacing: 0.01em;
    color: #777;
    margin-bottom: 24px;
}

.pd-breadcrumb-link {
    color: #777;
    text-decoration: none;
}

.pd-breadcrumb-link:hover {
    color: #222;
}

.pd-breadcrumb-sep {
    color: #bbb;
}

.pd-breadcrumb-current {
    color: #222;
}

/* Main two-column layout */
.pd-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
    margin-bottom: 80px;
}

/* Gallery */
.pd-gallery {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Slideshow */
.pd-slideshow {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #f5f3ef;
}

.pd-slides-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.pd-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.pd-slide--active {
    opacity: 1;
    pointer-events: auto;
}

.pd-slide-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Arrows */
.pd-slide-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.25);
    border: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s;
}

.pd-slide-arrow:hover {
    background: rgba(255,255,255,0.85);
}

.pd-slide-arrow--prev {
    left: 12px;
}

.pd-slide-arrow--next {
    right: 12px;
}

/* Dots */
/* .pd-slide-dots { */
    /* position: absolute; */
    /* bottom: 12px; */
    /* left: 50%; */
    /* transform: translateX(-50%); */
    /* display: flex; */
    /* gap: 6px; */
    /* z-index: 2; */
/* } */

/* .pd-slide-dot { */
    /* width: 7px; */
    /* height: 7px; */
    /* border-radius: 50%; */
    /* border: none; */
    /* background: rgba(255,255,255,0.5); */
    /* cursor: pointer; */
    /* padding: 0; */
    /* transition: background 0.2s; */
/* } */

.pd-slide-dot--active {
    background: #fff;
}

/* Thumbnail strip */
.pd-gallery-thumbs {
    display: flex;
    flex-direction: row;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.pd-thumb-btn {
    width: 56px;
    height: 56px;
    border: 1px solid transparent;
    background: none;
    padding: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.pd-thumb-btn--active {
    border-color: #1a1a1a;
}

.pd-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.pd-gallery-placeholder {
    aspect-ratio: 3 / 4;
    background: #f0ede8;
}

/* Info panel */
.pd-info {
    padding-top: 8px;
    width: 100%;
    min-width: 0;
}

.pd-name {
    font-size: 28px;
    font-weight: 400;
    margin: 0 0 8px;
    color: #222;
    letter-spacing: 0.1em;
}

.pd-subtitle {
    font-size: 16px;
    letter-spacing: 0.01em;
    color: #222;
    margin: 0 0 16px;
    line-height: 1.5;
}

.pd-price {
    font-size: 18px;
    color: #222;
    letter-spacing: 0.01em;
    margin-bottom: 16px;
}

.pd-colors {
    font-size: 14px;
    color: #222;
    letter-spacing: 0.01em;
    margin-bottom: 4px;
}

.pd-attr-label {
    font-weight: 600;
    color: #222;
    margin-right: 4px;
}

/* Price with discount */
.pd-price-original {
    text-decoration: line-through;
    color: #999;
    margin-right: 10px;
}

.pd-price-discount {
    color: #222;
}

/* Selects */
.pd-selects {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 4px;
}

.pd-select-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pd-select-label {
    font-size: 14px;
    letter-spacing: 0.1em;
    color: #222;
}

.pd-select {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid #c8c2ba;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23555' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    padding: 12px 30px 12px 12px;
    font-size: 14px;
    font-family: 'segoe-ui', sans-serif;
    letter-spacing: 0.01em;
    color: #777;
    cursor: pointer;
    width: 100%;
}

.pd-select:focus {
    outline: none;
    border-color: #222;
    color: #222;
}

/* Custom Options (shoe size / insole) */
.pd-custom-option {
    margin: 0;
    position: relative;
    z-index: 1;
    max-height: none !important;
    overflow: visible;
}

.pd-custom-option-header {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 4px 0;
    user-select: none;
}

.pd-custom-checkbox {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #222;
}

.pd-custom-option-label {
    flex: 1;
    font-size: 14px;
    letter-spacing: 0.1em;
    color: #222;
}

.pd-accordion-chevron {
    flex-shrink: 0;
    transition: transform 0.25s ease;
    color: #222;
}

.is-open > .pd-custom-option-header .pd-accordion-chevron,
.is-open > .pd-section-header .pd-accordion-chevron {
    transform: rotate(180deg);
}

.pd-custom-option-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0;
}

.pd-custom-option.is-open .pd-custom-option-body {
    padding: 16px 0 4px;
}

.pd-custom-option-desc {
    font-size: 13px;
    line-height: 1.67;
    color: #222;
    margin: 0 0 16px;
    letter-spacing: 0.01em;
}

.pd-custom-link {
    color: #222;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-size: 13px;
    letter-spacing: 0.01em;
    line-height: 1.67;
}

.pd-custom-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.pd-custom-two-col:last-child {
    margin-bottom: 0;
}

.pd-custom-two-col.pd-custom-three-col {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 600px) {
    .pd-custom-two-col.pd-custom-three-col {
        grid-template-columns: 1fr;
    }
}

.pd-custom-field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.pd-custom-input {
    border: 1px solid #c8c2ba;
    padding: 12px 12px;
    font-size: 14px;
    letter-spacing: 0.01em;
    color: #222;
    width: 100%;
    background: #fff;
    outline: none;
    box-sizing: border-box;
}

.pd-custom-input::placeholder {
    color: #777;
}

.pd-custom-input:focus {
    border-color: #222;
}

/* File upload */
.pd-file-upload {
    display: flex;
    gap: 0;
}

.pd-file-name {
    flex: 1;
    min-width: 0;
    border: 1px solid #c8c2ba;
    border-right: none;
    padding: 12px 12px;
    font-size: 14px;
    letter-spacing: 0.01em;
    color: #777;
    background: #fff;
    outline: none;
    cursor: default;
    box-sizing: border-box;
}

.pd-file-btn {
    background: #000;
    color: #fff;
    font-size: 14px;
    letter-spacing: 0.01em;
    padding: 10px 16px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.pd-file-input {
    display: none;
}

/* Shipping Date */
.pd-shipping-date {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    z-index: 0;
}

.pd-date-input {
    color: #bbb;
}

.pd-date-input:valid {
    color: #222;
}

/* Divider */
.pd-divider {
    border: none;
    border-top: 1px solid #e0dbd3;
    margin: 20px 0;
}

/* Add to cart */
.pd-btn-cart {
    width: 100%;
    height: 60px;
    background: #000;
    color: #fff;
    border: none;
    font-size: 14px;
    letter-spacing: 0.2em;
    cursor: pointer;
    transition: opacity 0.2s;
    margin: 40px 0 40px;
}

.pd-btn-cart:hover {
    opacity: 0.9;
}

/* Sections (product details / shipping) */
.pd-section {
    margin: 0;
    position: relative;
    z-index: 1;
}

.pd-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    letter-spacing: 0.1em;
    color: #222;
    padding: 4px 0;
    cursor: pointer;
    user-select: none;
}


.pd-section-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    font-size: 14px;
    line-height: 1.67;
    color: #222;
    padding: 0;
}

.pd-section.is-open .pd-section-body {
    padding: 16px 0 4px;
}

.pd-section-body p {
    margin: 0 0 16px;
}

.pd-section-body p:last-child {
    margin-bottom: 0;
}

.pd-section-desc {
    margin-bottom: 16px;
}

.pd-section-attrs p {
    margin: 0;
    line-height: 1.8;
}

/* Related products */
.pd-related {
    padding-top: 24px;
}

.pd-related-title {
    font-size: 28px;
    font-weight: 400;
    letter-spacing: 0.01em;
    color: #222;
    margin: 0 0 32px;
}

.pd-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.pd-related-card {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    /* gap: 12px; */
}

.pd-related-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 420 / 526;
    overflow: hidden;
    margin-bottom: 16px;
    background: #f0ede8;
}

.pd-related-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    image-rendering: -webkit-optimize-contrast;
}

.pd-related-card:hover .pd-related-img {
    transform: scale(1.04) translateZ(0);
}

.pd-related-img-placeholder {
    width: 100%;
    height: 100%;
    background: #e8e3db;
}

.pd-related-name,
.pd-related-desc,
.pd-related-price {
    padding-left: 20px;
    padding-right: 20px;
}

.pd-related-name {
    font-family: 'segoe-ui';
    font-size: clamp(14px, 1vw, 16px);
    letter-spacing: 0.1em;
    color: #222;
    margin-top: 0;
    margin-bottom: 6px;
    line-height: 1.2;
}

.pd-related-desc {
    font-family: 'segoe-ui';
    font-size: clamp(13px, 1vw, 14px);
    letter-spacing: 0.01em;
    color: #222;
    margin-top: 0;
    margin-bottom: 6px;
    line-height: 1.5;
}

.pd-related-price {
    font-family: 'segoe-ui';
    font-size: clamp(13px, 1vw, 14px);
    letter-spacing: 0.01em;
    color: #222;
    margin: 0;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 900px) {
    .pd-main {
        /* grid-template-columns: minmax(0, 1fr); */
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }

    .pd-name {
        font-size: 24px;
    }

    .pd-subtitle {
        font-size: 14px;
    }

    .pd-selects {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* The upload fields get too narrow side by side, so stack them on tablets. */
    .pd-insole-image-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .pd-main {
        margin-bottom: 42px;
    }

    .pd-related-grid {
        /* grid-template-columns: repeat(2, 1fr); */
        grid-template-columns: repeat(4, 1fr);
        gap: 18px;
    }

    .pd-related-name,
    .pd-related-desc,
    .pd-related-price {
        padding-left: 10px;
        padding-right: 10px;
    }
}

@media (max-width: 768px) {
    .pd-related-grid {    
        gap: 12px;
        row-gap: 60px;
    }
}

@media (max-width: 600px) {
    .pd-wrap {
        padding: 120px 24px 120px;
    }

    .pd-main {
        grid-template-columns: minmax(0, 1fr);
        gap: 30px;
    }

    .pd-selects {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .pd-thumb-btn {
        width: 48px;
        height: 48px;
    }

    .pd-related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        row-gap: 60px;
    }
}

/* Size Guide Modal */
.pd-size-guide-link {
    margin-top: 12px;
    margin-bottom: 0;
}

.pd-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    align-items: center;
    justify-content: center;
}

.pd-modal.is-open {
    display: flex;
}

.pd-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.pd-modal-content {
    position: relative;
    background: #fff;
    max-width: 840px;
    width: 90%;
    height: 90%;
    /* max-height: 80vh; */
    overflow-y: auto;
    /* padding: 60px; */
    padding: 60px clamp(30px, 6vw, 60px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.pd-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    color: #222;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pd-modal-close:hover {
    color: #666;
}

.pd-modal-body {
    font-family: inherit;
    color: #333;
}

.pd-modal-body h2 {
    font-size: 28px;
    font-weight: 400;
    text-align: center;
    margin-bottom: 36px;
    font-family: 'Baskervville', serif;
}

.pd-modal-body p {
    margin-bottom: 16px;
    line-height: 1.6;
}

.pd-modal-body ol {
    margin-left: 20px;
    margin-bottom: 16px;
}

.pd-modal-body li {
    margin-bottom: 12px;
}

.pd-modal-body strong {
    font-weight: 600;
}

.pd-modal-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
}

.pd-modal-body th,
.pd-modal-body td {
    border: 1px solid #999;
    padding: 12px;
    text-align: center;
}

@media (max-width: 480px) {
    .pd-related-grid {    
        gap: 12px;
        row-gap: 48px;
    }
}
