/* ============================================================
   Product details page (/p?pid=...) — scoped under .pd-page.
   Also restyles the shared _ProductAttributes partial inside .pd-attrs.
   ============================================================ */

.pd-page {
    --pd-navy: #173a75;
    --pd-navy-2: #214687;
    --pd-blue: #3066be;
    --pd-light: #f0f5ff;
    --pd-chip: #dae7ff;
    --pd-yellow: #ffd812;
    --pd-green: #0bb17a;
    --pd-text: #2b3a55;
    --pd-muted: #5f6f8c;
    --pd-border: #e1e8f5;

    padding: 28px 0 56px;
    color: var(--pd-text);
    background: var(--pd-light);
    overflow-x: hidden;
}

/* ---------- Breadcrumb ---------- */
.pd-page .pd-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    width: auto;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--pd-muted);
}

.pd-crumbs a {
    color: var(--pd-blue);
    text-decoration: none;
}

.pd-crumbs a:hover {
    text-decoration: underline;
}

.pd-crumbs .fa-chevron-right {
    font-size: 10px;
    opacity: .6;
}

.pd-crumb-current {
    max-width: 320px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--pd-text);
}

/* ---------- Gallery ---------- */
.pd-gallery {
    position: sticky;
    top: 20px;
}

.pd-main {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid var(--pd-border);
    border-radius: 24px;
    background: #fff;
    cursor: zoom-in;
}

.pd-main img {
    width: 100%;
    height: 100%;
    padding: 24px;
    object-fit: contain;
    transition: transform .2s ease;
}

.pd-save-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 1;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: var(--pd-green);
}

.pd-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    overflow-x: auto;
    scrollbar-width: none;
}

.pd-thumbs::-webkit-scrollbar {
    display: none;
}

.pd-thumb {
    flex: 0 0 78px;
    width: 78px;
    height: 78px;
    padding: 6px;
    border: 2px solid var(--pd-border);
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color .2s;
}

.pd-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pd-thumb:hover,
.pd-thumb.active {
    border-color: var(--pd-navy);
}

/* ---------- Info / buy box ---------- */
.pd-info {
    padding: 28px 30px;
    border: 1px solid var(--pd-border);
    border-radius: 24px;
    background: #fff;
}

.pd-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.pd-tag,
.pd-stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
}

.pd-tag {
    color: var(--pd-navy);
    background: var(--pd-chip);
}

.pd-stock-in {
    color: #08794f;
    background: #e3f7ee;
}

.pd-stock-out {
    color: #b42318;
    background: #fdecea;
}

.pd-title {
    margin: 0 0 6px;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--pd-navy);
}

.pd-code {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--pd-muted);
}

.pd-price-box {
    margin: 16px 0 18px;
    padding: 16px 18px;
    border-radius: 16px;
    background: var(--pd-light);
}

.pd-price-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 14px;
}

.pd-price {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    color: var(--pd-navy);
}

.pd-mrp {
    font-size: 15px;
    color: var(--pd-muted);
}

.pd-mrp s {
    color: #9aa4b8;
}

.pd-save {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: var(--pd-green);
}

.pd-save[hidden],
.pd-save-badge[hidden] {
    display: none;
}

.pd-tax {
    margin: 6px 0 0;
    font-size: 12.5px;
    color: var(--pd-muted);
}

.pd-offer {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    padding: 12px 14px;
    border-left: 4px solid var(--pd-yellow);
    border-radius: 0 12px 12px 0;
    font-size: 14px;
    background: #fffbe6;
}

.pd-offer i {
    margin-top: 3px;
    color: #c98a00;
}

/* ---------- Attributes partial (table + radio lists) ---------- */
.pd-attrs {
    margin-bottom: 18px;
}

.pd-attrs table,
.pd-attrs tbody,
.pd-attrs tr,
.pd-attrs td {
    display: block;
    width: 100%;
}

.pd-attrs tr + tr {
    margin-top: 14px;
}

.pd-attrs .text-prompt {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--pd-navy);
}

.pd-attrs .required {
    color: #d93025;
}

.pd-attrs .attribute-description {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--pd-muted);
}

.pd-attrs ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0 !important;
    list-style: none;
}

.pd-attrs li {
    margin: 0;
}

.pd-attrs .custom-radio,
.pd-attrs .custom-checkbox {
    position: relative;
    display: inline-flex;
    margin: 0;
    cursor: pointer;
}

.pd-attrs .custom-control-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.pd-attrs .custom-control-label {
    display: none;
}

