/* =========================================
   SINGLE PRODUCT
   ========================================= */

.dph-single-product-wrapper {
    background: #fff;
    padding: 2rem 0;
}

.dph-container {
    width: min(1300px, calc(100% - 40px));
    margin: 2rem auto 0;
}

/* =========================================
   BREADCRUMB
   ========================================= */

.dph-breadcrumb {
    margin-bottom: 2rem;
}

.dph-breadcrumb .woocommerce-breadcrumb {
    margin: 0;
    font-size: 14px;
    color: #777;
}

.dph-breadcrumb a {
    color: #777;
    text-decoration: none;
}

.dph-breadcrumb a:hover {
    color: #f99e00;
}


/* =========================================
   PRODUCT LAYOUT
   ========================================= */

.dph-product-detail-grid {
    display: grid;
    /* minmax(0,1fr): cột gallery không được nới rộng theo nội dung
       (FlexSlider set slide width rất lớn -> track 1fr sẽ phình ra). */
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 4rem;
    margin-bottom: 5rem;
    align-items: start;
}


/* =========================================
   PRODUCT GALLERY
   ========================================= */

.dph-product-gallery {
    position: sticky;
    top: 100px;
    min-width: 0;
}

/*
 * WooCommerce Gallery — Không ghi đè layout FlexSlider
 * Chỉ custom border-radius, thumbnail styles; phần còn lại để WC tự xử.
 */

.dph-product-gallery .woocommerce-product-gallery {
    width: 100% !important;
    margin: 0 !important;
}

/* Khung ảnh chính cố định 1:1 cho mọi sản phẩm.
   Đặt aspect-ratio lên SLIDE, không đặt lên .flex-viewport:
   FlexSlider gán height inline cho .flex-viewport, nếu để aspect-ratio
   ở đó trình duyệt sẽ suy ngược ra chiều rộng -> gallery phình to. */
