/* ==========================================================================
   DS Single Product Styles
   ========================================================================== */

.ds-single-product {
    max-width: var(--ds-container-width);
    margin: 0 auto;
    padding: 0 15px 40px;
}

.single-product .woocommerce-breadcrumb {
    max-width: var(--ds-container-width);
    padding: 24px 15px !important;
    margin: 0 auto !important;
}

.single-product .woocommerce-breadcrumb a {
    text-decoration: none !important;
}

.ds-single-product__top {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
    background: var(--ds-bg-white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--ds-shadow);
}

.ds-single-product__gallery {
    position: relative;
    width: 36%;
}

.ds-single-product__gallery>.images {
    float: unset !important;
    width: 100% !important;
    margin-bottom: 0 !important;
}

.ds-single-product__summary {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ds-single-product__bottom {
    background: var(--ds-bg-white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--ds-shadow);
}

/* Enhancing WC Elements */
.ds-single-product .product_title {
    font-size: 28px;
    font-weight: 700;
    color: var(--ds-text);
    margin-bottom: 24px;
    line-height: 1.3;
    text-align: left;
}

/* SKU + Stock Status Row */
.ds-single-product__sku-stock {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
    flex-wrap: wrap;
}

.ds-sku,
.ds-attribute {
    color: var(--ds-text-muted);
}

.ds-sku__label,
.ds-attribute__label {
    font-weight: 600;
    color: var(--ds-text);
}

.ds-sku__value,
.ds-attribute__value {
    color: var(--ds-text-muted);
}

.ds-stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.ds-stock__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.ds-stock--instock {
    color: #16a34a;
}

.ds-stock--instock .ds-stock__dot {
    background: #16a34a;
}

.ds-stock--outofstock {
    color: #dc2626;
}

.ds-stock--outofstock .ds-stock__dot {
    background: #dc2626;
}

/* Price */
.ds-single-product .price {
    font-size: 26px;
    font-weight: 700;
    color: var(--ds-primary) !important;
    margin-bottom: 24px;
    margin-top: 24px;
}

.ds-single-product .price del {
    color: var(--ds-text-muted);
    font-size: 18px;
    font-weight: 400;
}

.ds-single-product .price ins {
    text-decoration: none;
}

/* Add to Cart Form */
.ds-single-product form.cart {
    display: flex;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 40px !important;
}

.woocommerce div.product form.cart::before,
.woocommerce div.product form.cart::after {
    content: none !important;
}

.ds-single-product form.cart .quantity .qty {
    width: 50px;
    height: 100%;
    text-align: center;
    border: none;
    font-size: 18px;
    font-weight: 600;
    color: var(--ds-text);
    background: var(--ds-bg-qty);
    -moz-appearance: textfield;
    appearance: textfield;
    outline: none;
}

.ds-single-product form.cart .quantity .qty::-webkit-inner-spin-button,
.ds-single-product form.cart .quantity .qty::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ds-single-product button.single_add_to_cart_button {
    background: var(--ds-primary-gradient);
    color: var(--ds-bg-white);
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
    float: unset !important;
    width: calc((100% - 24px - 130px) / 2);
}

.ds-single-product button.single_add_to_cart_button:hover {
    background: var(--ds-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Buy Now Button */
.ds-single-product .ds-buy-now-btn {
    background: transparent;
    color: var(--ds-primary);
    border: 2px solid var(--ds-primary);
    padding: 10px 24px !important;
    border-radius: 8px !important;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.3 !important;
    flex: 1;
}

.ds-single-product .ds-buy-now-btn:hover {
    background: var(--ds-primary);
    color: var(--ds-bg-white);
}

/* Button sub-text */
.ds-single-product .ds-btn-sub {
    display: block;
    font-size: 11px;
    font-weight: 400;
    opacity: 0.85;
    margin-top: 2px;
}

/* Contact CTA Section */
.ds-single-product__contact {
    margin-top: 0;
    padding-top: 30px;
    border-top: 1px solid var(--ds-border);
}

.ds-single-product__contact-text {
    font-size: 14px;
    color: var(--ds-text-muted);
    line-height: 1.5;
    margin: 0 0 14px 0;
    font-style: italic;
    text-align: center;
}

.ds-single-product__contact-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.ds-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    width: calc((100% - 24px) / 3);
    justify-content: center;
    min-height: 50px;
}

.ds-contact-btn--zalo {
    background: #0068ff;
    color: #fff;
}

.ds-contact-btn--zalo:hover {
    background: #0054cc;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 104, 255, 0.3);
}

.ds-contact-btn--messenger {
    background: linear-gradient(135deg, #0695FF, #A334FA, #FF6968);
    color: #fff;
}

.ds-contact-btn--messenger:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(163, 52, 250, 0.3);
    opacity: 0.9;
}

.ds-contact-btn--hotline {
    background: #16a34a;
    color: #fff;
}

.ds-contact-btn--hotline:hover {
    background: #15803d;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.ds-contact-btn--hotline span {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.ds-contact-btn--hotline small {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.85;
}


.woocommerce div.product form.cart div.quantity.ds-qty-control,
.ds-single-product form.cart .ds-qty-control {
    display: flex;
    align-items: center;
    border: none;
    border-radius: 8px;
    overflow: hidden;
    width: fit-content;
    float: none;
    margin: 0;
    background: transparent;
    flex: 0 0 auto;
}

.ds-single-product form.cart .ds-qty-btn {
    width: 40px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ds-bg-qty, #f5f5f5);
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: 500;
    color: var(--ds-text);
    transition: background 0.15s;
    padding: 0;
    line-height: 1;
    user-select: none;
}

.ds-single-product form.cart .ds-qty-btn:hover {
    background: var(--ds-border);
}

.ds-single-product form.cart .ds-qty-btn:active {
    background: #ddd;
}

/* Description Section */
.ds-description-section {
    position: relative;
}

.ds-description-section__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--ds-text);
    margin: 0 0 20px 0;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--ds-border);
}