.pd-attrs .custom-control-description {
    display: inline-block;
    padding: 9px 18px;
    border: 2px solid var(--pd-border);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--pd-text);
    background: #fff;
    transition: border-color .2s, background .2s, color .2s;
}

.pd-attrs .custom-radio:hover .custom-control-description,
.pd-attrs .custom-checkbox:hover .custom-control-description {
    border-color: var(--pd-blue);
}

.pd-attrs .custom-control-input:checked + .custom-control-description,
.pd-attrs .custom-control-input:checked ~ .custom-control-description {
    border-color: var(--pd-navy);
    color: var(--pd-navy);
    background: var(--pd-chip);
}

.pd-attrs .custom-control-input:focus-visible ~ .custom-control-description {
    box-shadow: 0 0 0 3px rgba(48, 102, 190, .25);
}

.pd-attrs .custom-control-input:disabled ~ .custom-control-description {
    opacity: .45;
    cursor: not-allowed;
    text-decoration: line-through;
}

.pd-attrs select,
.pd-attrs input.form-control,
.pd-attrs textarea {
    max-width: 340px;
    padding: 10px 12px;
    border: 1.5px solid var(--pd-border);
    border-radius: 12px;
    font-size: 14.5px;
}

.pd-attrs .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

/* ---------- Quantity + add to bag ---------- */
.pd-buy-row {
    display: flex;
    align-items: flex-end;
    gap: 14px;
}

.pd-qty-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--pd-navy);
}

.pd-qty-ctrl {
    display: inline-flex;
    align-items: center;
    height: 52px;
    border: 2px solid var(--pd-border);
    border-radius: 999px;
    background: #fff;
}

.pd-qty-ctrl button {
    width: 44px;
    height: 100%;
    border: 0;
    font-size: 13px;
    color: var(--pd-navy);
    background: transparent;
    cursor: pointer;
}

.pd-qty-ctrl button:hover {
    color: var(--pd-blue);
}

.pd-qty-ctrl input {
    width: 42px;
    height: 100%;
    padding: 0;
    border: 0;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    color: var(--pd-navy);
    background: transparent;
    outline: none;
}

.pd-add {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 52px;
    padding: 0 24px;
    border: 0;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 700;
    color: #1c2430;
    background: var(--pd-yellow);
    box-shadow: 0 10px 22px rgba(255, 216, 18, .35);
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, transform .15s;
}

.pd-add:hover {
    color: #1c2430;
    background: #ffe04a;
    transform: translateY(-1px);
    text-decoration: none;
}

.pd-add:disabled {
    color: #7a8499;
    background: #e7ebf3;
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
}

.pd-error:empty {
    display: none;
}

.pd-error {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    color: #b42318;
    background: #fdecea;
}

/* ---------- Perks + share ---------- */
.pd-perks {
    display: grid;
    gap: 10px;
    margin: 22px 0 0;
    padding: 18px 0 0;
    border-top: 1px solid #eef2f9;
    list-style: none;
}

.pd-perks li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--pd-muted);
}

.pd-perks i {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: var(--pd-navy);
    background: var(--pd-chip);
}

.pd-perks b {
    color: var(--pd-navy);
}

.pd-share {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--pd-muted);
}

.pd-share-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--pd-border);
    border-radius: 50%;
    font-size: 15px;
    color: var(--pd-navy);
    background: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.pd-share-btn:hover {
    color: #fff;
    background: var(--pd-navy);
}