.dph-product-gallery .woocommerce-product-gallery__wrapper>.woocommerce-product-gallery__image {
    aspect-ratio: 1 / 1;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.dph-product-gallery .woocommerce-product-gallery .flex-viewport,
.dph-product-gallery .woocommerce-product-gallery__wrapper>.woocommerce-product-gallery__image:only-child {
    border-radius: 12px;
    overflow: hidden;
    background: #f9f9f5;
    border: 1px solid #e5e7eb;
}

/* Main image – nằm gọn trong khung, phần thừa là nền kem */
.dph-product-gallery .woocommerce-product-gallery .woocommerce-product-gallery__image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

/* Zoom icon */
.dph-product-gallery .woocommerce-product-gallery__trigger {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Gallery thumbnails */

.dph-product-gallery .flex-control-thumbs {
    display: flex !important;
    gap: 10px;
    margin-top: 1rem !important;
    justify-content: flex-start;
    padding: 0;
    overflow-x: auto;
    list-style: none;
}

.dph-product-gallery .flex-control-thumbs li {
    width: 72px !important;
    height: 72px;
    flex: 0 0 72px;
    margin: 0 !important;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.dph-product-gallery .flex-control-thumbs li:hover,
.dph-product-gallery .flex-control-thumbs li .flex-active {
    border-color: #ffa000;
}

.dph-product-gallery .flex-control-thumbs li img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    border-radius: 6px;
}

.dph-product-gallery .flex-control-thumbs li img.flex-active {
    border: 2px solid #ffa000;
    border-radius: 6px;
}

/* =========================================
   NÚT CHUYỂN SLIDE TRÁI / PHẢI (flex-direction-nav)
   ========================================= */

.dph-product-gallery .woocommerce-product-gallery {
    position: relative;
}

/* Lớp phủ trùng khít khung ảnh vuông để canh nút vào giữa ảnh */
.dph-product-gallery .flex-direction-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    aspect-ratio: 1 / 1;
    pointer-events: none;
    z-index: 9;
}

.dph-product-gallery .flex-direction-nav li {
    margin: 0;
}

.dph-product-gallery .flex-direction-nav a {
    pointer-events: auto;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    color: #12171d;
    opacity: 1;
    font-size: 0;
    /* ẩn chữ "Next" / "Previous", chỉ giữ mũi tên ở ::before */
    text-indent: 0;
    overflow: hidden;
    transition: background 0.2s ease;
}

.dph-product-gallery .flex-direction-nav a:hover {
    background: #fff;
}

.dph-product-gallery .flex-direction-nav .flex-prev {
    left: 12px;
}

.dph-product-gallery .flex-direction-nav .flex-next {
    right: 12px;
}

/* Vẽ mũi tên bằng border, ghi đè font-icon mặc định của FlexSlider */
.dph-product-gallery .flex-direction-nav a::before {
    content: '';
    width: 10px;
    height: 10px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    color: inherit;
}

.dph-product-gallery .flex-direction-nav .flex-prev::before {
    transform: rotate(45deg);
    margin-left: 4px;
}

.dph-product-gallery .flex-direction-nav .flex-next::before {
    transform: rotate(-135deg);
    margin-right: 4px;
}

.dph-product-gallery .flex-direction-nav .flex-disabled {
    opacity: 0.35;
    cursor: default;
}




/* =========================================
   PRODUCT INFO
   ========================================= */

.dph-product-summary {
    min-width: 0;
}


/* =========================================
   PRODUCT TITLE
   ========================================= */

.dph-product-title {
    font-size: 25px;
    font-weight: 400;
    line-height: 1.25;
    color: #222;
    margin: 0 0 0.875rem;
}


/* =========================================
   RATING + SKU
   ========================================= */

.dph-meta-rating {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.dph-rating-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}


/* WooCommerce star */


.dph-rating-box .star-rating {
    margin: 0;
    font-size: 16px;
    width: 5.5em;
}

.dph-rating-box .star-rating span::before {
    color: #fbbf24;
}


/* Empty rating */

.dph-rating-box .dph-stars-empty {
    color: #d1d5db;
}

.dph-rating-box .dph-stars-empty::before {
    color: #d1d5db;
}

.dph-rating-box .dph-stars-empty span {
    width: 100%;
}

.dph-review-link {
    font-size: 14px;
    color: #f99e00;
    text-decoration: none;
}

.dph-review-link:hover {
    text-decoration: underline;
}

.dph-separator {
    color: #d1d5db;
}

.dph-sku {
    font-size: 14px;
    color: #777;
}

.dph-sku strong {
    color: #555;
    font-weight: 600;
}


/* =========================================
   PRICE
   ========================================= */

.dph-price-box {
    display: flex;
    align-items: baseline;
    gap: 0.875rem;
    margin-bottom: 1.5rem;

}

.dph-price-main {
    font-size: 25px;
    font-weight: 600;
    line-height: 1.2;
    color: #f99e00;
    display: flex;
    flex-direction: row-reverse;
    gap: 10px;
}


/*
 * WooCommerce price
 */

.dph-price-main .price {
    margin: 0;
    color: inherit;
}

.woocommerce:where(body:not(.woocommerce-uses-block-theme)) ul.products li.product .price {
    color: #22C55E;
}

.dph-price-main .price del {
    font-size: 16px;
    font-weight: 400;
    color: #888;
    margin-left: 10px;
}

.dph-price-main .price ins {
    text-decoration: none;
}


/* =========================================
   SHORT DESCRIPTION
   ========================================= */

.dph-short-description {
    font-size: 14px;
    color: #777;
    line-height: 1.75;
    margin-bottom: 1.5rem;
}

.dph-short-description p {
    margin: 0 0 1rem;
}

.dph-short-description p:last-child {
    margin-bottom: 0;
}

/* =========================================
   ADD TO CART
   ========================================= */

.dph-add-to-cart-form {
    margin-top: 1.5rem;
}

.woocommerce div.product p.stock {
    display: none;
}

.dph-add-to-cart-form form.cart::before,
.dph-add-to-cart-form form.cart::after {
    content: none !important;
}

.dph-add-to-cart-form form.cart {
    display: flex;
    /* flex-direction: column; */
    align-items: self-start;
    gap: 25px;
    margin: 0;

}


/* =========================================
   QUANTITY - SIZE NHỎ GỌN
   ========================================= */

.dph-add-to-cart-form .quantity {
    display: flex;
    align-items: center;
    height: 40px;
    margin: 0 !important;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    flex-shrink: 0;
}

.dph-add-to-cart-form .qty-minus,
.dph-add-to-cart-form .qty-plus {
    width: 36px;
    height: 40px;
    padding: 0;
    border: 0;
    background: #f3f4f6;
    color: #111827;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dph-add-to-cart-form .qty-minus:hover,
.dph-add-to-cart-form .qty-plus:hover {
    background: #e5e7eb;
}

.dph-add-to-cart-form .quantity .qty {
    width: 48px;
    height: 40px;
    padding: 0;
    margin: 0;
    border: 0;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    border-radius: 0;
    background: #fff;
    color: #111827;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    outline: none;
    box-shadow: none;
}

/* Ẩn spinner mặc định của input number */

.dph-add-to-cart-form .quantity .qty::-webkit-inner-spin-button,
.dph-add-to-cart-form .quantity .qty::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.dph-add-to-cart-form .quantity .qty {
    -moz-appearance: textfield;
}



/* Quantity */




/* Add to cart button */

.dph-add-to-cart-form button.single_add_to_cart_button.button.alt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 36%;
    min-height: 48px;
    padding: 0 1.5rem;
    border: none;
    border-radius: 0px;
    background: linear-gradient(135deg,
            #f99e00,
            #FF6B00);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50px;
}

.dph-add-to-cart-form button.single_add_to_cart_button.button.alt::before {
    content: "";
    display: inline-block;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='20' r='1'/%3E%3Ccircle cx='20' cy='20' r='1'/%3E%3Cpath d='M1 1h4l2.6 12.4a2 2 0 0 0 2 1.6h9.7a2 2 0 0 0 2-1.7L23 6H6'/%3E%3C/svg%3E");

    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.dph-add-to-cart-form button.single_add_to_cart_button.button.alt:hover {
    background: linear-gradient(135deg,
            #ea8d00,
            #FF6B00);
    color: #fff;
    transform: translateY(-2px);
}


/* =========================================
   DIVIDER
   ========================================= */

.dph-divider {
    border: 0;
    border-top: 1px solid #e5e5e5;
    margin: 0 0 1.25rem;
}


/* =========================================
   PRODUCT META
   ========================================= */

.dph-product-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1.25rem;
}

.dph-product-meta p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 14px;
}

.dph-product-meta strong {
    color: #222;
    min-width: 80px;
}

.dph-product-meta span {
    color: #777;
}

.dph-product-meta a {
    color: #777;
    text-decoration: none;
}

.dph-product-meta a:hover {
    color: #f99e00;
}



/* =========================================
   PRODUCT TABS
   ========================================= */
.dqh-product-tabs-container {
    background-color: #f3f4f6;
    margin: 5rem 0 0;
}

.dph-product-tabs-wrapper {
    max-width: 1300px;
    margin: 0 auto;
    padding: 40px 0;
}

/* Hàng tab nằm ngang, canh giữa */
.dph-product-tab-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    border-bottom: 1px solid #E5E7EB;
    margin-bottom: 30px;
}

/* Xoá nền và border của button, canh chữ giữa */
.dph-product-tab-title {
    background: none;
    border: none;
    outline: none;
    padding: 18px 4px;
    font-size: 20px;
    font-weight: 500;
    color: #6B7280;
    cursor: pointer;
    position: relative;
    text-align: center;
    transition: color 0.25s ease;
}

.dph-product-tab-title.active {
    color: #fe9900;
    border-bottom: 2px solid #fe9900;
}

/* Hover cho cả 2 button */
.dph-product-tab-title:hover {
    color: #F97316;
}

/* Khung content trắng bên dưới, canh giữa nội dung */
.dph-product-tab-content-wrapper {
    background-color: #FFFFFF;
    border-radius: 10px;
    padding: 30px 50px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dph-product-tab-content {
    display: none;
    line-height: 1.75;
    color: #374151;
    font-size: 15px;
    margin-bottom: 30px;
}

.dph-product-tab-content.active {
    display: block;
}

.dph-product-tab-content:last-child {
    margin-bottom: 0;
}

.dph-product-tab-content h2,
.dph-product-tab-content h3 {
    color: #111827;
    margin-top: 20px;
    margin-bottom: 10px;
}

.dph-product-tab-content p {
    margin-bottom: 12px;
}

/* Bảng Attributes */
.dph-product-tab-content table.shop_attributes {
    width: 100%;
    border-collapse: collapse;
}

.dph-product-tab-content table.shop_attributes th,
.dph-product-tab-content table.shop_attributes td {
    padding: 12px 16px;
    border-bottom: 1px solid #E5E7EB;
    text-align: left;
    font-size: 14px;
}

.dph-product-tab-content table.shop_attributes th {
    width: 200px;
    color: #6B7280;
    font-weight: 600;
}

.dph-product-tab-content table.shop_attributes td {
    color: #111827;
}

.dph-product-tab-content table.shop_attributes tr:last-child th,
.dph-product-tab-content table.shop_attributes tr:last-child td {
    border-bottom: none;
}

.dph-review-summary {
    display: flex;
    gap: 60px;
    padding: 30px;
    margin-bottom: 30px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.dph-review-average {
    min-width: 180px;
    text-align: center;
}

.dph-review-average-number {
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
    color: #222;
    margin-bottom: 10px;
}

.dph-review-average-stars .star-rating {
    margin: 0 auto;
}

.dph-review-average-count {
    font-size: 14px;
    color: #777;
}

.dph-review-breakdown {
    flex: 1;
    max-width: 500px;
}

.dph-review-breakdown-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 9px;
}

.dph-review-breakdown-label {
    width: 35px;
    font-size: 14px;
    color: #555;
}

.dph-review-progress {
    flex: 1;
    height: 8px;
    overflow: hidden;
    background: #e5e7eb;
    border-radius: 20px;
}

.dph-review-progress span {
    display: block;
    height: 100%;
    background: #fbbf24;
    border-radius: inherit;
}

.dph-review-breakdown-count {
    width: 25px;
    font-size: 13px;
    color: #777;
}

.dph-reviews-list {
    display: flex;
    flex-direction: column;
}

.dph-review-item {
    padding: 25px 0;
    border-bottom: 1px solid #e5e7eb;
}

.dph-review-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 15px;
}

.dph-review-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dph-review-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.dph-review-user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dph-review-author {
    font-size: 15px;
    color: #222;
}

.dph-review-date {
    font-size: 13px;
    color: #888;
}

.dph-review-rating .star-rating {
    margin: 0;
    font-size: 14px;
}

.dph-review-content {
    font-size: 15px;
    line-height: 1.7;
    color: #555;
}

.dph-review-content p {
    margin: 0;
}

.dph-no-reviews {
    padding: 30px 0;
    color: #777;
}

.star-rating {
    color: #fe9900;
}

/* ================================
   REVIEW FORM
================================ */

.dph-product-tab-content .comment-respond {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e5e7eb;
}

.dph-product-tab-content .comment-reply-title {
    margin: 0 0 25px;
    font-size: 22px;
    font-weight: 700;
    color: #222;
}

.dph-product-tab-content .comment-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Label */

.dph-product-tab-content .comment-form label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.dph-product-tab-content .comment-form .required {
    color: #e53935;
}

/* Rating */

.dph-product-tab-content .comment-form-rating {
    margin: 0;
}

.dph-product-tab-content .comment-form-rating select {
    width: 100%;
    max-width: 350px;
    height: 45px;
    padding: 0 14px;

    border: 1px solid #dcdfe4;
    border-radius: 6px;

    background: #fff;
    color: #333;

    font-size: 14px;

    outline: none;
    cursor: pointer;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.dph-product-tab-content .comment-form-rating select:focus {
    border-color: #009688;
    box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.1);
}

/* Comment */

.dph-product-tab-content .comment-form-comment {
    margin: 0;
}

.dph-product-tab-content .comment-form-comment textarea {
    display: block;

    width: 100%;
    min-height: 140px;

    padding: 14px 16px;

    border: 1px solid #dcdfe4;
    border-radius: 6px;

    background: #fff;

    color: #333;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;

    resize: vertical;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.dph-product-tab-content .comment-form-comment textarea::placeholder {
    color: #999;
}

.dph-product-tab-content .comment-form-comment textarea:focus {
    border-color: #009688;
    box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.1);
}

/* Submit */

.dph-product-tab-content .form-submit {
    margin: 0;
}

.dph-product-tab-content .form-submit input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 140px;
    min-height: 45px;

    padding: 0 24px;

    border: none;
    border-radius: 6px;

    background: #009688;
    color: #fff;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.dph-product-tab-content .form-submit input[type="submit"]:hover {
    background: #00796b;
}

