.dewtec-sku-options {
    margin-top: 30px;
    margin-bottom: 30px;
    overflow-x: auto;
}

.dewtec-sku-options h4 {
    margin-bottom: 15px;
}

.dewtec-sku-options-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.dewtec-sku-options-table th,
.dewtec-sku-options-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e5e5;
    text-align: left;
    vertical-align: middle;
}

.dewtec-sku-options-table th {
    font-weight: 600;
}

.dewtec-image-cell {
    width: 90px;
}

.dewtec-image-cell img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    display: block;
}

.dewtec-sku-cell,
.dewtec-size-cell,
.dewtec-price-cell,
.dewtec-stock-cell,
.dewtec-action-cell,
.dewtec-enquire-cell,
.dewtec-view-product-cell {
    white-space: nowrap;
}

/* Tighten Add to Cart, Enquire and View Product columns */
.dewtec-sku-options-table th:nth-child(6),
.dewtec-sku-options-table td:nth-child(6) {
    width: 260px;
}

.dewtec-sku-options-table th:nth-child(7),
.dewtec-sku-options-table td:nth-child(7) {
    width: 130px;
    text-align: left;
}

.dewtec-sku-options-table th:nth-child(8),
.dewtec-sku-options-table td:nth-child(8) {
    width: 150px;
    text-align: left;
}

.dewtec-action-cell {
    min-width: 0;
    width: 260px;
}

.dewtec-enquire-cell {
    min-width: 0;
    width: 130px;
}

.dewtec-view-product-cell {
    min-width: 0;
    width: 150px;
}


/* =========================================================
   Archive Product SKU Summary
   ========================================================= */

.dewtec-archive-skus {
    display: block;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    margin: 4px 0;
    color: #d8d8d8 !important;
    opacity: 1 !important;
}

.dewtec-archive-skus,
.dewtec-archive-skus * {
    color: #d8d8d8 !important;
}


/* =========================================================
   Add to cart / back order button + quantity layout
   ========================================================= */

.dewtec-option-cart-form {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin: 0;
}

.dewtec-option-add-button,
.dewtec-option-backorder-button,
.dewtec-view-options-button,
.dewtec-enquire-button,
.dewtec-view-product-button {
    white-space: nowrap;
}

.dewtec-option-cart-form .quantity {
    margin: 0;
}

.dewtec-option-cart-form .quantity input {
    width: 70px;
    text-align: center;
}

.dewtec-option-backorder-button {
    background: #ff9800 !important;
    border-color: #ff9800 !important;
    color: #fff !important;
}

.dewtec-enquire-button,
.dewtec-view-product-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    color: inherit !important;
    border: 1px solid currentColor !important;
}


/* =========================================================
   Stock status
   ========================================================= */

