/* ============================================================
   DMTT PRODUCT CARD — CSS HOÀN CHỈNH
   Phiên bản: 2.1 - Ngày 2026-05-15

   CHANGELOG v2.1:
   - Vô hiệu hóa sidebar mặc định WooCommerce
   - Cân đối layout desktop: hình ảnh & thông tin ngang hàng
   - Fix khoảng cách khi xóa sidebar
   ============================================================ */

/* ============================================================
   DISABLE WOOCOMMERCE SIDEBAR (LEFT SIDEBAR)
   ============================================================ */
.woocommerce-page .sidebar,
.woocommerce .sidebar,
.woocommerce-page .primary-sidebar,
.woocommerce .primary-sidebar,
.woocommerce-page aside.sidebar-primary,
.woocommerce aside.sidebar-primary,
body.single-product .woocommerce-breadcrumb,
body.single-product aside,
body.single-product .sidebar {
    display: none !important;
}

/* ============================================================
   SINGLE PRODUCT PAGE - FULL WIDTH CONTAINER
   ============================================================ */
body.single-product .woocommerce > div,
body.single-product .product-container,
body.single-product .container {
    width: 100% !important;
    max-width: 100% !important;
}

body.single-product div.product {
    width: 100% !important;
    clear: both !important;
}

/* ============================================================
   DESKTOP LAYOUT: 45% IMAGE | 32px GAP | 55% CONTENT
   ============================================================ */
@media (min-width: 769px) {
    body.single-product div.product,
    body.single-product .woocommerce div.product {
        display: grid !important;
        grid-template-columns: 45% 1fr !important;
        column-gap: 32px !important;
        align-items: start !important;
        float: none !important;
        width: 100% !important;
        max-width: 1400px !important;
        margin: 0 auto !important;
        padding: 20px !important;
    }

    body.single-product div.product::before,
    body.single-product div.product::after { 
        display: none !important; 
    }

    /* CỘT TRÁI: GALLERY IMAGES */
    body.single-product div.product .woocommerce-product-gallery,
    body.single-product div.product .product-images-wrapper,
    body.single-product div.product div.images {
        grid-column: 1 / 2 !important;
        grid-row: 1 / 2 !important;
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    /* CỘT PHẢI: SUMMARY INFO */
    body.single-product div.product .summary.entry-summary,
    body.single-product div.product div.summary {
        grid-column: 2 / 3 !important;
        grid-row: 1 / 2 !important;
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        clear: none !important;
    }

    /* FULL WIDTH CONTENT BELOW */
    body.single-product div.product > *:not(.woocommerce-product-gallery):not(.images):not(.summary):not(.entry-summary) {
        grid-column: 1 / -1 !important;
    }
}

/* ============================================================
   GALLERY THUMBNAILS
   ============================================================ */
.woocommerce-product-gallery .flex-control-thumbs {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    padding: 8px 0 0 !important;
    margin: 0 !important;
    list-style: none !important;
}

.woocommerce-product-gallery .flex-control-thumbs li {
    width: auto !important;
    float: none !important;
    margin: 0 !important;
}

.woocommerce-product-gallery .flex-control-thumbs img {
    width: 64px !important;
    height: 64px !important;
    object-fit: contain !important;
    border: 1.5px solid #e0e0e0 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    padding: 2px !important;
    transition: border-color 0.15s ease !important;
}

.woocommerce-product-gallery .flex-control-thumbs img.flex-active,
.woocommerce-product-gallery .flex-control-thumbs img:hover {
    border-color: #E24B4A !important;
    border-width: 2px !important;
}

/* ============================================================
   PRICE LAYOUT
   ============================================================ */
.single-product div.product p.price,
.single-product div.product span.price {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1px !important;
    line-height: 1.3 !important;
}

.single-product div.product .price del {
    display: block !important;
    order: 0 !important;
    font-size: 14px !important;
    color: #999 !important;
    text-decoration: line-through !important;
    margin: 0 !important;
}

.single-product div.product .price ins {
    display: block !important;
    order: 1 !important;
    text-decoration: none !important;
    font-size: 30px !important;
    font-weight: 700 !important;
    color: #E24B4A !important;
    margin: 0 !important;
}

.single-product div.product .price > .woocommerce-Price-amount {
    font-size: 30px !important;
    font-weight: 700 !important;
    color: #E24B4A !important;
}

/* ============================================================
   PRICE + CART WRAPPER
   ============================================================ */
@media (min-width: 769px) {
    .single-product .dmtt-price-cart-wrapper {
        display: flex !important;
        align-items: center !important;
        gap: 20px !important;
        flex-wrap: nowrap !important;
        margin: 14px 0 24px !important;
    }

    .single-product .dmtt-price-cart-wrapper p.price,
    .single-product .dmtt-price-cart-wrapper span.price {
        flex-shrink: 0 !important;
        margin: 0 !important;
    }

    .single-product .dmtt-price-cart-wrapper form.cart {
        flex: 1 !important;
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        flex-wrap: nowrap !important;
        margin: 0 !important;
    }

    .single-product .dmtt-price-cart-wrapper form.cart .quantity {
        flex-shrink: 0 !important;
        width: 90px !important;
    }

    .single-product .dmtt-price-cart-wrapper form.cart .single_add_to_cart_button {
        flex: 1 !important;
        white-space: nowrap !important;
    }
}

@media (max-width: 768px) {
    .single-product .dmtt-price-cart-wrapper {
        margin: 12px 0 20px !important;
    }

    .single-product .dmtt-price-cart-wrapper p.price,
    .single-product .dmtt-price-cart-wrapper span.price {
        margin: 0 0 10px !important;
        width: 100% !important;
    }

    .single-product .dmtt-price-cart-wrapper form.cart {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .single-product .dmtt-price-cart-wrapper form.cart .quantity {
        flex: 0 0 auto !important;
        width: 100px !important;
        max-width: 100px !important;
        min-width: 85px !important;
        margin: 0 !important;
    }

    .single-product .dmtt-price-cart-wrapper form.cart .quantity input {
        font-size: 14px !important;
        height: 44px !important;
        padding: 0 8px !important;
    }

    .single-product .dmtt-price-cart-wrapper form.cart .single_add_to_cart_button {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        margin: 0 !important;
        white-space: nowrap !important;
        padding: 12px 14px !important;
        font-size: 14px !important;
        height: 44px !important;
    }
}

/* ============================================================
   BOX STYLES (Features, Promotions, Specs, Commitment)
   ============================================================ */
.single-product .dmtt-box {
    border: 2px solid #ddd !important;
    border-radius: 12px !important;
    padding: 15px 17px !important;
    margin: 12px 0 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07) !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease !important;
}

.single-product .dmtt-box:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 16px rgba(0,0,0,0.11) !important;
}

