.single-product-page {
    background: #edf3f6;
    padding: 34px 0 70px;
}

/* Main layout container fix */
.single-product-page > .container,
.single-product-page .container {
    width: min(1180px, calc(100% - 28px)) !important;
    max-width: 1180px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

html.dark-mode .single-product-page,
body.dark-mode .single-product-page,
.dark-mode .single-product-page {
    --card: #111827;
    --text: #f8fafc;
    background: #061624;
}

.single-product-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #7b8794;
    margin-bottom: 20px;
    font-size: 14px;
}

.single-product-breadcrumb a {
    color: #168bd1;
    font-weight: 700;
    text-decoration: none;
}

.single-product-breadcrumb a:hover {
    color: #0f75b8;
}

.single-product-card {
    width: 100% !important;
    max-width: 100% !important;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-template-areas:
        "main buy"
        "details buy"
        "related buy";
    gap: 24px;
    align-items: start;
}

.single-product-main {
    grid-area: main;
}

.single-product-buy {
    grid-area: buy;
    position: sticky;
    top: 20px;
}

.single-product-details {
    grid-area: details;
}

.single-product-related {
    grid-area: related;
}

.single-product-main,
.buy-card,
.single-product-details,
.single-product-related {
    background: #ffffff;
    border: 1px solid #dfe8ee;
    border-radius: 20px;
    padding: 24px;
    min-width: 0;
    box-shadow: 0 14px 38px rgba(15, 39, 66, 0.06);
}

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

.single-product-icon {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #168bd1;
    color: #ffffff;
    font-size: 34px;
    overflow: hidden;
}

.single-product-icon.has-product-image {
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.single-product-icon.has-product-image img {
    width: 72px;
    height: 72px;
    display: block;
    object-fit: cover;
    border-radius: 12px;
}

.single-product-top h1 {
    font-size: 30px;
    line-height: 1.35;
    margin: 5px 0 14px;
    color: #17212f;
}

.single-product-badges,
.related-products-badges {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.single-product-badges span,
.related-products-badges span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 4px;
    padding: 5px 9px;
    font-size: 13px;
    font-weight: 900;
}

.badge-blue {
    background: #e8f7ff;
    color: #0f75b3;
    border: 1px solid rgba(15, 117, 179, 0.12);
}

.badge-green {
    background: #dff7e5;
    color: #18a043;
}

.badge-yellow {
    background: #fff2c2;
    color: #d08b00;
}

.badge-muted {
    background: #eef1f3;
    color: #a4aeb8;
}

.single-product-summary {
    margin-top: 22px;
    background: #f7fbfd;
    border-left: 4px solid #168bd1;
    padding: 16px;
    border-radius: 8px;
    color: #344456;
    font-weight: 700;
    line-height: 1.7;
}

.single-product-section h2 {
    font-size: 22px;
    margin: 0 0 12px;
    color: #17212f;
}

.single-product-content,
.product-html-content {
    color: #344456;
    line-height: 1.8;
    font-size: 16px;
    overflow-wrap: anywhere;
}

.product-html-content h1,
.product-html-content h2,
.product-html-content h3,
.product-html-content h4,
.product-html-content h5,
.product-html-content h6 {
    color: #17212f;
    line-height: 1.35;
    margin: 20px 0 10px;
}

.product-html-content p {
    margin: 0 0 14px;
}

.product-html-content a {
    color: #168bd1;
    font-weight: 700;
}

.product-html-content img,
.product-html-content iframe,
.product-html-content video {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.product-html-content ul,
.product-html-content ol {
    padding-left: 22px;
    margin: 0 0 16px;
}

.product-html-content li {
    margin-bottom: 7px;
}

.product-html-content blockquote {
    margin: 18px 0;
    padding: 16px 18px;
    border-left: 4px solid #168bd1;
    background: #f8fafc;
    color: #344456;
    border-radius: 8px;
}

.product-html-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    overflow: hidden;
}

.product-html-content table th,
.product-html-content table td {
    border: 1px solid #e2e8f0;
    padding: 10px;
    text-align: left;
}

.product-html-content table th {
    background: #f8fafc;
    color: #17212f;
}

.product-html-content pre,
.product-html-content code {
    background: #0f172a;
    color: #e5e7eb;
    border-radius: 8px;
}

.product-html-content pre {
    padding: 14px;
    overflow-x: auto;
}

.product-html-content code {
    padding: 2px 6px;
}

.product-html-content .content-button {
    display: inline-block;
    padding: 12px 20px;
    background: #168bd1;
    color: #ffffff !important;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 900;
}

.product-html-content .content-button:hover {
    background: #0f75b3;
    color: #ffffff !important;
}

.product-html-content .content-box {
    padding: 22px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    margin: 18px 0;
}

.product-html-content .content-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 18px 0;
}

