/* ==========================================================================
   CHIRODI PRODUCT SHOWCASE CSS (WordPress Plugin Version - Clean & Bottom Wave)
   ========================================================================== */

:root {
    --chirodi-primary: #e60012;      /* Màu đỏ đặc trưng Mixue */
    --chirodi-primary-rgb: 230, 0, 18;
    --chirodi-bg-light: #f5f5f7;     /* Nền sáng cho tab bar */
    --chirodi-text-dark: #1d1d1f;    /* Chữ tối chính */
    --chirodi-text-muted: #333333;   /* Mô tả màu đen rõ nét */
    --chirodi-white: #ffffff;
    --chirodi-font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.chirodi-showcase-container {
    font-family: var(--chirodi-font-family);
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    color: var(--chirodi-text-dark);
}

/* ==========================================================================
   Navigation Tabs
   ========================================================================== */
.chirodi-tabs-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 60px;
}

.chirodi-tabs-nav {
    display: flex;
    background-color: var(--chirodi-bg-light);
    padding: 6px;
    border-radius: 40px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.03);
    position: relative;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

.chirodi-tabs-nav::-webkit-scrollbar {
    display: none;
}

.chirodi-tab-btn {
    background: none;
    border: none;
    outline: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 500;
    color: var(--chirodi-text-dark);
    cursor: pointer;
    border-radius: 35px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    text-transform: capitalize;
}

.chirodi-tab-btn:hover {
    color: var(--chirodi-primary);
}

.chirodi-tab-btn.active {
    background-color: var(--chirodi-primary);
    color: var(--chirodi-white);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(var(--chirodi-primary-rgb), 0.3);
}

/* ==========================================================================
   Products Grid
   ========================================================================== */
.chirodi-tab-panel {
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.chirodi-tab-panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.chirodi-products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 80px 40px; /* Tăng khoảng cách giữa các sản phẩm */
    padding-bottom: 20px;
}

/* ==========================================================================
   Product Card (Lược bỏ khung viền và đổ bóng)
   ========================================================================== */
.chirodi-product-card {
    display: flex;
    background: transparent; /* Nền trong suốt */
    border: none;            /* Không viền */
    padding: 20px 20px 40px 20px; /* Tăng padding dưới để chứa sóng đỏ */
    border-radius: 28px;     /* Định hình bo tròn cho phần chân sóng */
    position: relative;
    overflow: visible;       /* Cho ly nước hiển thị trọc trồi ra ngoài */
    align-items: flex-start;  /* Căn lề trên để chữ không bị kéo tụt xuống dưới */
    transition: transform 0.4s ease;
}

/* Cột thông tin sản phẩm (Bên trái) */
.chirodi-product-info {
    flex: 0.9; /* Tối ưu tỷ lệ chiều rộng để dành không gian cho ly nước to */
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Đẩy nội dung lên trên */
    padding-top: 60px; /* Thêm khoảng đệm trên để chữ ngang vai ly nước */
    padding-right: 20px;
    z-index: 2;
}