.single-product .dmtt-box__title {
    font-size: 16px !important;
    font-weight: 700 !important;
    margin: 0 0 12px 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    line-height: 1.3 !important;
}

.single-product .dmtt-box__content {
    font-size: 14px !important;
    line-height: 1.7 !important;
}

.single-product .dmtt-box__content p {
    margin: 0 0 8px !important;
}

.single-product .dmtt-box__content p:last-child {
    margin-bottom: 0 !important;
}

.single-product .dmtt-box__list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.single-product .dmtt-box__list li {
    position: relative !important;
    padding: 6px 0 6px 22px !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    border-bottom: 1px solid rgba(0,0,0,0.05) !important;
}

.single-product .dmtt-box__list li:last-child { 
    border-bottom: none !important; 
}

.single-product .dmtt-box__list li::before {
    content: "✓" !important;
    position: absolute !important;
    left: 0 !important;
    font-weight: 700 !important;
    font-size: 14px !important;
}

/* ✨ FEATURES - Green */
.single-product .dmtt-box--features {
    border: 2.5px solid #66bb6a !important;
    background: #f1f8f4 !important;
}

.single-product .dmtt-box--features .dmtt-box__title { 
    color: #2e7d32 !important; 
}

.single-product .dmtt-box--features .dmtt-box__list li { 
    color: #2d4a2e !important; 
}

.single-product .dmtt-box--features .dmtt-box__list li::before { 
    color: #2e7d32 !important; 
}

/* 🎁 PROMOTIONS - Gold */
.single-product .dmtt-box--promotions {
    border: 2.5px solid #FFD700 !important;
    background: #ffffff !important;
    margin-bottom: 18px !important;
}

.single-product .dmtt-box--promotions .dmtt-box__title { 
    color: #b8860b !important; 
}

.single-product .dmtt-box--promotions .dmtt-box__content { 
    color: #34404c !important; 
}

/* ✅ COMMITMENT - Pink */
.single-product .dmtt-box--commitment {
    border: 2.5px solid #ec407a !important;
    background: #fff5f8 !important;
}

.single-product .dmtt-box--commitment .dmtt-box__title { 
    color: #ad1457 !important; 
}