.product-html-content .content-grid-item,
.product-html-content .faq-item {
    padding: 18px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.product-html-content .faq-item {
    margin-bottom: 12px;
}

.product-html-content .faq-item h3 {
    margin-top: 0;
}

.product-html-content .content-cta {
    padding: 28px;
    background: linear-gradient(135deg, #168bd1, #17212f);
    color: #ffffff;
    border-radius: 18px;
    margin: 22px 0;
}

.product-html-content .content-cta h1,
.product-html-content .content-cta h2,
.product-html-content .content-cta h3,
.product-html-content .content-cta p {
    color: #ffffff;
}

.buy-label {
    color: #7b8794;
    font-size: 14px;
    margin: 0 0 6px;
}

.buy-price {
    font-size: 34px;
    font-weight: 900;
    color: #111827;
    margin-bottom: 14px;
}

.buy-price span {
    font-size: 17px;
    color: #9ca3af;
    text-decoration: line-through;
    margin-left: 8px;
}

.buy-stock {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    background: #f7fbfd;
    border: 1px solid #e5edf3;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 18px;
}

.buy-stock span {
    color: #7b8794;
}

.buy-stock strong {
    color: #18a043;
}

.buy-card label {
    display: block;
    font-weight: 800;
    margin-bottom: 8px;
    color: #17212f;
}

.buy-card input {
    width: 100%;
    height: 44px;
    border: 1px solid #cfd8df;
    border-radius: 7px;
    padding: 0 12px;
    margin-bottom: 14px;
}

.buy-card button,
.external-buy-btn {
    width: 100%;
    min-height: 48px;
    border: 0;
    background: #28a745;
    color: #ffffff;
    border-radius: 12px;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.buy-card button:hover {
    background: #218838;
}

.external-buy-btn {
    background: #168bd1;
    text-decoration: none;
}

.external-buy-btn:hover {
    background: #0f75b3;
    color: #ffffff;
}

.out-stock-btn {
    background: #94a3b8 !important;
    cursor: not-allowed !important;
}

.buy-delivery-note {
    display: grid;
    gap: 10px;
    margin: 18px 0 2px;
    padding: 14px;
    background: linear-gradient(135deg, #f8fbff, #f0fdf4);
    border: 1px solid #e5edf3;
    border-radius: 14px;
}

.buy-delivery-note div {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #475569;
    font-size: 13px;
    line-height: 1.55;
}

.buy-delivery-note i {
    color: #168bd1;
    margin-top: 3px;
    width: 16px;
}

.buy-delivery-note strong {
    color: #17212f;
}

.product-meta-list {
    list-style: none;
    margin: 20px 0 0;
    padding: 0;
}

.product-meta-list li {
    border-top: 1px solid #edf3f6;
    padding: 12px 0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.product-meta-list li span {
    color: #7b8794;
}

.product-meta-list li strong {
    color: #17212f;
    text-align: right;
    overflow-wrap: anywhere;
}

.product-meta-list li strong a {
    color: #168bd1;
}

.product-meta-list li strong a:hover {
    text-decoration: underline;
}

/* Related products */
.pv-related-section-card {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(16, 24, 40, 0.10);
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(16, 24, 40, 0.06);
}

.pv-related-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(16, 24, 40, 0.10);
    background: linear-gradient(180deg, rgba(22, 163, 74, 0.07), transparent);
}

.pv-related-section-title h2 {
    margin: 0;
    color: #101828;
    font-size: 20px;
    line-height: 1.25;
    font-weight: 950;
    letter-spacing: -0.03em;
}

.pv-related-section-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    color: #667085;
    font-size: 13px;
    font-weight: 850;
    white-space: nowrap;
}

.pv-related-section-meta i {
    color: #16a34a;
}

.pv-related-products-list {
    display: grid;
    gap: 0;
    background: #ffffff;
}

.pv-related-product-row {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 16px 18px;
    background: #ffffff;
    border-bottom: 1px solid rgba(16, 24, 40, 0.08);
    transition: 0.18s ease;
}

.pv-related-product-row:last-child {
    border-bottom: 0;
}

.pv-related-product-row:hover {
    background: rgba(22, 163, 74, 0.035);
}

.pv-related-product-icon {
    width: 58px;
    height: 58px;
    border-radius: 17px;
    background: #ecfdf3;
    color: #15803d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 22px;
    text-decoration: none;
    flex: 0 0 auto;
}

.pv-related-product-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pv-related-product-info {
    min-width: 0;
}

.pv-related-product-info h3 {
    margin: 0;
    font-size: 16px;
    line-height: 1.35;
    font-weight: 950;
}

.pv-related-product-info h3 a {
    color: #101828;
    text-decoration: none;
}

.pv-related-product-info h3 a:hover {
    color: #15803d;
}

.pv-related-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 8px;
}

.pv-related-badges span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 850;
    line-height: 1;
}

.pv-related-badge-green {
    background: #ecfdf3;
    color: #15803d;
}

.pv-related-badge-yellow {
    background: #fffbeb;
    color: #b45309;
}

.pv-related-badge-muted {
    background: #f7f9fc;
    color: #667085;
    border: 1px solid rgba(16, 24, 40, 0.10);
}

.pv-related-product-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    min-width: 285px;
}