.dph-product-tab-content .form-submit input[type="submit"]:active {
    transform: translateY(1px);
}




/* =========================================
   RELATED PRODUCTS
   ========================================= */

.dph-related-products {
    max-width: 1300px;
    width: 100%;
    margin: 20px auto;
}

.dph-related-products .related.products {
    margin: 0;
    padding: 0 10px;
}

.dph-related-products .related.products>h2 {
    margin-bottom: 20px;
    font-size: 25px;
    font-weight: 600;
    color: #222;

}


/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 991px) {

    .dph-product-detail-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        margin-bottom: 3rem;
    }

    .dph-product-gallery {
        position: static;
    }

}


@media (max-width: 767px) {

    .dph-single-product-wrapper {
        padding: 1.5rem 0 3rem;
    }

    .dph-container {
        width: min(100% - 24px, 1200px);
    }

    .dph-product-title {
        font-size: 1.5rem;
    }

    .dph-price-box {
        padding: 1rem;
    }

    .dph-price-main {
        font-size: 1.75rem;
    }

    .dph-meta-rating {
        gap: 0.6rem;
    }

    /* .dph-add-to-cart-form form.cart {
        width: 100%;
    } */

    .dph-add-to-cart-form .single_add_to_cart_button {
        flex: 1;
    }

    .dph-product-tabs-wrapper {
        padding: 0 10px;
    }

    .dph-product-tabs-wrapper .woocommerce-tabs ul.tabs {
        gap: 1rem;
        overflow-x: auto;
        white-space: nowrap;
    }

}