/* 🔧 SPECS - Blue */
.single-product .dmtt-box--specs {
    border: 2.5px solid #42a5f5 !important;
    background: #f0f7ff !important;
}

.single-product .dmtt-box--specs .dmtt-box__title { 
    color: #0d47a1 !important; 
}

.single-product .dmtt-box--specs .dmtt-box__content { 
    color: #444 !important; 
}

/* ============================================================
   SERVICE + SPECS GRID (2 COLUMNS DESKTOP)
   ============================================================ */
.single-product .dmtt-service-specs-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    margin: 24px 0 28px !important;
}

@media (min-width: 769px) {
    .single-product .dmtt-service-specs-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        align-items: stretch !important;
        gap: 16px !important;
    }

    .single-product .dmtt-service-specs-grid > * {
        width: 100% !important;
        max-width: 100% !important;
    }

    .single-product .dmtt-service-specs-grid .dmtt-box {
        margin: 0 !important;
        height: 100% !important;
    }
}

/* ============================================================
   FEATURES SPECS GRID (FULL WIDTH BELOW CONTENT)
   ============================================================ */
body.single-product .dmtt-features-specs-grid {
    width: 100% !important;
    clear: both !important;
    margin: 28px 0 30px !important;
}

@media (min-width: 769px) {
    body.single-product .dmtt-features-specs-grid {
        grid-column: 1 / -1 !important;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 20px !important;
    }

    body.single-product .dmtt-features-specs-grid .dmtt-box {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
    }
}

@media (max-width: 768px) {
    body.single-product .dmtt-features-specs-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 14px !important;
        margin: 20px 0 24px !important;
    }
}

/* ============================================================
   AVAILABILITY
   ============================================================ */
body.single-product .summary.entry-summary > p.stock:not(.dmtt-title-availability),
body.single-product .summary.entry-summary > .availability:not(.dmtt-title-availability) {
    display: none !important;
}

body.single-product .summary.entry-summary .dmtt-title-availability {
    display: block !important;
    margin: 4px 0 12px !important;
    padding: 0 !important;
    border: 0 !important;
    color: #6b7280 !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
}

body.single-product .summary.entry-summary .dmtt-title-availability .stock,
body.single-product .summary.entry-summary .stock.in-stock {
    color: #159947 !important;
    font-weight: 600 !important;
}

/* ============================================================
   RESPONSIVE MOBILE
   ============================================================ */
@media (max-width: 768px) {
    body.single-product .dmtt-box,
    body.single-product .summary.entry-summary .dmtt-box,
    body.single-product .dmtt-features-specs-grid .dmtt-box {
        border-radius: 10px !important;
        padding: 13px 14px !important;
        margin: 16px 0 !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.07) !important;
    }

    body.single-product .summary.entry-summary .dmtt-box__title,
    body.single-product .dmtt-features-specs-grid .dmtt-box__title {
        font-size: 16px !important;
        font-weight: 700 !important;
        margin: 0 0 10px !important;
    }

    body.single-product .summary.entry-summary .dmtt-box__content,
    body.single-product .dmtt-features-specs-grid .dmtt-box__content {
        font-size: 14px !important;
        line-height: 1.6 !important;
    }

    body.single-product div.product .price ins,
    body.single-product div.product .price > .woocommerce-Price-amount {
        font-size: 36px !important;
        font-weight: 400 !important;
    }

    body.single-product div.product .price del {
        font-size: 20px !important;
    }
}

@media (max-width: 480px) {
    .single-product .dmtt-box { 
        padding: 13px 14px !important; 
    }

    .single-product .dmtt-box__title { 
        font-size: 14px !important; 
    }

    .single-product .dmtt-box__content,
    .single-product .dmtt-box__list li { 
        font-size: 13px !important; 
    }

    body.single-product div.product .price ins,
    body.single-product div.product .price > .woocommerce-Price-amount {
        font-size: 32px !important;
    }

    body.single-product div.product .price del {
        font-size: 18px !important;
    }
}

/* ============================================================
   PRODUCT CARD STYLES
   ============================================================ */
.dmtt-product-card { 
    list-style: none !important; 
}

.dmtt-card-inner {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 0.5px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
    transition: border-color 0.2s;
}

.dmtt-card-inner:hover { 
    border-color: #aaa; 
}

.dmtt-card-inner.is-out { 
    opacity: 0.6; 
}

.is-out .dmtt-img { 
    filter: grayscale(40%); 
}

