/* Base table styles */
.digicommerce-table {
    @apply m-0 w-full border-collapse border-0 bg-white;

    .end {
        @apply text-right;
    }

    th,
    td {
        @apply border-0 p-4 text-left leading-normal;
    }

    th {
        @apply text-dark-blue font-bold;
    }

    thead th {
        @apply border-b border-solid border-b-[#e1e1e1];
    }

    tbody {
        @apply text-sm;

        tr:nth-child(odd) {
            @apply bg-[#f7f7f9];
        }
    }

    tfoot {
        @apply text-sm;

        th {
            @apply text-dark-blue;
        }

        td,
        th {
            @apply border-t border-solid border-t-[#e1e1e1];
        }

        .order-total {
            @apply text-medium;
        }
    }

    .amount {
        @apply text-base font-bold text-green-600;
    }
}

/* Responsive styles */
@media only screen and (max-width: 768px) {
    .digicommerce-table {
        tbody,
        tr,
        td {
            @apply block w-full;
        }

        th,
        thead {
            @apply hidden;
        }

        td {
            @apply before:text-dark-blue before:text-medium relative flex justify-between text-right before:float-left before:font-semibold before:content-[attr(data-label)];
        }

        td[rowspan] {
            @apply hidden;
        }
    }
}

/* Order total row */
.digicommerce-table tr.order-total {
    @apply bg-[#f7f7f9];

    th,
    td {
        @apply font-bold;
    }
}

/* RTL fix */
body.rtl {
    .digicommerce-table {
        .end {
            @apply text-left;
        }

        th,
        td {
            @apply text-right;
        }
    }
}

@media only screen and (max-width: 768px) {
    body.rtl .digicommerce-table {
        td {
            @apply text-left;
        }
    }
}
