/**
 * Theme Name: Blocksy Child
 * Description: Blocksy Child theme
 * Author: Creative Themes
 * Template: blocksy
 * Text Domain: blocksy
 */

 /* ========================================
   PRODUCT CARDS & VARIATIONS
   ======================================== */

   [data-products] .product {
    background-color: var(--theme-palette-color-6);
    border-radius: 16px;
}

[data-products] .product .ct-card-variation-swatches {
    position: relative;
}

:is([data-swatches-type=color],[data-swatches-type=image],[data-swatches-type=mixed]) .ct-swatch {
    border-width: 1px !important;
}

[data-products] figure {
    position: unset !important;
}

.ct-card-variation-swatches .variations {
    position: absolute;
    top: -45px;
    left: 12px;
}

:is([data-swatches-type=color],[data-swatches-type=image],[data-swatches-type=mixed]) .ct-swatch {
	border-width:1px;
  	border-radius:0;
}

/* ========================================
   BADGES & SALE PRICES
   ======================================== */

.onsale, 
.out-of-stock-badge, 
[class*=ct-woo-badge-] {
    height: unset !important;
    min-width: unset !important;
}

.product .ct-woo-badges span:not(:first-child) {
    display: none !important;
}

@media (max-width: 689.98px) {
    .products .sale-price {
        flex-wrap: nowrap !important;
    }
    .products .sale-price del{
        font-size: 70% !important;
    }
    .products .p-card-price .sale-price{
        font-size:14px !important;
    }
}

/* ========================================
   PRODUCT TITLES
   ======================================== */

