/*
 Theme Name: Astra Child
 Theme URI: http://example.com/astra-child
 Description: Astra Child Theme
 Author: Your Name
 Author URI: http://example.com
 Template: astra
 Version: 1.0.2
 Text Domain: astra-child
*/



/* shop product card */


/* Product grid */
.ice-product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

/* Product card */
.ice-product-card {
    min-width: 0;
    padding: 0;
    border: 1px solid #eaf1f8;
    border-radius: 10px;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.ice-product-card:hover {
    box-shadow: 0 4px 16px #00000021;
}

/* Full-width product image */
.ice-product-image {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    margin: 0;
    overflow: hidden;
}

.ice-product-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    padding: 16px;
    box-sizing: border-box;
    margin: 0 !important;
    transition: transform 0.3s ease;
}

.ice-product-image:hover img {
    transform: scale(1.03);
}

/* Text section */
.ice-product-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    padding: 20px;
    box-sizing: border-box;
}

/* Product title */
.ice-product-title {
    margin: 0 0 14px !important;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    color: #163B57;
}

.ice-product-title a {
    color: inherit;
    text-decoration: none;
}

/* Ice type */
.ice-product-meta {
    margin: 0 0 16px;
    color: #526b80;
    font-size: 16px;
    line-height: 1.6;
}

/* Product specifications */
.ice-product-specs {
    margin: 0;
}

.ice-product-specs > div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
}

.ice-product-specs dt {
    color: #4C6576;
    font-weight: 400;
    font-size: 14px;
}

.ice-product-specs dd {
    margin: 0;
    text-align: right;
    color: #163B57;
    font-size: 14px;
    font-weight: 600;
}

/* Product price - added */
.ice-product-price {
    display: block;
    margin-top: 4px;
/*     margin-bottom: 18px; */
    color: #0875C9;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.5;
}

.ice-product-price .woocommerce-Price-amount,
.ice-product-price .amount {
    color: #0875C9;
    font-size: inherit;
    font-weight: inherit;
}

.ice-product-price del {
    color: #8a9aaa;
    font-size: 14px;
    opacity: 0.8;
}

.ice-product-price del .amount {
    color: #8a9aaa;
    font-size: inherit;
}

.ice-product-price ins {
    text-decoration: none;
}

.ice-product-price .woocommerce-price-suffix {
    color: #526b80;
    font-size: 12px;
}

/* Detail link */
.ice-product-more {
    display: inline-flex;
    align-items: center;
    justify-content: start;
    gap: 10px;
    width: 100%;
    margin-top: auto;
    padding-top: 10px;
    color: #0875C9;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    text-decoration: none;
    box-sizing: border-box;
}

.ice-product-more-text {
    display: inline-block;
}

/* SVG arrow */
.ice-product-more-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 14px;
    height: 12px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.ice-product-more-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.ice-product-more:hover {
    color: #163B57;
}

.ice-product-more:hover .ice-product-more-icon {
    transform: translateX(3px);
}

/* Pagination */
.ice-product-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 32px;
}

.ice-product-pagination a,
.ice-product-pagination .current {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #eaf1f8;
    border-radius: 4px;
    text-decoration: none;
    box-sizing: border-box;
}

.ice-product-pagination a {
    color: #163B57;
}

.ice-product-pagination a:hover {
    color: #0875C9;
    border-color: #0875C9;
}

.ice-product-pagination .current {
    color: #fff;
    background: #0875C9;
    border-color: #0875C9;
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1024px) {
    .ice-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }

    .ice-product-content {
        padding: 14px;
    }

    .ice-product-title {
        font-size: 19px;
    }

    .ice-product-specs dd {
        font-size: 15px;
    }

    .ice-product-more {
        font-size: 15px;
    }

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