.dmtt-img-wrap {
    position: relative;
    background: none;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dmtt-img {
    width: 100% !important;
    height: 190px !important;
    object-fit: contain !important;
    padding: 6px 4px !important;
}

.dmtt-badge-row {
    position: absolute;
    top: 5px;
    left: 5px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 5;
}

.dmtt-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 0 5px;
    border-radius: 2px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.dmtt-b-new    { background: #E24B4A; color: #fff; }
.dmtt-b-hot    { background: #E24B4A; color: #fff; }
.dmtt-b-out    { background: #888780; color: #fff; }
.dmtt-b-coming { background: #FFD700; color: #1a1a1a; }

.dmtt-body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.dmtt-brand {
    font-size: 10px;
    font-weight: 500;
    color: #185FA5;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
    flex-shrink: 0;
}

.dmtt-name {
    font-size: 14px;
    font-weight: 600;
    color: #3333cc;
    line-height: 1.4;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
    min-height: 36px;
    flex-shrink: 0;
}

.dmtt-name:hover { 
    color: #1f1f7a; 
}

.dmtt-divider {
    height: 0.5px;
    background: #e8e8e8;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.dmtt-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    height: 46px;
    overflow: hidden;
    align-content: flex-start;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.dmtt-tag {
    font-size: 10px;
    color: #555;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    border: 0.5px solid #e0e0e0;
    white-space: nowrap;
    height: 20px;
    display: flex;
    align-items: center;
}

.dmtt-price-block {
    flex-shrink: 0;
    margin-bottom: 6px;
}

.dmtt-price-old {
    font-size: 11px;
    color: #999;
    text-decoration: line-through;
    white-space: nowrap;
    flex-shrink: 0;
    display: block;
    margin-bottom: 2px;
}

.dmtt-price-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.dmtt-price-new {
    font-size: 17px;
    font-weight: 500;
    color: #E24B4A;
    line-height: 1.4;
}

.dmtt-badge-pct {
    font-size: 12px;
    font-weight: 500;
    background: #E24B4A;
    color: #fff;
    padding: 1px 5px;
    border-radius: 3px;
    flex-shrink: 0;
}

.dmtt-btn {
    display: block;
    width: 100%;
    padding: 7px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    margin-top: auto;
    flex-shrink: 0;
    box-sizing: border-box;
    border: none;
}

.dmtt-btn-cart {
    background: #ffc266;
    color: #fff !important;
    transition: background 0.2s;
}

.dmtt-btn-cart:hover { 
    background: #ffa31a; 
    color: #fff !important; 
}

.dmtt-btn-detail {
    background: transparent;
    color: #666 !important;
    border: 0.5px solid #ccc !important;
}

.dmtt-btn-detail:hover { 
    border-color: #aaa !important; 
    color: #333 !important; 
}

/* ============================================================
   PRODUCT CARD - MOBILE
   ============================================================ */
@media (max-width: 768px) {
    .woocommerce ul.products {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1px !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }

    .woocommerce ul.products li.product,
    .dmtt-product-card {
        width: 100% !important;
        margin: 0 !important;
        float: none !important;
        padding: 0 !important;
    }

    .dmtt-card-inner { 
        border-radius: 8px; 
    }

    .dmtt-body { 
        padding: 8px !important; 
    }

    .dmtt-img-wrap { 
        height: 150px !important; 
    }

    .dmtt-img { 
        height: 140px !important; 
        padding: 4px !important; 
    }

    .dmtt-name {
        font-size: 10px !important;
        -webkit-line-clamp: 2 !important;
        min-height: 30px !important;
        margin-bottom: 4px !important;
    }

    .dmtt-brand { 
        font-size: 9px !important; 
        margin-bottom: 2px !important; 
    }

    .dmtt-divider { 
        margin-bottom: 4px !important; 
    }

    .dmtt-specs { 
        height: 42px !important; 
        gap: 2px !important; 
        margin-bottom: 5px !important; 
    }

    .dmtt-tag { 
        font-size: 9px !important; 
        padding: 1px 4px !important; 
        height: 18px !important; 
    }

    .dmtt-price-new { 
        font-size: 17px !important; 
    }

    .dmtt-badge-pct { 
        font-size: 9px !important; 
        padding: 0px 2px !important; 
    }

    .dmtt-price-block { 
        margin-bottom: 4px !important; 
    }

    .dmtt-btn-cart { 
        font-size: 10px !important; 
        padding: 6px 4px !important; 
    }
}