.p-card-title {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

/* ========================================
   CARD EXTRA ACTIONS
   ======================================== */

.ct-woo-card-extra[data-type=type-1] {
    flex-direction: row !important;
    top: unset !important;
    gap: 6px !important;
    bottom: 16px !important;
    right: 12px !important;
}

.ct-woo-card-extra[data-type=type-1] .ct-button {
    width: 18px !important;
    min-height: 18px !important;
}

/* ========================================
   QUICK VIEW BUTTON ICON
   ======================================== */

/* ซ่อน SVG เดิมของปุ่ม Quick View */
.ct-open-quick-view .ct-icon-container svg:first-child, 
.ct-open-quick-view .ct-icon-container .ct-button-loader {
    display: none;
}

/* แทนที่ด้วยไอคอนรถเข็นแบบใหม่ */
.ct-open-quick-view .ct-icon-container::before {
    content: url("data:image/svg+xml,%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' viewBox='0 0 122.9 107.5'%3E%3Cg%3E%3Cpath d='M3.9,7.9C1.8,7.9,0,6.1,0,3.9C0,1.8,1.8,0,3.9,0h10.2c0.1,0,0.3,0,0.4,0c3.6,0.1,6.8,0.8,9.5,2.5c3,1.9,5.2,4.8,6.4,9.1 c0,0.1,0,0.2,0.1,0.3l1,4H119c2.2,0,3.9,1.8,3.9,3.9c0,0.4-0.1,0.8-0.2,1.2l-10.2,41.1c-0.4,1.8-2,3-3.8,3v0H44.7 c1.4,5.2,2.8,8,4.7,9.3c2.3,1.5,6.3,1.6,13,1.5h0.1v0h45.2c2.2,0,3.9,1.8,3.9,3.9c0,2.2-1.8,3.9-3.9,3.9H62.5v0 c-8.3,0.1-13.4-0.1-17.5-2.8c-4.2-2.8-6.4-7.6-8.6-16.3l0,0L23,13.9c0-0.1,0-0.1-0.1-0.2c-0.6-2.2-1.6-3.7-3-4.5 c-1.4-0.9-3.3-1.3-5.5-1.3c-0.1,0-0.2,0-0.3,0H3.9L3.9,7.9z M96,88.3c5.3,0,9.6,4.3,9.6,9.6c0,5.3-4.3,9.6-9.6,9.6 c-5.3,0-9.6-4.3-9.6-9.6C86.4,92.6,90.7,88.3,96,88.3L96,88.3z M53.9,88.3c5.3,0,9.6,4.3,9.6,9.6c0,5.3-4.3,9.6-9.6,9.6 c-5.3,0-9.6-4.3-9.6-9.6C44.3,92.6,48.6,88.3,53.9,88.3L53.9,88.3z M33.7,23.7l8.9,33.5h63.1l8.3-33.5H33.7L33.7,23.7z'/%3E%3C/g%3E%3C/svg%3E");
    display: inline-block;
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.ct-quick-view-content .flexy-pills {
    display: none !important;
}

.ct-quick-view-card .entry-summary .ct-quick-more {
    height: 40px !important;
}

.ct-quick-view-content .product_title {
    line-height: 1.2;
    margin-bottom: 5px !important;
}

.ct-quick-view-card .entry-summary :where(form.cart,.product_meta,.ct-product-additional-actions) {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: 0 !important;    
}


/* ========================================
   QUICK VIEW CARD
   ======================================== */

.ct-quick-view-card .entry-summary .price {
    margin-bottom: 15px !important;
}

.ct-quick-view-card .ct-product-additional-actions, 
.ct-quick-view-card .product_meta, 
.ct-quick-view-card .entry-summary .woocommerce-product-details__short-description, 
.ct-quick-view-content h1.product_title, 
.ct-quick-view-content p.price, 
.ct-quick-view-content .woobt-wrap, 
.ct-quick-view-content .quantity {
    display: none !important;
}

.ct-quick-view-card .entry-summary .ct-quick-more {
    min-height: unset;
    margin-top: var(--product-element-spacing, 25px);     
}

.ct-quick-view-card .ct-media-container img, 
.ct-quick-view-card .ct-media-container picture {
    aspect-ratio: 1/1 !important;
}

/* ========================================
   CART ACTIONS
   ======================================== */

.ct-cart-actions .quantity {
    display: none;
}

.ct-cart-actions .added_to_cart {
    display: none !important;
}

/* ========================================
   VARIATIONS & PRICING
   ======================================== */

/* ซ่อนราคา variation ที่ WooCommerce แสดง */
.woocommerce-variation-price, 
.woocommerce-variation-availability, 
.reset_variations{
    display: none !important;
}

form.variations_form .single_variation:has(*:not(:empty)) {
    margin: 0 !important;
}

/* ========================================
   PRODUCT ADDITIONAL INFO
   ======================================== */

.ct-product-additional-info ul li svg {
    fill: var(--theme-palette-color-3) !important;
}

/* ========================================
   ENTRY SUMMARY
   ======================================== */

.entry-summary {
    position: relative;
}

.entry-summary .ct-product-additional-actions {
    position: absolute !important;
    top: 5px;
    right: 12px;
}

.entry-summary .ct-product-additional-actions .ct-icon-container svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   BREADCRUMBS
   ======================================== */

[data-prefix="product"] .entry-header .ct-breadcrumbs {
    margin-top: 20px;
    margin-bottom: 20px;
}

/* ========================================
   FILTER PANEL
   ======================================== */

.woo-listing-top .ct-toggle-filter-panel {
    border-radius: 30px !important;
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 999.98px) {
    body.single-product .ct-stacked-gallery-container {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 0.125;
    }

    [data-prefix="product"] .entry-header .ct-breadcrumbs {
        margin-top: 10px;
        margin-bottom: 10px;
    }
    
    body.single-product .woocommerce-product-gallery {
        width: 100vw !important;
        margin-left: calc(50% - 50vw); /* ดึงออกซ้าย */
        margin-right: calc(50% - 50vw); /* ดึงออกขวา */
        margin-bottom: 25px !important;
    }

    body.single-product .ct-stacked-gallery-container .ct-media-container {
        flex: 0 0 auto;
        scroll-snap-align: center;
        width: 80%;
        border-radius: 0;
    }
    
    body.single-product .ct-stacked-gallery-container .ct-media-container img {
        width: 100%;
    }

    /* ซ่อน scrollbar (optional) */
    body.single-product .ct-stacked-gallery-container::-webkit-scrollbar {
        display: none;
    }
}

/* ========================================
   FILTER & FLOAT BAR
   ======================================== */


#woo-filters-panel[data-behaviour*="side"], 
#woo-cart-panel, 
.ct-panel-content{
	-webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);  
}

.ct-drawer-canvas .ct-drawer-inner {
	bottom: 40px !important;
}

.ct-floating-bar {
    width: 600px;
    border-radius: 60px;
    padding: 20px;
    margin: 0px auto 25px;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);  
}

.ct-floating-bar img {
  	border-radius: 6px !important;
}

.ct-floating-bar .product-title {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;  
}

@media (max-width: 689.98px) {
  .ct-drawer-canvas[data-floating-bar=yes] .ct-floating-bar {
      width: 90vw;
  }
}

/* ========================================
   PRODUCT TAB
   ======================================== */


.woocommerce div.product div.woocommerce-tabs ul.tabs li.active:before {
    display: none;
}

.woocommerce div.product div.woocommerce-tabs ul.tabs li.active {
    background-color: var(--theme-palette-color-4);
    border-radius: 30px;
}

.woocommerce div.product div.woocommerce-tabs ul.tabs li a {
    padding: 10px 20px;
    line-height: 0.2em !important;
}

.woocommerce div.product div.woocommerce-tabs ul.tabs {
    padding-bottom: 15px;
    flex-wrap: nowrap !important;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;    
    flex-direction:row!important;
}