.pd-wa:hover { background: #25d366; border-color: #25d366; }
.pd-fb:hover { background: #1877f2; border-color: #1877f2; }

.pd-copied {
    font-size: 12.5px;
    color: var(--pd-green);
}

/* ---------- Tabs ---------- */
.pd-tabs-wrap {
    margin-top: 40px;
    border: 1px solid var(--pd-border);
    border-radius: 24px;
    background: #fff;
    overflow: hidden;
}

.pd-tabs {
    display: flex;
    gap: 6px;
    padding: 10px 12px 0;
    border-bottom: 1px solid var(--pd-border);
    overflow-x: auto;
    scrollbar-width: none;
}

.pd-tabs::-webkit-scrollbar {
    display: none;
}

.pd-tab {
    flex: 0 0 auto;
    padding: 12px 18px;
    border: 0;
    border-bottom: 3px solid transparent;
    font-size: 15px;
    font-weight: 700;
    color: var(--pd-muted);
    background: transparent;
    cursor: pointer;
    transition: color .2s, border-color .2s;
}

.pd-tab:hover {
    color: var(--pd-navy);
}

.pd-tab.active {
    color: var(--pd-navy);
    border-bottom-color: var(--pd-yellow);
}

.pd-panel {
    padding: 26px 30px 30px;
}

/* admin-authored HTML inside the tabs */
.pd-rich {
    font-size: 15.5px;
    line-height: 1.75;
    color: var(--pd-text);
    overflow-wrap: anywhere;
}

.pd-rich h1, .pd-rich h2, .pd-rich h3, .pd-rich h4 {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--pd-navy);
}

.pd-rich p {
    margin: 0 0 12px;
}

.pd-rich ul, .pd-rich ol {
    margin: 0 0 12px;
    padding-left: 20px;
}

.pd-rich img,
.pd-rich iframe,
.pd-rich table {
    max-width: 100%;
    height: auto;
}

.pd-rich table {
    display: block;
    overflow-x: auto;
    border-collapse: collapse;
}

.pd-rich td, .pd-rich th {
    padding: 8px 10px;
    border: 1px solid var(--pd-border);
}

/* ---------- Help strip ---------- */
.pd-help {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 28px;
    padding: 24px 28px;
    border-radius: 20px;
    color: #fff;
    background:
        radial-gradient(circle at 100% 0%, rgba(255, 216, 18, .2), transparent 40%),
        linear-gradient(120deg, var(--pd-navy), var(--pd-blue));
}

.pd-help h3 {
    margin: 0 0 4px;
    font-size: 19px;
    font-weight: 700;
    color: #fff;
}

.pd-help p {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, .85);
}

.pd-help-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pd-help-actions a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 2px solid rgba(255, 255, 255, .7);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.pd-help-actions a:hover {
    color: var(--pd-navy);
    background: #fff;
}

.pd-help-actions .pd-help-primary {
    color: #1c2430;
    border-color: var(--pd-yellow);
    background: var(--pd-yellow);
}

.pd-help-actions .pd-help-primary:hover {
    color: #1c2430;
    border-color: #ffe04a;
    background: #ffe04a;
}

/* ---------- Not found ---------- */
.pd-missing {
    max-width: 520px;
    margin: 20px auto;
    padding: 48px 28px;
    border: 1px solid var(--pd-border);
    border-radius: 24px;
    text-align: center;
    background: #fff;
}

.pd-missing > i {
    margin-bottom: 14px;
    font-size: 46px;
    color: var(--pd-blue);
}

.pd-missing h1 {
    margin: 0 0 8px;
    font-size: 24px;
    color: var(--pd-navy);
}

.pd-missing p {
    margin: 0 0 20px;
    color: var(--pd-muted);
}

.pd-missing .pd-add {
    display: inline-flex;
    flex: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .pd-gallery {
        position: static;
    }

    .pd-main {
        max-width: 560px;
        margin: 0 auto;
    }

    .pd-thumbs {
        justify-content: center;
    }

    .pd-title {
        font-size: 26px;
    }
}

@media (max-width: 767px) {
    .pd-page {
        padding: 20px 0 40px;
    }

    .pd-page .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .pd-crumb-current {
        max-width: 180px;
    }

    .pd-main {
        border-radius: 18px;
    }

    .pd-main img {
        padding: 14px;
    }

    .pd-thumb {
        flex-basis: 64px;
        width: 64px;
        height: 64px;
    }

    .pd-info {
        padding: 20px 18px;
        border-radius: 18px;
    }

    .pd-title {
        font-size: 22px;
    }

    .pd-price {
        font-size: 27px;
    }

    .pd-buy-row {
        gap: 10px;
    }

    .pd-qty-ctrl,
    .pd-add {
        height: 48px;
    }

    .pd-qty-ctrl button {
        width: 38px;
    }

    .pd-add {
        padding: 0 16px;
        font-size: 15px;
    }

    .pd-tabs-wrap {
        margin-top: 24px;
        border-radius: 18px;
    }

    .pd-tab {
        padding: 11px 12px;
        font-size: 14px;
    }

    .pd-panel {
        padding: 20px 18px 22px;
    }

    .pd-rich {
        font-size: 15px;
    }

    .pd-help {
        flex-direction: column;
        align-items: flex-start;
        padding: 22px 18px;
    }

    .pd-help-actions,
    .pd-help-actions a {
        width: 100%;
        justify-content: center;
    }
}