.ds-description-section__content {
    max-height: 300px;
    overflow: hidden;
    transition: max-height 0.4s ease;
    color: var(--ds-text);
    line-height: 1.8;
}

.ds-description-section__content.is-expanded {
    max-height: none;
}

.ds-description-section__content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.ds-description-section__fade {
    position: absolute;
    bottom: 52px;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, transparent, var(--ds-bg-white, #fff));
    pointer-events: none;
}

.ds-description-section__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
    margin-top: 16px;
    padding: 16px 24px;
    background: var(--ds-primary-gradient);
    border: 1px solid transparent;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: auto;
    margin-right: auto;
}

.ds-description-section__toggle:hover {
    background: var(--ds-primary-gradient-hover);
    color: var(--ds-primary);
    border-color: var(--ds-primary);
}

.ds-description-section__toggle svg {
    transition: transform 0.3s ease;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .ds-single-product__top {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .ds-single-product__gallery {
        width: 100%;
    }

    .ds-single-product__bottom {
        padding: 20px;
    }

    .ds-single-product form.cart {
        flex-wrap: wrap;
        margin-bottom: 32px !important;
    }

    .ds-single-product__contact-buttons {
        gap: 8px;
    }

    .ds-contact-btn--zalo,
    .ds-contact-btn--messenger {
        width: calc((100% - 8px) / 2);
    }

    .ds-contact-btn--hotline {
        width: 100%;
    }

    .ds-single-product .product_title {
        font-size: 22px;
        margin-bottom: 16px;
    }

    .ds-single-product .price {
        margin-bottom: 16px;
        margin-top: 16px;
    }

    .ds-single-product__contact {
        padding-top: 22px;
    }
}

/* Custom Gallery Styles */
.ds-single-product__main-image {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--ds-bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1/1;
}

.ds-single-product__main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ds-single-product__thumbnails {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
}

.ds-thumbnail {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.ds-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ds-thumbnail.active,
.ds-thumbnail:hover {
    border-color: var(--ds-primary);
}

.ds-product-badge.onsale {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--ds-danger);
    color: var(--ds-bg-white);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    z-index: 2;
}

/* ===== Related Products Section ===== */
section.related.products {
    max-width: var(--ds-container-width);
    margin: 0 auto;
    padding: 0 15px;
}

section.related.products>h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--ds-text);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--ds-border);
    margin-top: 0;
}