.chirodi-product-title {
    font-size: 32px; /* Tăng cỡ chữ tiêu đề to rõ nét */
    font-weight: 900; /* Font weight dày dặn nổi bật */
    color: var(--chirodi-primary);
    margin: 0 0 20px 0;
    line-height: 1.2;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.chirodi-product-desc {
    font-size: 16px;
    line-height: 1.6;
    color: var(--chirodi-text-muted);
    margin: 0;
}

/* Cột hình ảnh sản phẩm to (Bên phải) */
.chirodi-product-visual {
    flex: 1.1; /* Tăng tỷ lệ chiều rộng của cột chứa hình ảnh */
    position: relative;
    height: 420px; /* Tăng chiều cao ly nước lên 420px */
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

/* Ly nước to và trong suốt */
.chirodi-product-img {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: auto !important;
    height: 100% !important; /* Ép trình duyệt nhận diện chiều cao 100% của container */
    max-width: none !important; /* Cho phép ảnh tràn viền cột để đạt chiều cao tối đa */
    object-fit: contain !important;
    z-index: 3;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: transparent;
}

/* Hiệu ứng di chuột chỉ tương tác lên cốc nước và các mảnh trang trí */
.chirodi-product-card:hover .chirodi-product-img {
    transform: translateX(-50%) translateY(-10px) scale(1.05);
}

/* ==========================================================================
   Sóng Đỏ Hiệu Ứng Rê Chuột (Bottom Wave Decor)
   ========================================================================== */
.chirodi-product-wave-decor {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
    border-radius: 0 0 28px 28px; /* Bo tròn chân sóng */
    opacity: 0;                   /* Mặc định ẩn */
    transform: scaleY(0.7);       /* Thu hẹp nhẹ */
    transform-origin: bottom;
    transition: opacity 0.45s cubic-bezier(0.165, 0.84, 0.44, 1), 
                transform 0.45s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.chirodi-wave-svg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    preserveAspectRatio: none;
}

/* Khi hover: hiện sóng đỏ nhạt cuộn trào */
.chirodi-product-card:hover .chirodi-product-wave-decor {
    opacity: 1;
    transform: scaleY(1);
}

/* ==========================================================================
   Floating Ingredients (Vật thể bay trang trí)
   ========================================================================== */
.chirodi-ingredient {
    position: absolute;
    z-index: 4;
    pointer-events: none;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 5px 8px rgba(0,0,0,0.06));
}

@keyframes chirodiFloat {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-6px) rotate(3deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

.chirodi-product-card .chirodi-ingredient {
    animation: chirodiFloat 4s ease-in-out infinite alternate;
}

.chirodi-ingredient:nth-child(even) {
    animation-delay: -2s;
}

/* Hiệu ứng bay ly tâm nhẹ khi rê chuột vào */
.chirodi-product-card:hover .chirodi-ingredient.ing-left-1 {
    transform: translate(-15px, -5px) scale(1.1) rotate(-15deg);
}

.chirodi-product-card:hover .chirodi-ingredient.ing-left-2 {
    transform: translate(-10px, 10px) scale(1.15) rotate(10deg);
}

.chirodi-product-card:hover .chirodi-ingredient.ing-right-1 {
    transform: translate(15px, -10px) scale(1.1) rotate(20deg);
}

.chirodi-product-card:hover .chirodi-ingredient.ing-right-2 {
    transform: translate(10px, 12px) scale(1.2) rotate(-10deg);
}

/* Định vị các vật thể trang trí xung quanh chân cốc nước */
.ing-left-1 { bottom: 20px; left: 15px; }
.ing-left-2 { bottom: 70px; left: 0px; }
.ing-right-1 { bottom: 50px; right: 10px; }
.ing-right-2 { bottom: 10px; right: 25px; }

/* Badge góc */
.chirodi-product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--chirodi-primary);
    color: var(--chirodi-white);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 5;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    text-transform: uppercase;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 991px) {
    .chirodi-products-grid {
        grid-template-columns: 1fr;
        gap: 60px;
    }
    
    .chirodi-product-card {
        max-width: 700px;
        margin: 0 auto;
    }
    
    .chirodi-product-title {
        font-size: 28px;
    }
}

@media (max-width: 575px) {
    .chirodi-product-card {
        flex-direction: column-reverse;
        align-items: stretch;
        padding: 15px 15px 30px 15px;
    }
    
    .chirodi-product-info {
        padding-right: 0;
        padding-top: 0; /* Reset lề trên trên di động */
        margin-top: 25px;
        text-align: center;
    }
    
    .chirodi-product-title {
        font-size: 26px;
        margin-bottom: 12px;
    }
    
    .chirodi-product-visual {
        height: 320px;
        width: 100%;
        align-self: center;
        position: relative;
    }
    
    .chirodi-product-img {
        position: relative !important;
        bottom: 0 !important;
        left: 0 !important;
        transform: none !important;
        height: 320px !important;
        width: auto !important;
        display: block !important;
        margin: 0 auto !important;
        max-width: 100% !important;
        object-fit: contain !important;
    }
    
    .chirodi-tab-btn {
        padding: 10px 18px;
        font-size: 14px;
    }

    .chirodi-product-wave-decor {
        height: 80px;
        border-radius: 0 0 20px 20px;
    }
}