/* Mobile */
@media (max-width: 767px) {
    .ice-product-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    .ice-product-content {
        padding: 20px;
    }

    .ice-product-title {
        font-size: 22px;
    }

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

/* ตารางของ product */
/* Tablet และ Mobile: เลื่อนตารางแนวนอน */
@media (max-width: 1024px) {
    .mobilescrolltable {
        width: 100%;
        max-width: 100%;
        overflow-x: auto !important;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .mobilescrolltable .wpDataTableContainerSimpleTable {
        width: 100%;
        max-width: 100%;
        overflow: visible !important;
    }

    .mobilescrolltable table.wpdtSimpleTable {
        min-width: 650px !important;
        width: 650px !important;
        table-layout: fixed !important;
    }

    .mobilescrolltable h3 {
        max-width: 100%;
    }
}

/* =====================================================================
 * 1) รุ่นที่เกี่ยวข้อง (หน้าสินค้า) — [genice_related]
 *    Desktop 3 คอลัมน์ (ใช้ grid เดิมของ .ice-product-grid) / Tablet+Mobile ปัดซ้าย-ขวา
 * ===================================================================== */

/* ไม่มีรุ่นที่เกี่ยวข้อง → ซ่อนทั้ง section (ใส่ CSS Class gn-related-wrap ที่ container ใน Elementor) */
.gn-related-wrap:has(.gn-related-empty) {
    display: none;
}

/* Tablet: เห็น 2 ใบ + ขอบใบที่ 3 */
@media (max-width: 1024px) {
    .ice-product-grid.gn-related {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 16px;
        padding-bottom: 8px;
        scrollbar-width: none;
    }

    .ice-product-grid.gn-related::-webkit-scrollbar {
        display: none;
    }

    .ice-product-grid.gn-related > .ice-product-card {
        flex: 0 0 45%;
        scroll-snap-align: start;
    }
}

/* Mobile: เห็น 1 ใบ + ขอบใบถัดไป (16px = padding ซ้ายขวาของ container บนมือถือ) */
@media (max-width: 767px) {
    .ice-product-grid.gn-related {
        margin: 0 -16px;
        padding: 0 16px 8px;
    }

    .ice-product-grid.gn-related > .ice-product-card {
        flex: 0 0 80%;
    }
}


/* =====================================================================
 * 2) รุ่นยอดนิยม (หน้าแรก) — [ice_featured_products]
 *    Carousel: Desktop 4 / Tablet 3 / Mobile 1
 * ===================================================================== */

.ice-product-grid.gn-carousel__track {
    --gn-per-view: 4;
    --gn-gap: 24px;
    display: flex;
    gap: var(--gn-gap);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 8px 0 16px; /* เผื่อเงาตอน hover การ์ด */
}

.gn-carousel__track::-webkit-scrollbar {
    display: none;
}

.gn-carousel__track > .ice-product-card {
    flex: 0 0 calc((100% - (var(--gn-per-view) - 1) * var(--gn-gap)) / var(--gn-per-view));
    scroll-snap-align: start;
}

.gn-carousel__track:focus-visible {
    outline: 2px solid #0875C9;
    outline-offset: 4px;
}

/* การ์ดแคบ: ค่าสเปกยาวตกบรรทัดได้ แต่ยังชิดขวา */
.gn-featured .ice-product-specs > div {
    flex-wrap: wrap;
}

.gn-featured .ice-product-specs dd {
    margin-left: auto;
}

/* ปุ่มเลื่อน */
.gn-carousel__nav {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

.gn-carousel.is-static .gn-carousel__nav {
    display: none;
}

.gn-carousel__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    line-height: 0;
    cursor: pointer;
    border: 1px solid #0875C9;
    border-radius: 8px;
    background: #fff;
    color: #0875C9;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.gn-carousel__btn svg {
    width: var(--gn-btn-icon, 24px);
    height: var(--gn-btn-icon, 24px);
    fill: currentColor;
}

.gn-carousel__btn--prev svg {
    transform: rotate(180deg);
}

.gn-carousel__btn:hover:not(:disabled) {
    background: #0875C9;
    color: #fff;
}

.gn-carousel__btn:focus-visible {
    outline: 2px solid #0875C9;
    outline-offset: 2px;
}

.gn-carousel__btn:disabled {
    opacity: 0.35;
    cursor: default;
}

/* Tablet: 3 ใบ */
@media (max-width: 1024px) {
    .ice-product-grid.gn-carousel__track {
        --gn-per-view: 3;
        --gn-gap: 16px;
    }
}

/* Mobile: 1 ใบ + ขอบใบถัดไป, ซ่อนปุ่ม (ใช้ปัด) */
@media (max-width: 767px) {
    .ice-product-grid.gn-carousel__track {
        --gn-per-view: 1.15;
        margin: 0 -16px;
        padding: 8px 16px 16px;
        scroll-padding-left: 16px;
    }

    .gn-carousel__nav {
        display: none;
    }
}