/**
 * WooCommerce Styles for TDService 2025 Theme
 *
 * @package TDService_2025
 * @since 1.0.0
 */

/* ==========================================================================
   WooCommerce General
   ========================================================================== */

.woocommerce,
.woocommerce-page {
    padding: 15px 0;
}

/* ============================================================
   BREADCRUMB - HORIZONTAL LAYOUT FIX (ULTRA SPECIFIC)
   ============================================================ */

/* Container - Force Flexbox Horizontal */
.woocommerce .woocommerce-breadcrumb,
.woocommerce-breadcrumb,
nav.woocommerce-breadcrumb {
    margin-bottom: 30px !important;
    padding: 15px 20px !important;
    background: linear-gradient(135deg, #ffffff 0%, #fffef8 100%) !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    color: #666 !important;
    border: 2px solid rgba(37, 99, 235, 0.2) !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    overflow-x: auto !important;
    box-shadow: 0 2px 8px rgba(29, 78, 216, 0.08) !important;
    gap: 0 !important;
}

/* OL - Force Inline Flex (ALL POSSIBLE SELECTORS) */
.woocommerce .woocommerce-breadcrumb ol,
.woocommerce .woocommerce-breadcrumb ol.breadcrumb,
.woocommerce-breadcrumb ol,
.woocommerce-breadcrumb ol.breadcrumb,
nav.woocommerce-breadcrumb ol,
ol.breadcrumb {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    list-style: none !important;
    list-style-type: none !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    width: auto !important;
}

/* LI - Force Inline (ALL POSSIBLE SELECTORS) */
.woocommerce .woocommerce-breadcrumb li,
.woocommerce .woocommerce-breadcrumb li.breadcrumb-item,
.woocommerce-breadcrumb li,
.woocommerce-breadcrumb li.breadcrumb-item,
nav.woocommerce-breadcrumb li,
ol.breadcrumb li,
li.breadcrumb-item {
    display: inline-flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    clear: none !important;
}

/* Links */
.woocommerce .woocommerce-breadcrumb a,
.woocommerce-breadcrumb a {
    color: #1a1a1a !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    font-weight: 600 !important;
    padding: 5px 10px !important;
    border-radius: 6px !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
}

.woocommerce .woocommerce-breadcrumb a:hover,
.woocommerce-breadcrumb a:hover {
    color: #2563EB !important;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(220, 38, 38, 0.1)) !important;
    transform: translateY(-1px) !important;
}

/* Separators (ALL POSSIBLE SELECTORS) */
.woocommerce .woocommerce-breadcrumb .breadcrumb-separator,
.woocommerce .woocommerce-breadcrumb .delimiter,
.woocommerce .woocommerce-breadcrumb span.breadcrumb-separator,
.woocommerce-breadcrumb .breadcrumb-separator,
.woocommerce-breadcrumb .delimiter,
.breadcrumb-separator,
span.breadcrumb-separator {
    margin: 0 8px !important;
    color: #2563EB !important;
    font-weight: 600 !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
    float: none !important;
}

/* ==========================================================================
   Product Grid / Loop
   ========================================================================== */

:root {
    --td-yellow: #2563EB;
    --td-yellow-dark: #1D4ED8;
    --td-black: #000;
    --td-text: #222;
}

.woocommerce ul.products {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/*************************************************
 PREMIUM PRODUCT CARD – LIGHT ELEGANT THEME
**************************************************/
.woocommerce ul.products li.product {
    width: calc(25% - 25px);
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    border-radius: 16px;
    overflow: hidden;
    padding-bottom: 15px;
    border: 2px solid #f0f0f0;
    box-shadow: 0px 4px 15px rgba(0,0,0,0.08);
    transition: all 0.35s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    display: flex;
    flex-direction: column;
}

.woocommerce ul.products li.product:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0px 12px 35px rgba(29, 78, 216, 0.25), 0px 4px 15px rgba(0,0,0,0.1);
    border-color: var(--td-yellow);
}

/* ==========================================================================
   Product Images
   ========================================================================== */

.woocommerce ul.products li.product img {
    width: 100%;
    height: 250px !important;
    object-fit: contain;
    background: linear-gradient(135deg, #f8f8f8 0%, #ffffff 100%);
    padding: 15px;
    border-bottom: 2px solid #f0f0f0;
    border-radius: 14px 14px 0 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.woocommerce ul.products li.product:hover img {
    transform: scale(1.08) rotateZ(2deg);
    box-shadow: 0 8px 25px rgba(29, 78, 216, 0.3);
}

/* Ensure WooCommerce default image wrapper */
.woocommerce ul.products li.product .product-images,
.woocommerce ul.products li.product a img,
.woocommerce ul.products li.product .woocommerce-loop-product__link img,
.woocommerce ul.products li.product .attachment-woocommerce_thumbnail {
    width: 100% !important;
    height: 250px !important;
    object-fit: contain !important;
    background: linear-gradient(135deg, #f8f8f8 0%, #ffffff 100%);
    padding: 15px;
    border-radius: 14px 14px 0 0;
}

/* ============================================================
   FIX HÌNH ẢNH SẢN PHẨM - LUÔN LUÔN HIỂN THỊ (ULTRA SPECIFIC V2)
   ============================================================ */

/* CRITICAL: ALL product images must be visible by default */
.woocommerce ul.products li.product img,
.woocommerce ul.products li.product .product-images img,
.woocommerce ul.products li.product .woocommerce-loop-product__link img,
.woocommerce ul.products li.product .attachment-woocommerce_thumbnail,
.woocommerce ul.products li.product a img,
.product-card img,
.product-card .product-image-wrapper img,
.products-grid .product-card img,
.featured-products-section img,
div.product-card a img,
.woocommerce-LoopProduct-link img,
.woocommerce .product img.wp-post-image {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    position: relative !important;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
    pointer-events: auto !important;
}

/* Primary image specific */
.woocommerce ul.products li.product .primary-image,
.product-card .primary-image {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    z-index: 1 !important;
}

/* Hide secondary image completely */
.woocommerce ul.products li.product .secondary-image,
.product-card .secondary-image {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Hover effect: Only scale, ALWAYS keep visible */
.woocommerce ul.products li.product:hover img,
.woocommerce ul.products li.product:hover .primary-image,
.woocommerce ul.products li.product:hover .product-images img,
.product-card:hover img,
.product-card:hover .product-image-wrapper img {
    opacity: 1 !important;
    visibility: visible !important;
    transform: scale(1.05) !important;
}

/* Force remove any hiding on product cards */
.woocommerce ul.products li.product .product-images,
.product-card .product-image-wrapper,
.product-card .product-images {
    position: relative !important;
    display: block !important;
    overflow: hidden !important;
}

.woocommerce ul.products li.product a,
.product-card a {
    display: block !important;
    position: relative !important;
}

/* Override any lazy loading or hidden states */
img[loading="lazy"] {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Force visible state on load */
.woocommerce ul.products li.product,
.product-card {
    opacity: 1 !important;
    visibility: visible !important;
}

/* ==========================================================================
   Product Badges
   ========================================================================== */

.product-badges {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.badge {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    text-align: center;
}

.badge-sale {
    background: linear-gradient(135deg, #FF6B6B 0%, #EE5A6F 100%);
    color: white;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.badge-new {
    background: linear-gradient(135deg, #2563EB 0%, #DC2626 100%);
    color: #000;
    font-weight: 800;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

.badge-featured {
    background: linear-gradient(135deg, #3498DB 0%, #2980B9 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.badge-out-of-stock {
    background: linear-gradient(135deg, #95A5A6 0%, #7F8C8D 100%);
    color: white;
}

/* ==========================================================================
   Product Info
   ========================================================================== */

.woocommerce ul.products li.product .woocommerce-loop-product__link {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/*************************************************
 TIÊU ĐỀ SẢN PHẨM
**************************************************/
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.4;
    padding: 15px 15px 0 15px;
    min-height: 55px;
    color: #1a1a1a;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin: 0;
    transition: all 0.3s ease;
}

.woocommerce ul.products li.product a {
    text-decoration: none;
}

.woocommerce ul.products li.product a:hover h2 {
    color: var(--td-yellow);
    transform: scale(1.05);
}

/*************************************************
 GIÁ SẢN PHẨM
**************************************************/
.woocommerce ul.products li.product .price {
    text-align: center;
    font-size: 18px !important;
    font-weight: 800 !important;
    background: linear-gradient(135deg, var(--td-yellow) 0%, var(--td-yellow-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: 8px;
    margin-bottom: 12px;
    display: block;
}

.woocommerce ul.products li.product .price del {
    font-size: 16px;
    color: #999;
    background: none;
    -webkit-text-fill-color: #999;
    text-decoration: line-through;
    margin-right: 8px;
}

.woocommerce ul.products li.product .price ins {
    text-decoration: none;
    background: linear-gradient(135deg, #2563EB 0%, #DC2626 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================================================
   Add to Cart Button
   ========================================================================== */

/*************************************************
 NÚT MUA HÀNG
**************************************************/
.woocommerce ul.products li.product .button {
    display: inline-block;
    margin: 15px auto 0 auto;
    padding: 12px 24px;
    background: linear-gradient(135deg, #2563EB 0%, #DC2626 100%) !important;
    color: #000000 !important;
    border-radius: 10px;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.8px;
    transition: all 0.35s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    text-transform: uppercase;
    text-align: center;
    border: 2px solid transparent;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(29, 78, 216, 0.4);
    position: relative;
    overflow: hidden;
}

.woocommerce ul.products li.product .button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
    z-index: 0;
}

.woocommerce ul.products li.product .button:hover::before {
    width: 350px;
    height: 350px;
}

.woocommerce ul.products li.product .button:hover {
    background: linear-gradient(135deg, #DC2626 0%, #DC2626 100%) !important;
    box-shadow: 0 6px 25px rgba(255, 140, 0, 0.6);
    transform: translateY(-3px) scale(1.05);
    border-color: rgba(220, 38, 38, 0.5);
}

.woocommerce ul.products li.product .button.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.woocommerce ul.products li.product .added_to_cart {
    display: block;
    margin-top: 10px;
    text-align: center;
    color: var(--color-primary);
    font-weight: 600;
}

/* ==========================================================================
   Star Rating
   ========================================================================== */

.woocommerce .star-rating {
    overflow: hidden;
    position: relative;
    height: 1em;
    line-height: 1;
    font-size: 1em;
    width: 5.4em;
    font-family: star;
    margin: 10px 0;
}

.woocommerce .star-rating::before {
    content: "★★★★★";
    color: #ddd;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
}

.woocommerce .star-rating span {
    overflow: hidden;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
    padding-top: 1.5em;
}

.woocommerce .star-rating span::before {
    content: "★★★★★";
    top: 0;
    position: absolute;
    left: 0;
    color: var(--color-primary);
}

/* ==========================================================================
   Single Product
   ========================================================================== */

.woocommerce div.product {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.woocommerce div.product div.images {
    margin-bottom: 30px;
}

.woocommerce div.product div.images img {
    border-radius: 10px;
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    object-position: center;
    display: block;
    background: #f5f5f5;
}

/* Main Product Image Container */
.woocommerce div.product div.images .woocommerce-product-gallery__image {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: #f5f5f5;
}

/* Product Gallery Thumbnails */
.woocommerce div.product div.images .flex-control-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 12px;
    margin-top: 20px;
    list-style: none;
    padding: 0;
}

.woocommerce div.product div.images .flex-control-thumbs li {
    margin: 0;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
}

.woocommerce div.product div.images .flex-control-thumbs li img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    display: block;
}

.woocommerce div.product div.images .flex-control-thumbs li img:hover,
.woocommerce div.product div.images .flex-control-thumbs li img.flex-active {
    border-color: #2563EB;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
    transform: scale(1.05);
}

.woocommerce div.product div.summary {
    margin-bottom: 30px;
}

.woocommerce div.product .product_title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-secondary);
    margin-bottom: 15px;
}

.woocommerce div.product p.price {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 20px;
}

.woocommerce div.product p.price del {
    font-size: 24px;
    color: #999;
    margin-right: 15px;
}

.woocommerce div.product .woocommerce-product-rating {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.woocommerce div.product .woocommerce-review-link {
    color: var(--color-primary);
    text-decoration: none;
}

.woocommerce div.product .woocommerce-product-details__short-description {
    margin-bottom: 25px;
    line-height: 1.8;
    color: #666;
}

/* ==========================================================================
   Single Product - Add to Cart
   ========================================================================== */

.woocommerce div.product form.cart {
    margin-bottom: 30px;
}

.woocommerce div.product form.cart .quantity {
    display: inline-block;
    margin-right: 15px;
}

.woocommerce div.product form.cart .quantity input {
    width: 80px;
    padding: 12px;
    border: 2px solid var(--color-border);
    border-radius: 5px;
    font-size: 16px;
    text-align: center;
}

.woocommerce div.product form.cart .single_add_to_cart_button {
    padding: 15px 40px;
    background: var(--color-primary);
    color: var(--color-secondary);
    border: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.woocommerce div.product form.cart .single_add_to_cart_button:hover {
    background: var(--color-secondary);
    color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Contact for Price - ENHANCED BEAUTIFUL DESIGN */
.contact-for-price {
    margin: 25px 0;
    padding: 15px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(220, 38, 38, 0.05) 100%);
    border-radius: 16px;
    border: 2px solid rgba(37, 99, 235, 0.2);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.1);
    position: relative;
    overflow: hidden;
}

.contact-for-price::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
    animation: rotate-shine 20s linear infinite;
    pointer-events: none;
}

@keyframes rotate-shine {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.contact-for-price .price-label {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.contact-for-price .price-label::before {
    content: '💰';
    font-size: 24px;
    animation: bounce-icon 2s ease-in-out infinite;
}

@keyframes bounce-icon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.contact-for-price .contact-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 15px 45px;
    background: linear-gradient(135deg, #2563EB 0%, #DC2626 100%);
    color: #000;
    font-size: 18px;
    font-weight: 800;
    text-decoration: none;
    border-radius: 14px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow:
        0 8px 25px rgba(37, 99, 235, 0.4),
        0 0 0 0 rgba(37, 99, 235, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    border: 3px solid rgba(220, 38, 38, 0.3);
    animation: pulse-glow 2.5s ease-in-out infinite;
    z-index: 1;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow:
            0 8px 25px rgba(37, 99, 235, 0.4),
            0 0 0 0 rgba(37, 99, 235, 0.5);
    }
    50% {
        box-shadow:
            0 10px 35px rgba(37, 99, 235, 0.6),
            0 0 0 8px rgba(37, 99, 235, 0.15);
    }
}

/* Shine effect sliding across */
.contact-for-price .contact-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.7s ease;
    z-index: 0;
}

.contact-for-price .contact-button:hover::before {
    left: 100%;
}

/* Ripple effect on hover */
.contact-for-price .contact-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: 0;
}

.contact-for-price .contact-button:hover::after {
    width: 350px;
    height: 350px;
}

.contact-for-price .contact-button svg {
    position: relative;
    z-index: 1;
    width: 22px;
    height: 22px;
    animation: phone-ring 1.5s ease-in-out infinite;
}

@keyframes phone-ring {
    0%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(-15deg); }
    20%, 40% { transform: rotate(15deg); }
    50% { transform: rotate(0deg); }
}

.contact-for-price .contact-button:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow:
        0 12px 40px rgba(37, 99, 235, 0.7),
        0 0 60px rgba(37, 99, 235, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border-color: #DC2626;
    animation: none;
}

.contact-for-price .contact-button:active {
    transform: translateY(-2px) scale(1.01);
}

.contact-for-price .contact-button svg,
.contact-for-price .contact-button span {
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   Product Tabs
   ========================================================================== */

.woocommerce div.product .woocommerce-tabs {
    margin-top: 30px;
}

.woocommerce div.product .woocommerce-tabs ul.tabs {
    display: flex;
    gap: 10px;
    list-style: none;
    margin: 0 0 30px;
    padding: 0;
    border-bottom: 2px solid var(--color-border);
}

.woocommerce div.product .woocommerce-tabs ul.tabs li {
    margin: 0;
    padding: 0;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
    display: block;
    padding: 15px 25px;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a,
.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.woocommerce div.product .woocommerce-tabs .panel {
    padding: 15px;
    background: var(--color-gray);
    border-radius: 10px;
}

/* ==========================================================================
   Related Products
   ========================================================================== */

.woocommerce .related.products,
.woocommerce .upsells.products {
    margin-top: 25px !important;
    padding-top: 15px !important;
    border-top: none !important;
}

.woocommerce .related.products h2,
.woocommerce .upsells.products h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 30px;
    color: #1a1a1a;
    text-align: left;
}

/* Related/Upsell Products Grid */
.woocommerce .related.products ul.products,
.woocommerce .upsells.products ul.products {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

/* ===========================================================
   FIX RELATED PRODUCTS IMAGES - FORCE SQUARE ASPECT RATIO
   =========================================================== */

/* All Images in Related/Upsells - ULTRA SPECIFIC */
.woocommerce .related.products ul.products li.product img,
.woocommerce .upsells.products ul.products li.product img,
.woocommerce .related.products ul.products li.product .attachment-woocommerce_thumbnail,
.woocommerce .upsells.products ul.products li.product .attachment-woocommerce_thumbnail,
.woocommerce .related.products .product-images img,
.woocommerce .upsells.products .product-images img,
.related.products img,
.upsells.products img {
    width: 100% !important;
    height: 220px !important;
    min-height: 220px !important;
    max-height: 220px !important;
    object-fit: cover !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 12px !important;
    display: block !important;
}

/* Product Image Wrapper */
.woocommerce .related.products ul.products li.product .product-images,
.woocommerce .upsells.products ul.products li.product .product-images,
.woocommerce .related.products ul.products li.product a,
.woocommerce .upsells.products ul.products li.product a {
    display: block !important;
    overflow: hidden !important;
    border-radius: 12px !important;
}

/* Related Products Boxes - Equal Height */
.woocommerce .related.products ul.products li.product,
.woocommerce .upsells.products ul.products li.product,
.related.products li.product,
.upsells.products li.product {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

/* Responsive - Tablet */
@media (max-width: 1200px) {
    .woocommerce .related.products ul.products,
    .woocommerce .upsells.products ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .woocommerce .related.products ul.products li.product img,
    .woocommerce .upsells.products ul.products li.product img,
    .woocommerce .related.products .product-images img,
    .woocommerce .upsells.products .product-images img,
    .related.products img,
    .upsells.products img {
        height: 200px !important;
        min-height: 200px !important;
        max-height: 200px !important;
    }
}

/* Responsive - Mobile Large */
@media (max-width: 768px) {
    .woocommerce .related.products ul.products,
    .woocommerce .upsells.products ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }

    .woocommerce .related.products ul.products li.product img,
    .woocommerce .upsells.products ul.products li.product img,
    .woocommerce .related.products .product-images img,
    .woocommerce .upsells.products .product-images img,
    .related.products img,
    .upsells.products img {
        height: 180px !important;
        min-height: 180px !important;
        max-height: 180px !important;
    }
}

/* Responsive - Mobile Small */
@media (max-width: 480px) {
    .woocommerce .related.products ul.products,
    .woocommerce .upsells.products ul.products {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    .woocommerce .related.products ul.products li.product img,
    .woocommerce .upsells.products ul.products li.product img,
    .woocommerce .related.products .product-images img,
    .woocommerce .upsells.products .product-images img,
    .related.products img,
    .upsells.products img {
        height: 250px !important;
        min-height: 250px !important;
        max-height: 250px !important;
    }
}

/* ==========================================================================
   Cart Page
   ========================================================================== */

.woocommerce table.shop_table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.woocommerce table.shop_table thead {
    background: var(--color-gray);
}

.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.woocommerce table.shop_table th {
    font-weight: 700;
    color: var(--color-secondary);
}

.woocommerce table.shop_table .product-thumbnail img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
    display: block;
    background: #f5f5f5;
}

.woocommerce table.shop_table .product-name a {
    color: var(--color-secondary);
    font-weight: 600;
    text-decoration: none;
}

.woocommerce table.shop_table .product-name a:hover {
    color: var(--color-primary);
}

.woocommerce table.shop_table .product-price,
.woocommerce table.shop_table .product-subtotal {
    font-weight: 700;
    color: var(--color-primary);
}

.woocommerce table.shop_table .quantity input {
    width: 70px;
    padding: 8px;
    border: 2px solid var(--color-border);
    border-radius: 5px;
    text-align: center;
}

.woocommerce table.shop_table .actions {
    background: var(--color-gray);
}

.woocommerce table.shop_table .actions .button {
    padding: 10px 20px;
    background: var(--color-primary);
    color: var(--color-secondary);
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.woocommerce table.shop_table .actions .button:hover {
    background: var(--color-secondary);
    color: var(--color-primary);
}

/* Cart Totals */
.woocommerce .cart-collaterals {
    margin-top: 30px;
}

.woocommerce .cart_totals {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.woocommerce .cart_totals h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}

.woocommerce .cart_totals table {
    width: 100%;
}

.woocommerce .cart_totals table th,
.woocommerce .cart_totals table td {
    padding: 15px;
    border-bottom: 1px solid var(--color-border);
}

.woocommerce .cart_totals .order-total td {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
}

.woocommerce .wc-proceed-to-checkout {
    margin-top: 20px;
}

.woocommerce .wc-proceed-to-checkout .checkout-button {
    display: block;
    width: 100%;
    padding: 15px;
    background: var(--color-primary);
    color: var(--color-secondary);
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 5px;
    transition: var(--transition);
}

.woocommerce .wc-proceed-to-checkout .checkout-button:hover {
    background: var(--color-secondary);
    color: var(--color-primary);
    transform: translateY(-2px);
}

/* ==========================================================================
   Checkout Page
   ========================================================================== */

.woocommerce form.checkout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.woocommerce form.checkout .col2-set {
    grid-column: 1;
}

.woocommerce form.checkout #order_review_heading,
.woocommerce form.checkout #order_review {
    grid-column: 2;
}

.woocommerce form.checkout h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--color-secondary);
}

.woocommerce form.checkout .form-row {
    margin-bottom: 20px;
}

.woocommerce form.checkout .form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--color-secondary);
}

.woocommerce form.checkout .form-row input.input-text,
.woocommerce form.checkout .form-row textarea,
.woocommerce form.checkout .form-row select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--color-border);
    border-radius: 5px;
    font-size: 16px;
    transition: var(--transition);
}

.woocommerce form.checkout .form-row input.input-text:focus,
.woocommerce form.checkout .form-row textarea:focus,
.woocommerce form.checkout .form-row select:focus {
    border-color: var(--color-primary);
    outline: none;
}

.woocommerce form.checkout #order_review {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.woocommerce form.checkout #place_order {
    width: 100%;
    padding: 15px;
    background: var(--color-primary);
    color: var(--color-secondary);
    border: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.woocommerce form.checkout #place_order:hover {
    background: var(--color-secondary);
    color: var(--color-primary);
    transform: translateY(-2px);
}

/* ==========================================================================
   Messages & Notices
   ========================================================================== */

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    border-left: 4px solid;
}

.woocommerce-message {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.woocommerce-info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

.woocommerce-error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/*************************************************
 RESPONSIVE – HOÀN HẢO
**************************************************/

/* ============================================================
   MOBILE RESPONSIVE AUTO-FIX - MODERN 2025
   ============================================================ */

/* Tablet */
@media (max-width: 1024px) {
    .woocommerce ul.products li.product {
        width: calc(50% - 20px);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .woocommerce .woocommerce-breadcrumb {
        padding: 12px 15px;
        font-size: 14px !important; /* Tăng từ 12px → 14px (dễ đọc hơn) */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .woocommerce .woocommerce-breadcrumb a {
        padding: 6px 10px; /* Tăng touch target */
        font-size: 14px !important;
        min-height: 32px; /* Đủ lớn để bấm */
        display: inline-flex;
        align-items: center;
    }

    .breadcrumb-separator,
    .woocommerce .woocommerce-breadcrumb .delimiter {
        margin: 0 8px; /* Tăng spacing */
    }

    .woocommerce ul.products {
        gap: 20px;
    }

    .woocommerce ul.products li.product {
        width: 100%;
    }

    /* FIX: Flexible image height thay vì cứng */
    .woocommerce ul.products li.product img {
        height: auto !important;
        min-height: 200px !important;
        max-height: 280px !important;
        object-fit: contain !important;
    }

    .woocommerce div.product {
        padding: 15px;
    }

    .woocommerce div.product .product_title {
        font-size: 22px; /* Giảm nhẹ nhưng vẫn đọc được */
        line-height: 1.3;
    }

    .woocommerce div.product p.price {
        font-size: 26px; /* Giữ price lớn */
    }

    /* Product title in loop */
    .woocommerce ul.products li.product .woocommerce-loop-product__title {
        font-size: 15px !important; /* Tăng từ 16px nhưng vẫn OK */
        line-height: 1.4;
        min-height: 60px;
    }

    /* Button touch targets */
    .woocommerce ul.products li.product .button {
        padding: 14px 20px !important; /* Đủ lớn để bấm (44px min) */
        font-size: 15px !important;
        min-height: 48px;
        touch-action: manipulation;
    }

    .woocommerce form.checkout {
        grid-template-columns: 1fr;
        gap: 25px; /* Tăng spacing */
    }

    .woocommerce form.checkout .col2-set,
    .woocommerce form.checkout #order_review_heading,
    .woocommerce form.checkout #order_review {
        grid-column: 1;
    }

    /* Form inputs touch friendly */
    .woocommerce form.checkout .form-row input.input-text,
    .woocommerce form.checkout .form-row textarea,
    .woocommerce form.checkout .form-row select {
        min-height: 48px !important;
        font-size: 16px !important; /* Tránh zoom trên iOS */
        padding: 12px 15px !important;
    }

    .woocommerce table.shop_table .product-thumbnail img {
        width: 70px; /* Tăng từ 60px */
        height: 70px;
    }

    /* Price spacing */
    .woocommerce ul.products li.product .price {
        font-size: 20px !important;
        margin-top: 10px;
        margin-bottom: 15px;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .woocommerce ul.products li.product {
        width: 100% !important;
    }

    .woocommerce ul.products li.product img {
        height: auto !important;
        min-height: 180px !important;
        max-height: 240px !important;
    }

    /* Compact title */
    .woocommerce ul.products li.product .woocommerce-loop-product__title {
        font-size: 14px !important;
        min-height: 55px;
    }

    .woocommerce div.product form.cart .quantity input {
        width: 70px; /* Tăng từ 60px */
        padding: 10px;
        font-size: 16px;
        min-height: 44px; /* Touch friendly */
    }

    .woocommerce div.product form.cart .single_add_to_cart_button {
        padding: 14px 30px; /* Tăng padding */
        font-size: 16px;
        min-height: 48px;
        width: 100%; /* Full width trên mobile nhỏ */
    }

    /* Contact button - Mobile Enhanced */
    .contact-for-price {
        padding: 15px !important;
        margin: 20px 0 !important;
    }

    .contact-for-price .price-label {
        font-size: 18px !important;
        margin-bottom: 15px !important;
    }

    .contact-for-price .price-label::before {
        font-size: 20px !important;
    }

    .contact-for-price .contact-button {
        padding: 18px 35px !important;
        font-size: 17px !important;
        width: 100%;
        gap: 12px !important;
        justify-content: center;
        min-height: 56px;
        letter-spacing: 0.5px !important;
    }

    .contact-for-price .contact-button svg {
        width: 20px !important;
        height: 20px !important;
    }

    /* Breadcrumb compact */
    .woocommerce .woocommerce-breadcrumb {
        font-size: 13px !important;
        padding: 10px 12px;
    }

    .woocommerce .woocommerce-breadcrumb a {
        padding: 5px 8px;
        font-size: 13px !important;
    }
}
