/*
Theme Name: Flatsome Child
Description: This is a child theme for Flatsome Theme
Author: UX Themes
Template: flatsome
Version: 3.4
*/

/*************** ADD CUSTOM CSS HERE.   ***************/

/* Hide post byline (publish date + author) on article pages */
.entry-meta.uppercase.is-xsmall {
    display: none !important;
}

/* =============================================================
   Khesaca PDP — product info column (right side)
   Màu theo design: red #D12028, dark-brown #390400,
   gray-mid #929496, gray-light #D5D6D7
   ============================================================= */

/* Vùng trồng (trên H1) */
.product-origin {
    display: block;
    font-size: 12px;
    color: #929496;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

/* "Đã bán N+" sau rating */
.pdp-sold {
    color: #929496;
    font-size: 13.5px;
}

/* 3 thanh hương vị */
.pdp-flavor {
    display: flex;
    gap: 20px;
    background: #FAF8F6;
    border: 1px solid #D5D6D7;
    border-radius: 6px;
    padding: 16px;
    margin: 16px 0;
}
.flavor-meter {
    flex: 1;
}
.flavor-meter .flabel {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #929496;
    margin-bottom: 6px;
}
.flavor-bar {
    height: 6px;
    border-radius: 3px;
    background: #D5D6D7;
    overflow: hidden;
}
.flavor-bar span {
    display: block;
    height: 100%;
    background: #D12028;
    border-radius: 3px;
}

/* Dòng tồn kho */
.pdp-stock-note {
    font-size: 13px;
    color: #929496;
}

/* Nút Mua ngay */
.buy-now-btn {
    background: #390400 !important;
    color: #fff !important;
    border-color: #390400 !important;
}
.buy-now-btn:hover {
    background: #570000 !important;
    border-color: #570000 !important;
    color: #fff !important;
}

/* 3 dòng cam kết */
.pdp-perks {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid #D5D6D7;
    padding-top: 24px;
    margin-top: 16px;
}
.pdp-perk {
    display: flex;
    gap: 10px;
    font-size: 13.5px;
    color: #434244;
}
.pdp-perk .ic {
    color: #D12028;
    flex-shrink: 0;
}

/* =============================================================
   Attribute label — tên trái, giá trị đang chọn phải
   (giống .og-label trong design)
   ============================================================= */
.woocommerce div.product form.cart .variations .label label {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    font-size: 13.5px;
    font-weight: 700;
    color: #390400;
    margin: 10px 0 8px;
    width: 100%;
}
.pdp-attr-wrap {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.pdp-attr-name {
    font-weight: 700;
    color: #390400;
    font-size: 13.5px;
}
.pdp-attr-value {
    font-weight: 400;
    color: #929496;
    font-size: 13px;
    text-align: right;
}

/* Bỏ dòng chữ mặc định của WooCommerce (reset_variations) không cần */
.woocommerce div.product form.cart .reset_variations {
    display: none !important;
}

/* =============================================================
   Table variations — xếp CHỒNG dọc:
   Dòng 1 = label + giá trị chọn (full width)
   Dòng 2 = các pill option (full width, wrap xuống dòng dưới)
   ============================================================= */
.woocommerce div.product form.cart table.variations {
    display: block;
    width: 100%;
    border-collapse: collapse;
}
.woocommerce div.product form.cart table.variations tbody {
    display: block;
    width: 100%;
}
.woocommerce div.product form.cart table.variations tr {
    display: block;
    width: 100%;
    margin-bottom: 18px;
}
.woocommerce div.product form.cart table.variations td,
.woocommerce div.product form.cart table.variations th {
    display: block !important;
    width: 100% !important;
    text-align: left;
}
/* Dòng 1 — nhãn attribute (label + giá trị phải) */
.woocommerce div.product form.cart table.variations th.label {
    display: block;
    width: 100%;
    padding: 0 0 8px;
}
/* Dòng 2 — options */
.woocommerce div.product form.cart table.variations td.value {
    display: block;
    width: 100%;
    padding: 0;
}
.woocommerce div.product form.cart table.variations td.value .tawcvs-swatches {
    width: 100%;
}

/* =============================================================
   Variation Swatches — pill như design .opt-pill
   Chỉ MỘT viền duy nhất, bỏ outline / box-shadow / ::before / ::after
   ============================================================= */

/* Container pills — flex wrap */
.woocommerce div.product form.cart .variations .tawcvs-swatches,
.woocommerce div.product form.cart .variations .value .tawcvs-swatches {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}
.woocommerce div.product form.cart .variations .tawcvs-swatches .swatch-item-wrapper {
    margin: 0 !important;
}

/* Nút pill — loại bỏ mọi vòng viền phụ của plugin/theme */
.woocommerce div.product .cart.variations_form .tawcvs-swatches .swatch.swatch-label,
.woocommerce div.product .cart.variations_form .tawcvs-swatches .swatch.swatch-type-label,
.woocommerce div.product form.cart .variations .tawcvs-swatches .swatch.swatch-label,
.woocommerce div.product form.cart .variations .tawcvs-swatches .swatch.swatch-type-label {
    border-radius: 4px !important;
    border: 1.5px solid #D5D6D7 !important;
    outline: none !important;
    box-shadow: none !important;
    width: auto !important;
    height: auto !important;
    min-width: auto !important;
    min-height: auto !important;
    padding: 10px 16px !important;
    background: #FFFFFF !important;
    color: #434244 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease !important;
}
/* Xoá pseudo-element tạo viền phụ */
.woocommerce div.product .cart.variations_form .tawcvs-swatches .swatch.swatch-label::before,
.woocommerce div.product .cart.variations_form .tawcvs-swatches .swatch.swatch-label::after,
.woocommerce div.product .cart.variations_form .tawcvs-swatches .swatch.swatch-type-label::before,
.woocommerce div.product .cart.variations_form .tawcvs-swatches .swatch.swatch-type-label::after,
.woocommerce div.product form.cart .variations .tawcvs-swatches .swatch.swatch-label::before,
.woocommerce div.product form.cart .variations .tawcvs-swatches .swatch.swatch-label::after,
.woocommerce div.product form.cart .variations .tawcvs-swatches .swatch.swatch-type-label::before,
.woocommerce div.product form.cart .variations .tawcvs-swatches .swatch.swatch-type-label::after {
    content: none !important;
    display: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Text bên trong pill */
.woocommerce div.product .cart.variations_form .tawcvs-swatches .swatch.swatch-label .text,
.woocommerce div.product .cart.variations_form .tawcvs-swatches .swatch.swatch-type-label .text {
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    color: inherit !important;
}

/* Trạng thái chọn — đổi màu viền+nền+chữ, VẪN chỉ 1 viền */
.woocommerce div.product .cart.variations_form .tawcvs-swatches .swatch.swatch-label.selected,
.woocommerce div.product .cart.variations_form .tawcvs-swatches .swatch.swatch-type-label.selected {
    border-color: #D12028 !important;
    background: #FDECEC !important;
    color: #D12028 !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Hover pill hợp lệ */
.woocommerce div.product .cart.variations_form .tawcvs-swatches .swatch.swatch-label:hover:not(.disabled),
.woocommerce div.product .cart.variations_form .tawcvs-swatches .swatch.swatch-type-label:hover:not(.disabled) {
    border-color: #D12028 !important;
    color: #D12028 !important;
    background: #FFFFFF !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Disabled (hết hàng) — xám + gạch ngang */
.woocommerce div.product .cart.variations_form .tawcvs-swatches .swatch.swatch-label.disabled,
.woocommerce div.product .cart.variations_form .tawcvs-swatches .swatch.swatch-type-label.disabled,
.woocommerce div.product .cart.variations_form .tawcvs-swatches .swatch.swatch-label.disabled:hover,
.woocommerce div.product .cart.variations_form .tawcvs-swatches .swatch.swatch-type-label.disabled:hover {
    border-color: #D5D6D7 !important;
    background: #F5F5F5 !important;
    color: #929496 !important;
    text-decoration: line-through !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    opacity: 1 !important;
    outline: none !important;
    box-shadow: none !important;
}
.woocommerce div.product .cart.variations_form .tawcvs-swatches .swatch.swatch-label.disabled .text,
.woocommerce div.product .cart.variations_form .tawcvs-swatches .swatch.swatch-type-label.disabled .text {
    color: #929496 !important;
    text-decoration: line-through !important;
}

/* =============================================================
   PDP actions — Thêm vào giỏ / Mua ngay / ♡ trên CÙNG một hàng
   ============================================================= */
.woocommerce div.product form.cart .woocommerce-variation-add-to-cart,
.woocommerce div.product form.cart .single_variation_wrap .woocommerce-variation-add-to-cart {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px !important;
}
.woocommerce div.product form.cart .woocommerce-variation-add-to-cart .ux-quantity,
.woocommerce div.product form.cart .woocommerce-variation-add-to-cart .quantity {
    flex: 1 1 100% !important;
    margin: 0 0 6px !important;
}
.woocommerce div.product form.cart .woocommerce-variation-add-to-cart .single_add_to_cart_button,
.woocommerce div.product form.cart .woocommerce-variation-add-to-cart .buy-now-btn {
    flex: 0 1 auto;
    min-width: 0;
    white-space: nowrap;
    margin: 0 !important;
    font-size: 13.5px !important;
    padding: 0 14px !important;
    height: 44px !important;
    line-height: 44px !important;
    border-radius: 4px !important;
}
.woocommerce div.product form.cart .woocommerce-variation-add-to-cart .single_add_to_cart_button {
    flex: 1 1 auto;
    background: #D12028 !important;
    border-color: #D12028 !important;
    color: #fff !important;
}
.woocommerce div.product form.cart .woocommerce-variation-add-to-cart .single_add_to_cart_button:hover {
    background: #BF1C22 !important;
    border-color: #BF1C22 !important;
}
.woocommerce div.product form.cart .buy-now-btn {
    background: #390400 !important;
    color: #fff !important;
    border-color: #390400 !important;
}
.woocommerce div.product form.cart .buy-now-btn:hover {
    background: #570000 !important;
    border-color: #570000 !important;
    color: #fff !important;
}

/* Wishlist ♡ được JS di chuyển về cạnh nút mua */
.pdp-wishlist-moved {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 0 !important;
}
.pdp-wishlist-moved .wishlist-button,
.pdp-wishlist-moved a.button,
.pdp-wishlist-moved button {
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    line-height: 44px !important;
    border: 1.5px solid #D5D6D7 !important;
    border-radius: 4px !important;
    background: #fff !important;
    color: #390400 !important;
    font-size: 20px;
}
.pdp-wishlist-moved .wishlist-popup {
    display: none;
}

/* Ẩn wishlist gốc ở image-tools khi đã move */
.product-gallery .image-tools .wishlist-icon,
.product-images .image-tools .wishlist-icon,
.single-product .image-tools .wishlist-icon {
    display: none !important;
}
/* Nút ♡ move cạnh nút mua gọn gàng, cùng hàng */
.pdp-wishlist-moved {
    align-self: stretch;
    order: 10;
    display: inline-flex !important;
    align-items: center;
    width: 52px !important;
    max-width: 52px !important;
    min-width: 52px !important;
    flex: 0 0 52px !important;
    overflow: visible;
    position: relative;
}
.pdp-wishlist-moved .wishlist-popup,
.pdp-wishlist-moved .yith-wcwl-add-to-wishlist .feedback {
    display: none !important;
}
.pdp-wishlist-moved .wishlist-button,
.pdp-wishlist-moved button.button,
.pdp-wishlist-moved a.button {
    height: 44px !important;
    width: 48px !important;
    padding: 0 !important;
    line-height: 1 !important;
    margin: 0 !important;
    border: 1.5px solid #D5D6D7 !important;
    border-radius: 4px !important;
    background: #FFFFFF !important;
    color: #390400 !important;
    box-shadow: none !important;
    font-size: 18px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}
.pdp-wishlist-moved .wishlist-button i.icon-heart,
.pdp-wishlist-moved .wishlist-button::before {
    line-height: 1;
    font-size: 18px;
}

/* =============================================================
   Mức độ rang — slider 3 dòng (dải gradient + tam giác + alert)
   ============================================================= */
/* Khi slider đã được JS dựng lên thì ẩn swatch plugin cùng hàng */
.pdp-roast-slider ~ .tawcvs-swatches,
.tawcvs-swatches:has(~ .pdp-roast-slider) {
    display: none !important;
}

.pdp-roast-slider {
    position: relative;
    width: 100%;
    padding: 6px 0 0;
    user-select: none;
}
.pdp-roast-rail {
    position: relative;
    height: 14px;
    border-radius: 7px;
    background: linear-gradient(to right, #EFE2D6 0%, #DCC8B5 18%, #C5936A 50%, #7A4A24 75%, #5a2f13 100%);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.12);
    margin: 0 8px;
}
.pdp-roast-tick {
    position: absolute;
    top: -4px;
    width: 2px;
    height: 22px;
    background: rgba(57,4,0,0.55);
    border-radius: 1px;
}
.pdp-roast-tick:nth-child(1) { left: 0%; }
.pdp-roast-tick:nth-child(2) { left: 50%; }
.pdp-roast-tick:nth-child(3) { left: 100%; }

/* Tam giác nhọn xuống */
.pdp-roast-thumb {
    position: absolute;
    top: 16px;
    left: 50%;
    width: 0;
    height: 0;
    margin-left: -7px;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 10px solid #390400;
    pointer-events: none;
    transition: left 0.12s ease;
    z-index: 2;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.25));
}

/* Range input trong suốt phủ lên để bắt kéo */
.pdp-roast-range {
    position: absolute;
    top: 0;
    left: 8px;
    width: calc(100% - 16px);
    height: 24px;
    opacity: 0;
    cursor: pointer;
    margin: 0;
    z-index: 3;
}

/* Text alert dưới tam giác */
.pdp-roast-alert {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #390400;
    margin-top: 12px;
    min-height: 18px;
}

@media only screen and (max-width: 48em) {
/*************** ADD MOBILE ONLY CSS HERE  ***************/

    .pdp-flavor {
        flex-wrap: wrap;
        gap: 12px;
    }
    .flavor-meter {
        min-width: calc(50% - 12px);
    }

}