.pv-related-stock-price-line {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    width: auto;
    padding: 0;
    border: 0;
    background: transparent;
}

.pv-related-product-stock {
    color: #667085;
    font-size: 13px;
    font-weight: 850;
    white-space: nowrap;
}

.pv-related-product-price {
    color: #101828;
    font-size: 18px;
    font-weight: 950;
    white-space: nowrap;
    line-height: 1;
}

.pv-related-buy-btn {
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 10px 18px;
    border-radius: 13px;
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
    box-shadow: 0 10px 22px rgba(22, 163, 74, 0.18);
    transition: 0.18s ease;
}

.pv-related-buy-btn:hover {
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(22, 163, 74, 0.24);
}

/* Dark mode */
.dark-mode .single-product-main,
.dark-mode .buy-card,
.dark-mode .single-product-details,
.dark-mode .single-product-related,
.dark-mode .single-product-summary,
.dark-mode .buy-stock,
.dark-mode .pv-related-section-card,
.dark-mode .pv-related-products-list,
.dark-mode .pv-related-product-row {
    background: var(--card);
}

.dark-mode .pv-related-product-row:hover {
    background: rgba(15, 23, 42, .62);
}

.dark-mode .single-product-top h1,
.dark-mode .single-product-section h2,
.dark-mode .buy-price,
.dark-mode .buy-card label,
.dark-mode .product-meta-list li strong,
.dark-mode .product-html-content h1,
.dark-mode .product-html-content h2,
.dark-mode .product-html-content h3,
.dark-mode .product-html-content h4,
.dark-mode .product-html-content h5,
.dark-mode .product-html-content h6,
.dark-mode .pv-related-section-title h2,
.dark-mode .pv-related-product-info h3 a,
.dark-mode .pv-related-product-price {
    color: var(--text);
}