/* ซ่อน scrollbar (optional) */
.woocommerce div.product div.woocommerce-tabs ul.tabs::-webkit-scrollbar {
    display: none;
}

.woocommerce div.product div.woocommerce-tabs ul.tabs li {
    flex: 0 0 auto;
    scroll-snap-align: center;
    border-top: none!important;
}

.np-option-price {
    padding-top: .25rem;
    padding-bottom: .25rem;
    padding-left: .5rem;
    padding-right: .5rem;
    background-color: #dbeafe;
    color: #1c4ad9;
    line-height: 15px;
    border-radius: .5rem;
}

/* ========================================
   WPC
   ======================================== */

.woobt-title {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    font-size: 0.9rem;    
}

.woobt-products .woobt-product .woobt-thumb img {
    border-radius: 6px;
}

.woobt-summary {
    margin: 25px 0;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.woobt-wrap .woobt-text, .woobt-wrap .woobt-products {
  	margin:0;
}

/* ซ่อน checkbox จริง */
.woobt-checkbox {
  display: none;
}

/* ปุ่มสไตล์เหมือนกล่อง */
.woobt-choose {
  position: relative;
  display: inline-block;
}

.woobt-choose .checkmark {
  display: inline-flex !important;
  justify-content: center;
  align-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 18px;
  font-weight: bold;
  background-color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}

.woobt-checkbox:checked + .checkmark {
  background-color: black;
  color: white;
  display: inline-flexbox;
}

.woobt-products .woobt-product .woobt-price {
    font-size: 1rem;
}

.woobt-products .woobt-product .woobt-price del {
    display: none;
}

/* เปลี่ยน content ของปุ่มเป็น + หรือ – */
.woobt-checkbox + .checkmark::before {
    content: '+';
}

.woobt-checkbox:checked + .checkmark::before {
    content: '–';
}

.woobt-summary .woobt-text{
    font-size: 0.75rem !important;
    margin: 0 !important;
    font-weight: 500;
}

.woobt-alert {
    display: none !important;
}

@media only screen and (max-width: 767px) {
    .woobt-wrap-responsive .woobt-products .woobt-product {
        flex-direction: row !important;
        gap: 1rem;
        padding: 1px 0 !important;
    }    
    .woobt-wrap-responsive .woobt-products .woobt-product .woobt-thumb {
        flex-basis: unset !important;
    }    
    .woobt-wrap-responsive .woobt-products .woobt-product > div {
        text-align: left !important;
    }
    .woobt-wrap-responsive .woobt-products .woobt-product .woobt-thumb img {
        width: 40px !important;
    }
}

/* ========================================
   REVIEW
   ======================================== */

[data-content=normal] .woocommerce-Reviews {
    grid-template-columns: repeat(1, 1fr) !important;
}

#reviews [type=submit]{
    width: 100%;
}

#review_form {
    padding: 25px;
    border-radius: 16px;
    background-color: var(--theme-palette-color-6);    
}

.woocommerce-Reviews .meta {
    font-size: 1.3rem;
    margin-bottom:15px;
}

.woocommerce-Reviews .avatar {
    max-width: 100%;
    height: 100%;    
}

.woocommerce-Reviews .comment_container {
    display: inline-flex !important;
}

.woocommerce-Reviews .comment_container {
    width: 100% !important;
    align-items: flex-start;
    gap: 1rem;
  }

.woocommerce-Reviews .comment_container .comment-text {
    flex: 1 1 auto;
    width: auto;
}

.woocommerce-Reviews .ct-review-votes {
    padding-top: 15px !important;
    margin-top: 15px !important;
}

/* ========================================
   CART
   ======================================== */

.cart .product-name a, 
#woo-cart-panel .product-title {
    overflow: hidden !important;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2 !important;
}

.cart .woobt-item-name {
    display: none !important;
}

#woo-cart-panel .product-title {
    font-weight: 500 !important;
}

.woocommerce-cart-form__contents .coupon input {
    min-height: 40px;
}

/* ========================================
   CHECKOUT
   ======================================== */

.wp-block-woocommerce-checkout {
    padding-top: 0 !important;
}

.wc-block-checkout__sidebar .wc-block-components-product-name, 
.wc-block-components-product-name {
    font-weight: 500 !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;    
    margin-bottom: 0 !important;
}

.wc-block-components-product-metadata {
    display: none !important;
}

.wc-block-components-checkout-step__container {
    --theme-palette-color-1: #f9f9f9;
}

.wishlist-product-actions .woobt-wrap{
    display: none !important;
}

.wishlist-product-actions .wc-forward {
    display: none !important;
}

.wishlist-product-name {
    font-weight: 500 !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 1 !important;    
    margin-bottom: 0 !important;
}