
/* Product details page only. Shared header and bottom navigation stay in _Layout. */
.product-details-page {
    --pd-green: #35ad16;
    --pd-border: #e5e5e5;
    --pd-text: #202020;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 0 0 90px;
    color: var(--pd-text);
    background: #f8f8f8;
    min-height: 100%;
    box-sizing: border-box;
}

    .product-details-page * {
        box-sizing: border-box;
    }

.pd-hero {
    position: relative;
    height: min(92vw, 340px);
    min-height: 260px;
    max-height: 340px;
    background: #fff;
    border-radius: 0 0 28px 28px;
    overflow: hidden;
}

.pd-main-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
}

.pd-icon-button {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: #252525;
    font-size: 18px;
    cursor: pointer;
}

.pd-back {
    position: absolute;
    left: 12px;
    top: 14px;
}

.pd-hero-actions {
    position: absolute;
    top: 14px;
    right: 12px;
    display: flex;
    gap: 8px;
}

.pd-content {
    padding: 12px 16px 0;
}

.pd-product-summary {
    padding: 0 11px 9px;
}

.pd-title {
    font-size: 15px;
    line-height: 1.3;
    font-weight: 750;
    margin: 0 0 3px;
}

.pd-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 7px;
    font-size: 9px;
    color: #5d7459;
}

.pd-category {
    background: #e4f1e0;
    padding: 2px 5px;
    border-radius: 3px;
}

.pd-origin::before {
    content: "•";
    color: var(--pd-green);
    margin-right: 4px;
}

.pd-price {
    font-size: 14px;
    font-weight: 750;
    margin: 5px 0 7px;
}

.pd-pack-heading {
    font-size: 12px;
    margin-bottom: 4px;
}

.pd-pack-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.pd-pack-option {
    min-height: 50px;
    border: 1px solid #e9e9e9;
    border-radius: 9px;
    background: #f7f7f7;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px;
    font-size: 11px;
    cursor: pointer;
}

    .pd-pack-option small {
        font-size: 9px;
    }

    .pd-pack-option.selected {
        border-color: #73ce54;
        background: #e8f5e6;
    }

.pd-no-variants {
    color: #777;
    font-size: 12px;
    padding: 10px 0;
}

.pd-details-card {
    border: 1px solid #dedede;
    border-radius: 17px;
    background: #fff;
    overflow: hidden;
    margin-bottom: 7px;
}

.pd-section-toggle,
.pd-accordion-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fff;
    border: 0;
    color: #222;
    padding: 10px 11px;
    text-align: left;
    cursor: pointer;
    font-size: 11px;
}

.pd-section-toggle {
    color: #278d10;
    font-weight: 700;
    border-bottom: 1px solid #eee;
}

    .pd-section-toggle i,
    .pd-accordion-toggle i {
        font-size: 10px;
        transition: transform .2s;
    }

    .pd-section-toggle[aria-expanded="false"] i,
    .pd-accordion-toggle[aria-expanded="false"] i {
        transform: rotate(-90deg);
    }

.pd-details-panel {
    padding: 0 10px 10px;
}

    .pd-details-panel[hidden],
    .pd-accordion-panel[hidden] {
        display: none !important;
    }

.pd-service-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    padding: 0 0 9px;
}

.pd-service-item {
    min-height: 55px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 1px solid #eee;
    border-radius: 9px;
    background: #fafafa;
    text-align: center;
}

.pd-service-icon {
    font-size: 17px;
    color: #333;
    margin-bottom: 1px;
}

.pd-service-item strong {
    font-size: 10px;
    font-weight: 650;
}

.pd-service-item small {
    font-size: 8px;
    color: #777;
}

.pd-description strong {
    display: block;
    font-size: 10px;
    margin-bottom: 3px;
}

.pd-description p,
.pd-accordion-panel p {
    margin: 0;
    color: #555;
    font-size: 9px;
    line-height: 1.45;
}

.pd-accordion {
    border: 1px solid #e0e0e0;
    border-radius: 18px;
    background: #fff;
    margin-bottom: 6px;
    overflow: hidden;
}

.pd-accordion-toggle {
    min-height: 32px;
    padding: 8px 11px;
    font-size: 11px;
}

.pd-accordion-panel {
    padding: 0 11px 11px;
}

.pd-related-section {
    margin-top: 12px;
}

    .pd-related-section h2 {
        margin: 0 0 6px;
        font-size: 14px;
        font-weight: 750;
    }

.pd-related-list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 102px;
    gap: 7px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 5px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

    .pd-related-list::-webkit-scrollbar {
        display: none;
    }

.pd-related-card {
    min-width: 0;
    color: inherit;
    text-decoration: none;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
    scroll-snap-align: start;
    box-shadow: 0 1px 2px #0000000a;
}

.pd-related-image {
    height: 76px;
    position: relative;
    background: #fff;
}

    .pd-related-image img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
    }

.pd-related-heart {
    position: absolute;
    top: 3px;
    right: 4px;
    font-size: 10px;
    color: #444;
}

.pd-related-info {
    padding: 4px 6px 6px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px;
    font-size: 9px;
}

    .pd-related-info strong {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        font-size: 9px;
    }

    .pd-related-info small {
        color: #777;
        font-size: 8px;
    }

.pd-related-price {
    grid-column: 1;
    font-weight: 750;
    font-size: 10px;
}

/* Bottom purchase bar: same alignment pattern as .bottom-navigation */
.pd-purchase-bar {
    position: fixed;
    z-index: 30;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    min-height: 76px;
    padding: 10px 20px max(10px, env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid var(--pd-border);
    box-shadow: 0 -3px 12px rgba(0, 0, 0, .04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pd-purchase-price {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    font-size: 9px;
}

    .pd-purchase-price strong {
        font-size: 12px;
        font-weight: 750;
    }

    .pd-purchase-price small {
        color: #777;
        font-size: 8px;
    }

.pd-add-button {
    min-width: 162px;
    min-height: 48px;
    border: 0;
    border-radius: 28px;
    background: var(--pd-green);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 0 24px;
}

    .pd-add-button:disabled {
        cursor: default;
    }

@media (max-width: 430px) {
    .pd-purchase-bar {
        padding-left: 16px;
        padding-right: 16px;
    }

    .pd-add-button {
        min-width: 140px;
        padding: 0 18px;
    }
}

@media (max-width: 360px) {
    .pd-content {
        padding-left: 11px;
        padding-right: 11px;
    }

    .pd-hero {
        min-height: 245px;
    }

    .pd-purchase-bar {
        padding-left: 12px;
        padding-right: 12px;
        gap: 8px;
    }

    .pd-add-button {
        min-width: 115px;
        padding: 0 14px;
    }
}
