.product-detail-page {
    padding-top: 150px;
    padding-bottom: 60px;
    font-family: 'Montserrat', sans-serif;
    color: #333;
}

.breadcrumb {
    margin-bottom: 24px;
}

.breadcrumb .back-link {
    text-decoration: none;
    color: #666;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
}

.breadcrumb .back-link:hover {
    color: #000;
}

.product-detail-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    margin-bottom: 60px;
}

/* CỘT TRÁI */
.product-gallery {
    margin-bottom: 32px;
}

.main-img-wrapper {
    background: #f9f9f9;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    border: 1px solid #eee;
    max-height: 550px;
    width: 100%;
}

.main-img-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

.gallery-thumbs {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.gallery-thumbs .thumb {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.3s, opacity 0.3s;
    background: #f9f9f9;
}

.gallery-thumbs .thumb:hover {
    border-color: #999;
}

.gallery-thumbs .thumb.active {
    border-color: #ED7E19;
    background-color: #ED7E19;
    opacity: 0.8;
}

.product-promo-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
}

.product-promo-box h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #ED7E19;
}

.product-promo-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.product-promo-box ul li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 16px;
    color: #4a5568;
}

.product-promo-box ul li .promo-icon {
    width: 20px;
    height: 20px;
}

/* CỘT PHẢI */
.product-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: break-word;
}

.product-price {
    font-size: 24px;
    font-weight: 800;
    color: #ED7E19;
    margin-bottom: 20px;
}

.btn-compare {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    background: #fff;
    white-space: nowrap;
}

.btn-compare:hover {
    border-color: #ED7E19;
    color: #ED7E19;
    background: rgba(237, 126, 25, 0.05);
}

.btn-compare i {
    font-size: 14px;
}


.product-colors-select {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.product-colors-select .label {
    font-weight: 600;
    font-size: 16px;
}

.color-options {
    display: flex;
    gap: 12px;
}

.color-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.color-btn.active {
    border-color: #ED7E19;
    background: #fff5f5;
    color: #fff;
    background-color: #ED7E19;
    opacity: 0.8;
}

.color-swatch {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #eee;
}

.color-swatch.white {
    background: #fff;
}

.color-swatch.grey {
    background: #888;
}

.detail-info-tabs,
.smart-features {
    margin-bottom: 32px;
}

.detail-info-tabs h3,
.smart-features h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eee;
}

.detail-info-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.attributes-table {
    width: 100%;
    min-width: 300px;
    /* Prevent it from shrinking too much */
    border-collapse: collapse;
}

.attributes-table tr td {
    padding: 12px 16px;
    font-size: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.attributes-table tr td:first-child {
    font-weight: 600;
    color: #64748b;
    width: 40%;
}

.attributes-table tr:nth-child(even) {
    background: #f8fafc;
}

/* Unify Specs & Features Scroll area */
.product-info-scroll-wrapper {
    max-height: 450px;
    overflow-y: auto;
    padding-right: 15px;
    margin-bottom: 24px;
    border-bottom: 1px solid #eee;
}

.product-info-scroll-wrapper::-webkit-scrollbar {
    width: 6px;
}

.product-info-scroll-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.product-info-scroll-wrapper::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.product-info-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.inner-specs-table {
    width: 100%;
    border-collapse: collapse;
}

/* Warranty Table Styles */
.warranty-table-wrapper {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
    margin-top: 10px;
}

.warranty-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}

.warranty-table th {
    background: #fff;
    color: #333;
    font-weight: 700;
    padding: 15px 10px;
    text-align: center;
    border-bottom: 2px solid #f0f0f0;
}

.warranty-table td {
    padding: 12px 10px;
    text-align: center;
    color: #666;
    border-bottom: 1px solid #f9f9f9;
    vertical-align: middle;
}

.warranty-table tr:nth-child(even) td {
    background: #f8fafc;
}

.warranty-table tr:last-child td {
    border-bottom: none;
}

.inner-specs-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
}

.inner-specs-table tr td:first-child {
    font-weight: 600;
    color: #64748b;
    width: 40%;
}

.product-actions-bar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.qty-selector {
    display: flex;
    align-items: center;
    gap: 16px;
}

.qty-selector .label {
    font-weight: 600;
    font-size: 16px;
}

.qty-controls {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.qty-controls button {
    width: 40px;
    height: 40px;
    border: none;
    background: #f8fafc;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.3s;
}

.qty-controls button:hover {
    background: #e2e8f0;
}

.qty-controls input {
    width: 50px;
    height: 40px;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    outline: none;
}

.action-buttons {
    display: flex;
    gap: 16px;
}

.btn-buy-now {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    background: #4a5568;
    color: white;
    text-decoration: none;
    font-weight: 700;
    border-radius: 8px;
    transition: opacity 0.3s;
}

.btn-call-consult {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60px;
    background: #0099ff;
    color: white;
    text-decoration: none;
    font-weight: 700;
    border-radius: 8px;
    transition: opacity 0.3s;
}

.btn-call-consult small {
    font-size: 10px;
    font-weight: 400;
    opacity: 0.9;
}

.btn-buy-now,
.btn-call-consult {
    font-size: 20px;
}

.btn-buy-now:hover,
.btn-call-consult:hover {
    opacity: 0.9;
}

/* SECTION COMMON */
.section-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    padding: 50px 0 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #ED7E19;
}