.dewtec-stock-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.dewtec-stock-status::before {
    content: "";
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.dewtec-stock-in::before {
    background: #28a745;
}

.dewtec-stock-backorder::before {
    background: #ff9800;
}

.dewtec-stock-out::before {
    background: #ff2d2d;
}


/* =========================================================
   Out of stock text
   ========================================================= */

.dewtec-out-of-stock-text {
    display: inline-block;
    font-weight: 600;
    color: #777;
    white-space: nowrap;
}


/* =========================================================
   Group landing page behaviour
   ========================================================= */

/*
Normal WooCommerce Add to Cart is intentionally NOT hidden.
You asked for the main Add to Cart button to be visible again.
*/

/* Hide normal product price and SKU only on the group landing page */
body.dewtec-is-managed-group-landing .product-price,
body.dewtec-is-managed-group-landing .SKUelement,
body.dewtec-is-managed-group-landing .skuelement,
body.dewtec-is-managed-group-landing [class*="SKUelement"],
body.dewtec-is-managed-group-landing [class*="skuelement"] {
    display: none !important;
}

/* On SKU view mode, make sure product price/SKU can show again */
body.dewtec-is-sku-view-product .product-price,
body.dewtec-is-sku-view-product .SKUelement,
body.dewtec-is-sku-view-product .skuelement,
body.dewtec-is-sku-view-product [class*="SKUelement"],
body.dewtec-is-sku-view-product [class*="skuelement"] {
    display: initial !important;
}


/* =========================================================
   Remove old wrapper only if cached markup/classes still exist
   ========================================================= */

.dewtec-action-wrap {
    display: none !important;
}

/* =========================================================
   Hide main product Add to Cart only on group landing page
   ========================================================= */

body.dewtec-is-managed-group-landing form.cart:not(.dewtec-option-cart-form) {
    display: none !important;
}

body.dewtec-is-managed-group-landing .summary > form.cart:not(.dewtec-option-cart-form),
body.dewtec-is-managed-group-landing .woocommerce-variation-add-to-cart,
body.dewtec-is-managed-group-landing .single_add_to_cart_button:not(.dewtec-option-add-button):not(.dewtec-option-backorder-button) {
    display: none !important;
}


/* =========================================================
   Mobile layout - responsive product card style
   ========================================================= */

@media (max-width: 767px) {

    .dewtec-sku-options {
        overflow-x: visible;
        margin-top: 25px;
    }

    .dewtec-sku-options h4 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .dewtec-sku-options-table,
    .dewtec-sku-options-table thead,
    .dewtec-sku-options-table tbody,
    .dewtec-sku-options-table th,
    .dewtec-sku-options-table td,
    .dewtec-sku-options-table tr {
        display: block;
        width: 100%;
    }

    .dewtec-sku-options-table thead {
        display: none;
    }

    .dewtec-sku-options-table tbody {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .dewtec-sku-options-table tr {
        display: block;
        min-width: 0;
        overflow: hidden;
        padding: 12px;
        border: 1px solid rgba(255, 255, 255, 0.18);
        border-radius: 6px;
        background: #111;
        color: #fff;
        box-sizing: border-box;
    }

    .dewtec-sku-options-table td {
        border-bottom: none;
        padding: 0;
        min-width: 0;
        width: 100%;
        color: #d8d8d8;
        font-size: 12px;
        line-height: 1.45;
        box-sizing: border-box;
        white-space: normal;
    }

    .dewtec-sku-options-table th:nth-child(6),
    .dewtec-sku-options-table td:nth-child(6),
    .dewtec-sku-options-table th:nth-child(7),
    .dewtec-sku-options-table td:nth-child(7),
    .dewtec-sku-options-table th:nth-child(8),
    .dewtec-sku-options-table td:nth-child(8) {
        width: 100% !important;
        text-align: left;
    }

    .dewtec-image-cell {
        width: 100%;
        margin-bottom: 10px;
    }

    .dewtec-image-cell img {
        width: 100%;
        max-width: none;
        height: 120px;
        object-fit: contain;
        display: block;
        margin: 0 auto;
        background: #fff;
    }

    .dewtec-sku-cell,
    .dewtec-size-cell,
    .dewtec-price-cell,
    .dewtec-stock-cell {
        width: 100%;
        margin-bottom: 4px;
        white-space: normal;
    }

    .dewtec-sku-cell {
        font-weight: 600;
        color: #fff;
    }

    .dewtec-sku-cell::before {
        content: "SKU: ";
        color: #999;
        font-weight: 400;
    }

    .dewtec-size-cell::before {
        content: "Size: ";
        color: #999;
    }

    .dewtec-price-cell {
        font-weight: 600;
        color: #fff;
    }

    .dewtec-price-cell::before {
        content: "Price: ";
        color: #999;
        font-weight: 400;
    }

    .dewtec-stock-cell {
        margin-bottom: 10px;
    }

    .dewtec-stock-cell::before {
        content: "Stock: ";
        color: #999;
    }

    .dewtec-stock-status {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        font-size: 12px;
    }

    .dewtec-stock-status::before {
        width: 8px;
        height: 8px;
    }

    .dewtec-action-cell,
    .dewtec-enquire-cell,
    .dewtec-view-product-cell {
        width: 100% !important;
        min-width: 0;
    }

    .dewtec-option-cart-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 40px;
        gap: 8px;
        align-items: center;
        width: 100%;
        margin: 10px 0 0 0;
        box-sizing: border-box;
    }

    .dewtec-option-add-button,
    .dewtec-option-backorder-button {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        font-size: 12px;
        padding: 10px 6px;
        text-align: center;
        white-space: nowrap;
        box-sizing: border-box;
    }

    .dewtec-option-cart-form .quantity {
        width: 54px;
        min-width: 0;
        margin: 0;
    }

    .dewtec-option-cart-form .quantity input {
        width: 54px;
        height: 39px;
        min-width: 0;
        text-align: center;
        font-size: 12px;
        box-sizing: border-box;
    }

    .dewtec-out-of-stock-text {
        display: block;
        width: 70%;
        text-align: center;
        font-size: 12px;
        padding: 10px 8px;
        margin-top: 10px;
        border: 1px solid rgba(255, 255, 255, 0.18);
        color: #999;
        box-sizing: border-box;
    }

    td.dewtec-enquire-cell {
        width: 100% !important;
        min-width: 0;
        margin-top: 8px;
    }

    td.dewtec-view-product-cell {
        width: 100% !important;
        min-width: 0;
        margin-top: 8px;
    }

    .dewtec-enquire-button,
    .dewtec-view-product-button {
        display: flex;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        align-items: center;
        justify-content: center;
        text-align: center;
        font-size: 12px;
        padding: 9px 6px;
        white-space: nowrap;
        background: transparent !important;
        color: #fff !important;
        border: 1px solid rgba(255, 255, 255, 0.55) !important;
        box-sizing: border-box;
    }

    .dewtec-archive-skus {
        font-size: 13px;
        line-height: 1.4;
        margin: 4px 0;
    }
}

/* Very small mobile screens - switch to 1 column */
@media (max-width: 420px) {
    .dewtec-sku-options-table tbody {
        grid-template-columns: 1fr;
    }

    .dewtec-image-cell img {
        height: 150px;
    }

    .dewtec-option-cart-form,
    .dewtec-out-of-stock-text {
        width: 100%;
    }
}