/* WooCommerce success notification */
.woocommerce-notices-wrapper {
    position: fixed;
    top: 90px;
    right: 30px;
    z-index: 99999;
}

.woocommerce-notices-wrapper .woocommerce-message {
    display: flex;
    align-items: center;
    gap: 16px;

    min-width: 320px;
    max-width: 420px;
    padding: 14px 18px;

    background: #eaf8ee;
    border: 1px solid #9ed9ad;
    border-left: 5px solid #22a447;
    border-radius: 8px;

    color: #176b2c;
    font-size: 14px;
    line-height: 1.5;

    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);

    animation: dph-toast-show 0.3s ease forwards;
}

/* Bỏ icon / khoảng trắng mặc định của WooCommerce */
.woocommerce-notices-wrapper .woocommerce-message::before {
    content: none !important;
}

/* Nút View cart */
.woocommerce-notices-wrapper a.wc-forward {
    margin-left: auto;
    flex-shrink: 0;

    padding: 7px 12px;

    background: #22a447;
    color: #fff !important;

    border-radius: 5px;
    text-decoration: none;

    font-size: 13px;
    font-weight: 600;
}

.woocommerce-notices-wrapper .wc-forward:hover {
    background: #198c3b;
}

/* Hiện */
@keyframes dph-toast-show {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ẩn */
.dph-toast-hide {
    animation: dph-toast-hide 0.3s ease forwards !important;
}

@keyframes dph-toast-hide {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-15px);
    }
}