/* INTRO SECTION */
.product-intro-section {
    background: #fff;
    padding: 60px 0;
}

.video-container {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.video-placeholder {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
}

.video-placeholder img {
    width: 100%;
    display: block;
    display: flex;
    justify-content: center;
}

.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: #ED7E19;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s;
}

.play-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

/* STOCK BADGE */
.stock-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.stock-badge.in_stock {
    background: #e6fffa;
    color: #2c7a7b;
}

.stock-badge.out_of_stock {
    background: #fff5f5;
    color: #c53030;
}

/* FEATURES LIST */
.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.features-list li {
    font-size: 16px;
    color: #4a5568;
    display: flex;
    align-items: center;
    /* padding: 12px 16px; */
    border-bottom: 1px solid #f1f5f9;
    line-height: 1.4;
}

.features-list li:last-child {
    border-bottom: none;
}

.features-list li .f-label {
    font-weight: 600;
    color: #64748b;
    width: 40%;
    padding: 12px 16px;
    flex-shrink: 0;
}

.features-list li .f-value {
    color: #333;
    flex: 2;
    padding: 12px 16px;
}

.features-list li .f-full {
    font-weight: 600;
    color: #333;
}

/* CUSTOM CONTENT BLOCKS */
.custom-content-blocks {
    display: flex;
    flex-direction: column;
    gap: 80px;
    margin-top: 40px;
}

.custom-block .block-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 40px;
    text-align: left;
    word-break: break-word;
    /* Force wrapping on long words */
    overflow-wrap: break-word;
}

.custom-block {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    /* Prevent anything from popping out */
}

.custom-block .block-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    /* Reduced gap a bit */
    align-items: center;
}

.custom-block.block-2 .block-body {
    direction: rtl;
}

.custom-block.block-2 .block-text {
    direction: ltr;
}

.block-image img {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
}

.block-text {
    font-size: 16px;
    line-height: 1.8;
    word-break: break-word;
    /* Ensure long words wrap */
    overflow-wrap: break-word;
}

.block-text * {
    max-width: 100% !important;
    /* Prevent inner elements from being wider than parent */
    height: auto !important;
}

/* RESPONSIVE */
@media (max-width: 992px) {
    .product-detail-main {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .product-title {
        font-size: 28px;
    }
}

@media (max-width: 576px) {
    .action-buttons {
        flex-direction: column;
    }

    .product-colors-select {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* FIXES FROM USER FEEDBACK */
.breadcrumb .back-link {
    display: inline-flex;
    align-items: center;
    padding-top: 10px !important;
    /* Reduced from 40px */
    width: auto;
    margin-top: 0;
}

.exclusive-services-list {
    margin: 0;
    padding-left: 1.2em;
    list-style: disc;
}

.exclusive-services-list li {
    margin-bottom: 4px;
    color: #444;
}

.product-colors-select .color-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.product-colors-select .color-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    background: #fff;
    padding: 6px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    color: #333;
}

.product-colors-select .color-btn.active {
    border-color: #ED7E19;
    color: #ED7E19;
    background: rgba(237, 126, 25, 0.05);
    font-weight: 600;
}

.video-container {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.video-container iframe,
.video-container video {
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: block;
    width: 100%;
    /* Force responsive width */
    max-width: 100%;
}

/* CORRECT IMAGE CENTERING */
.block-image {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    width: 100%;
}

.block-image img {
    max-width: 100%;
    height: auto;
    width: auto;
    /* Allow it to be smaller than 100% if needed */
    display: block;
}

.block-text {
    /* Allow WordPress alignment classes and inline styles to work */
    text-align: inherit;
}

/* WORDPRESS ALIGNMENT SUPPORT */
.block-text p {
    margin-bottom: 1em;
}

.block-text .aligncenter,
.block-text .has-text-align-center {
    text-align: center !important;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.block-text .alignleft,
.block-text .has-text-align-left {
    text-align: left !important;
}

.block-text .alignright,
.block-text .has-text-align-right {
    text-align: right !important;
}

.block-text .alignjustify,
.block-text .has-text-align-justify {
    text-align: justify !important;
}

/* ADDITIONAL RESPONSIVE FIXES */
@media (max-width: 768px) {
    .product-detail-page {
        padding-top: 30px;
    }

    .custom-block .block-body {
        display: flex;
        flex-direction: column !important;
        gap: 30px;
    }

    .custom-block.block-2 .block-body {
        flex-direction: column !important;
        /* Remove RTL reverse on mobile */
    }

    .custom-block .block-title {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .features-list {
        grid-template-columns: 1fr;
    }

    .attributes-table tr td:first-child {
        width: 35%;
        padding: 10px;
    }

    .attributes-table tr td {
        padding: 10px;
        font-size: 13px;
    }

    .product-actions-bar {
        gap: 15px;
    }

    .qty-selector {
        justify-content: space-between;
    }

    .action-buttons {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .btn-buy-now,
    .btn-call-consult {
        height: 50px;
        font-size: 20px;
        width: 100%;
        padding: 15px;
    }

    .video-container iframe,
    .video-container video {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .product-title {
        font-size: 22px;
    }

    .product-price {
        font-size: 20px;
    }

    .main-img-wrapper {
        aspect-ratio: 1/1;
    }

    .gallery-thumbs .thumb {
        width: 60px;
        height: 60px;
    }
}

/* PRODUCT GRID RESPONSIVE */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 30px;
}

@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

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