.dark-mode .single-product-content,
.dark-mode .single-product-summary,
.dark-mode .product-html-content,
.dark-mode .pv-related-section-meta,
.dark-mode .pv-related-product-stock {
    color: #cbd5e1;
}

.dark-mode .product-html-content blockquote,
.dark-mode .product-html-content .content-box,
.dark-mode .product-html-content .content-grid-item,
.dark-mode .product-html-content .faq-item,
.dark-mode .product-html-content table th {
    background: #0f2235;
    border-color: #1e3a56;
}

.dark-mode .product-html-content table th,
.dark-mode .product-html-content table td {
    border-color: #1e3a56;
}

.dark-mode .product-meta-list li strong a,
.dark-mode .product-html-content a {
    color: #7dd3fc;
}

.dark-mode .pv-related-section-head {
    border-color: rgba(255, 255, 255, 0.10);
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.11), transparent);
}

.dark-mode .pv-related-product-row {
    border-color: rgba(255, 255, 255, 0.08);
}

.dark-mode .pv-related-product-icon,
.dark-mode .pv-related-badge-green {
    background: rgba(34, 197, 94, 0.13);
    color: #86efac;
}

.dark-mode .pv-related-badge-yellow {
    background: rgba(250, 204, 21, 0.12);
    color: #fde68a;
}

.dark-mode .pv-related-badge-muted {
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.10);
}

/* Responsive */
@media (max-width: 980px) {
    .single-product-card {
        grid-template-columns: 1fr;
        grid-template-areas:
            "main"
            "buy"
            "details"
            "related";
    }

    .single-product-buy {
        position: static;
    }
}

@media (max-width: 820px) {
    .pv-related-section-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        padding: 16px;
    }

    .pv-related-section-meta {
        justify-content: flex-start;
        white-space: normal;
    }

    .pv-related-product-row {
        grid-template-columns: 52px minmax(0, 1fr);
        gap: 12px;
        align-items: start;
        padding: 16px;
    }

    .pv-related-product-icon {
        width: 50px;
        height: 50px;
        border-radius: 15px;
        font-size: 20px;
    }

    .pv-related-product-info h3 {
        font-size: 15px;
    }

    .pv-related-badges span {
        font-size: 10px;
        padding: 5px 7px;
    }

    .pv-related-product-action {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        width: 100%;
        min-width: 0;
        justify-content: stretch;
    }

    .pv-related-stock-price-line {
        width: 100%;
        justify-content: space-between;
        gap: 12px;
        padding: 0;
        margin: 0;
    }

    .pv-related-buy-btn {
        width: 100%;
        min-width: 100%;
        justify-self: stretch;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0;
    }
}

@media (max-width: 768px) {
    .product-html-content .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .buy-delivery-note {
        border-radius: 12px;
        padding: 12px;
    }

    .single-product-main,
    .buy-card,
    .single-product-details,
    .single-product-related {
        border-radius: 18px;
    }

    .buy-stock,
    .product-meta-list li {
        display: grid;
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .product-meta-list li strong {
        text-align: left;
    }
}

@media (max-width: 600px) {
    .single-product-page {
        padding: 22px 0 50px;
    }

    .single-product-page > .container,
    .single-product-page .container {
        width: min(100% - 20px, 1180px) !important;
    }

    .single-product-main,
    .buy-card,
    .single-product-details,
    .single-product-related {
        padding: 18px;
    }

    .single-product-top {
        grid-template-columns: 1fr;
    }

    .single-product-icon {
        width: 64px;
        height: 64px;
        font-size: 28px;
    }

    .single-product-icon.has-product-image img {
        width: 64px;
        height: 64px;
    }

    .single-product-top h1 {
        font-size: 22px;
    }

    .buy-price {
        font-size: 28px;
    }

    .single-product-badges,
    .related-products-badges {
        gap: 6px;
    }

    .single-product-badges span,
    .related-products-badges span {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .single-product-badges span {
        font-size: 11px;
        padding: 5px 8px;
    }
}