/* Reset list styles injected by the active WordPress theme */
body.rbp-app-body ul,
body.rbp-app-body ol,
body.rbp-app-body li {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* App Layout */
body.rbp-app-body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, "system-ui", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #fff;
    color: #333;
    font-size: 0.8rem;
}

h1, h2, h3, h4, h5, h6 {
    font-family: inherit;
}

.rbp-header {
    background: #fff;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.rbp-header-inner {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0;
}

.rbp-logo {
    flex: 0 0 auto;
}

.rbp-right {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}

.rbp-logo a {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.rbp-nav {
    margin-left: 40px;
}

a.rbp-nav-link {
    text-decoration: none;
    color: #333;
    font-size: 1.2rem;
    font-weight: 500;
}

.rbp-logo-img {
    height: 38px;
    width: auto;
    display: block;
}


.rbp-icon-link {
    color: #333;
    font-size: 1.2rem;
    text-decoration: none;
    position: relative;
}

.rbp-cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: #ff4444;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 15px;
    text-align: center;
}

.rbp-filter-section {
    background: #fff;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
}

.rbp-filter-container {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: nowrap; /* Try to keep on one line */
}

.rbp-filters-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1 1 auto;
    flex-wrap: wrap; /* Allow filters to wrap internally if very tight, but container stays row */
}

.rbp-filter-group {
    display: flex;
    gap: 10px;
    align-items: center;
    white-space: nowrap; /* Prevent label wrapping */
}

.rbp-filters-right {
    flex: 0 0 300px; /* Fixed width for search to ensure space for filters */
    min-width: 200px;
}

.rbp-select, .rbp-input-small {
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.rbp-input-small {
    width: 100px;
}

.rbp-filter-toggle-btn {
    display: none;
    background: #f1f1f1;
    border: 1px solid #ccc;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
}

.rbp-mobile-header {
    display: none;
}

@media (max-width: 768px) {
    .rbp-filter-container {
        flex-direction: row; /* Keep toggle and search in row */
        flex-wrap: wrap;
        align-items: center;
    }
    
    .rbp-mobile-header {
        display: block;
        margin-right: 10px;
    }
    
    .rbp-filter-toggle-btn {
        display: block;
    }
    
    .rbp-filters-right {
        flex: 1; /* Take remaining space on top row */
        width: auto;
        min-width: 0; /* Allow shrinking */
    }
    
    .rbp-filters-left {
        width: 100%;
        display: none; /* Collapsed */
        flex-direction: column;
        gap: 15px;
        margin-top: 15px;
        order: 3; /* Force to bottom */
        border-top: 1px solid #eee;
        padding-top: 15px;
    }
    
    .rbp-filters-left.open {
        display: flex;
    }
    
    .rbp-filter-group {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    
    .rbp-select, .rbp-input-small {
        width: 100%;
    }
}

.rbp-main-content {
    padding: 20px;
    min-height: 80vh;
}

.rbp-main-content--centered {
    display: flex;
    justify-content: center;
    align-items: center;
}

.rbp-main-content--centered .rbp-container-fluid {
    width: 50%;
    text-align: center;
}

@media (max-width: 1024px) {
    .rbp-main-content--centered .rbp-container-fluid {
        width: 75%;
    }
}

@media (max-width: 768px) {
    .rbp-main-content--centered .rbp-container-fluid {
        width: 100%;
    }
}

.rbp-container-fluid {
    width: 100%;
    max-width: 100%;
}

.rbp-footer {
    background: #fff;
    border-top: 1px solid #ddd;
    padding: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

/* Rackbeat Pricelist Styles */

.rbp-pricelist-wrap {
    width: 100%;
    margin-bottom: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Cart Modal */
.rbp-modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    display: none; /* Hidden by default via JS, but also here */
    align-items: center;
    justify-content: center;
}

.rbp-modal.open {
    display: flex !important;
}

.rbp-modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 800px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.rbp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.rbp-modal-header h2 {
    margin: 0;
}

.rbp-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.rbp-close:hover,
.rbp-close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.rbp-cart-table-wrap {
    overflow-y: auto;
    flex: 1;
}

.rbp-cart-table {
    width: 100%;
    border-collapse: collapse;
}

.rbp-cart-table th {
    padding: 10px;
    text-align: left;
    background: rgb(71, 85, 105);
    color: #fff;
    font-weight: 600;
}

.rbp-cart-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.rbp-cart-table tbody tr:nth-child(odd) td {
    background: #fff;
}

.rbp-cart-table tbody tr:nth-child(even) td {
    background: #eaeaea;
}

.rbp-cart-actions {
    margin-top: 20px;
    text-align: right;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.rbp-btn-checkout {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    display: inline-block;
}

.rbp-btn-checkout:hover {
    background-color: #45a049;
}

.rbp-remove-item {
    color: #999;
    cursor: pointer;
    font-size: 1.2rem;
}

.rbp-remove-item:hover {
    color: #ff4444;
}

.rbp-pricelist {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    padding: 0;
}

.rbp-pricelist th, 
.rbp-pricelist td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e5e5;
    text-align: left;
}

.rbp-pricelist th {
    background-color: rgb(71, 85, 105);
    color: #fff;
    font-weight: 600;
    position: sticky;
    top: 60px; /* Height of the sticky app header */
    z-index: 900;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

.rbp-pricelist tbody tr {
    background-color: #fff;
}

.rbp-price {
    text-align: right;
    white-space: nowrap;
}

.rbp-pricelist .text-center {
    text-align: center;
}

.rbp-pricelist .text-right {
    text-align: right;
}

.rbp-supplier-separator td {
    background-color: rgb(71, 85, 105);
    height: 10px;
    padding: 0;
}

.rbp-pricelist tbody tr.udsolgt {
    opacity: 0.6;
    background-color: #fce4e4;
}

.rbp-pricelist tbody tr.nyhed,
.rbp-checkout-table tbody tr.nyhed {
    background-color: rgb(187, 247, 208);
}

.rbp-pricelist tbody tr.tilbud,
.rbp-checkout-table tbody tr.tilbud {
    background-color: rgb(254, 240, 138);
}

.rbp-pricelist tbody tr.preorder,
.rbp-checkout-table tbody tr.preorder {
    background-color: rgb(186, 230, 253);
}

.rbp-table-separator {
    height: 40px;
    background-color: transparent;
}

.rbp-section-title h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5em;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.rbp-error, 
.rbp-empty {
    color: #666;
    font-style: italic;
    padding: 10px;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
}

/* =============================================
   CHECKOUT PAGE
   ============================================= */

.rbp-checkout-wrapper,
.rbp-profile-wrapper,
.rbp-login-container,
.rbp-login-wrapper {
    font-family: -apple-system, "system-ui", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.rbp-checkout-wrapper {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.rbp-checkout-wrapper h2 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: #111;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 12px;
}

.rbp-checkout-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.rbp-checkout-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 24px;
}

.rbp-checkout-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.rbp-customer-info p {
    margin: 6px 0;
    color: #444;
    font-size: 0.95rem;
}

.rbp-customer-info strong {
    color: #222;
    min-width: 80px;
    display: inline-block;
}

/* Checkout Table */
.rbp-checkout-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.rbp-checkout-table th {
    text-align: left;
    padding: 10px 12px;
    background: rgb(71, 85, 105);
    color: #fff;
    font-weight: 600;
}

.rbp-checkout-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    color: #444;
}

.rbp-checkout-table tbody tr:nth-child(odd) td {
    background: #fff;
}

.rbp-checkout-table tbody tr:nth-child(even) td {
    background: #eaeaea;
}

.rbp-checkout-table tfoot th {
    background: #fafafa;
    border-top: 2px solid #ddd;
    border-bottom: none;
    font-size: 1rem;
}

.rbp-checkout-table .text-right {
    text-align: right;
}

/* Delivery Options */
.rbp-delivery-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rbp-radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 4px;
    transition: background 0.15s;
}

.rbp-radio-label:hover {
    background: #f5f5f5;
}

.rbp-radio-label input[type="radio"] {
    accent-color: #2c3e50;
    width: 16px;
    height: 16px;
}

.rbp-radio-label span {
    color: #444;
    font-size: 0.95rem;
}

/* Order Notes */
.rbp-order-notes label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.rbp-order-notes textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    color: #333;
}

.rbp-order-notes textarea:focus {
    outline: none;
    border-color: #2c3e50;
}

/* Checkout Actions */
.rbp-checkout-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 20px 0 10px;
}

/* Buttons */
.rbp-btn-primary {
    display: inline-block;
    padding: 10px 22px;
    background: #2c3e50;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.rbp-btn-primary:hover {
    background: #1a252f;
    color: #fff;
    text-decoration: none;
}

.rbp-btn-secondary {
    display: inline-block;
    padding: 10px 22px;
    background: transparent;
    color: #2c3e50;
    border: 1px solid #2c3e50;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.rbp-btn-secondary:hover {
    background: #2c3e50;
    color: #fff;
    text-decoration: none;
}

.rbp-btn-primary.is-loading {
    opacity: 0.6;
    cursor: wait;
}

/* =============================================
   CHECKOUT SUCCESS
   ============================================= */

.rbp-checkout-success {
    text-align: center;
    padding: 60px 20px;
}

.rbp-checkout-success h2 {
    font-size: 1.8rem;
    color: #111;
    margin-bottom: 16px;
}

.rbp-checkout-success p {
    color: #555;
    margin-bottom: 30px;
    font-size: 1rem;
}

.rbp-order-error {
    color: #c0392b;
    font-size: 0.9rem;
    margin: 0 0 12px;
    font-style: normal;
}

/* =============================================
   LOGIN PAGE
   ============================================= */

.rbp-login-container {
    max-width: 420px;
    margin: 60px auto;
    padding: 36px 40px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.rbp-login-wrapper {
    max-width: 420px;
    margin: 60px auto;
    padding: 30px;
    text-align: center;
}

/* wp_login_form() wraps each field in <p>, with label wrapping the input */
#rbp-loginform p {
    margin: 0 0 16px 0;
}

#rbp-loginform label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* The <br> inside labels creates a line break — inputs sit below label text */
#rbp-loginform input[type="text"],
#rbp-loginform input[type="password"],
#rbp-loginform input.input {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    margin-top: 6px;
    box-sizing: border-box;
    background: #fafafa;
    color: #333;
    transition: border-color 0.2s, background 0.2s;
}

#rbp-loginform input[type="text"]:focus,
#rbp-loginform input[type="password"]:focus,
#rbp-loginform input.input:focus {
    outline: none;
    border-color: #2c3e50;
    background: #fff;
}

/* Remember me row */
#rbp-loginform .login-remember {
    margin: 0 0 20px 0;
}

#rbp-loginform .login-remember label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    color: #555;
    cursor: pointer;
}

#rbp-loginform .login-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #2c3e50;
}

/* Submit button — WP outputs <p class="submit"> with <input id="wp-submit"> */
#rbp-loginform .submit {
    margin: 0;
}

#rbp-loginform #wp-submit {
    width: 100%;
    padding: 12px;
    background: #2c3e50;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

#rbp-loginform #wp-submit:hover {
    background: #1a252f;
}

/* Password show/hide button (WP 5.x+) */
#rbp-loginform .wp-pwd {
    position: relative;
}

#rbp-loginform .wp-hide-pw {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    padding: 4px;
}

.rbp-login-links {
    text-align: center;
    margin-top: 20px;
    font-size: 0.875rem;
    color: #888;
}

.rbp-login-links a {
    color: #2c3e50;
    text-decoration: none;
}

.rbp-login-links a:hover {
    text-decoration: underline;
}

/* =============================================
   PROFILE PAGE
   ============================================= */

.rbp-profile-wrapper {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
}

.rbp-profile-meta {
    margin-bottom: 28px;
    color: #444;
    font-size: 0.95rem;
    line-height: 1.7;
}

.rbp-profile-meta p {
    margin: 0;
}

.rbp-profile-delivery::before {
    content: '↳ ';
    color: #999;
}

.rbp-profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 14px;
}

.rbp-profile-header h2 {
    margin: 0;
    font-size: 1.8rem;
    color: #111;
}

.rbp-profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.rbp-profile-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px 24px;
}

.rbp-profile-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 14px 0;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.rbp-profile-card h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
    margin: 12px 0 6px;
}

.rbp-info-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.rbp-label {
    font-weight: 600;
    color: #555;
    min-width: 100px;
    flex-shrink: 0;
}

.rbp-value {
    color: #333;
}

.rbp-profile-card address {
    font-style: normal;
    font-size: 0.9rem;
    color: #444;
    line-height: 1.6;
}

.rbp-profile-actions {
    margin-top: 30px;
    text-align: center;
}

/* =============================================
   OPEN ORDERS SECTION (profile page)
   ============================================= */

.rbp-orders-section {
    margin-top: 32px;
    margin-bottom: 8px;
}

.rbp-orders-section > h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: #111;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.rbp-orders-table-wrap {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px 24px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.rbp-orders-table-wrap h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #333;
}

.rbp-orders-summary {
    display: flex;
    gap: 24px;
    margin-bottom: 14px;
    font-size: 0.875rem;
    color: #555;
    background: #f5f5f2;
    padding: 8px 14px;
    border-radius: 4px;
    border: 1px solid #e8e8e4;
}

.rbp-orders-summary span {
    font-weight: 600;
    color: #333;
}

.rbp-orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.rbp-orders-table th {
    background: rgb(71, 85, 105);
    color: #fff;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.rbp-orders-table td {
    padding: 9px 12px;
    border-bottom: 1px solid #eee;
    color: #444;
    vertical-align: top;
}

.rbp-orders-table tbody tr:nth-child(odd) td {
    background: #fff;
}

.rbp-orders-table tbody tr:nth-child(even) td {
    background: #eaeaea;
}

.rbp-orders-table .text-right {
    text-align: right;
    white-space: nowrap;
}

.rbp-orders-table tbody tr.nyhed,
.rbp-orders-table tbody tr.preorder,
.rbp-orders-table tbody tr.tilbud,
.rbp-orders-table tbody tr.udsolgt {
    background-color: transparent;
}

.rbp-shipments-table {
    table-layout: fixed;
}

.rbp-shipments-table th:nth-child(1),
.rbp-shipments-table td:nth-child(1) {
    width: 10%;
}

.rbp-shipments-table th:nth-child(2),
.rbp-shipments-table td:nth-child(2) {
    width: 40%;
}

.rbp-shipments-table th:nth-child(3),
.rbp-shipments-table td:nth-child(3) {
    width: 40%;
}

.rbp-shipments-table th:nth-child(4),
.rbp-shipments-table td:nth-child(4) {
    width: 10%;
}

.rbp-orders-empty {
    padding: 20px;
    color: #666;
    font-style: italic;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    text-align: center;
}

/* =============================================
   Responsive styles
   ============================================= */
@media screen and (max-width: 768px) {
    .rbp-pricelist-wrap {
        overflow-x: unset;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
    }

    /* Two-row mobile header */
    .rbp-header {
        height: auto;
        padding: 10px 16px;
    }

    .rbp-header-inner {
        flex-wrap: wrap;
        justify-content: space-between;
        row-gap: 10px;
    }

    /* Row 1: logo full-width centered */
    .rbp-logo {
        flex: 0 0 100%;
        text-align: center;
    }

    .rbp-logo-img {
        height: auto;
        width: 85%;
        max-width: 320px;
    }

    /* Row 2: nav left, icons right */
    .rbp-nav {
        display: flex;
        align-items: center;
        flex: 1;
        margin-left: 0;
    }

    .rbp-right {
        flex: 0 0 auto;
        margin-left: 0;
        gap: 24px;
    }

    /* Adjust sticky th offset for taller mobile header */
    .rbp-pricelist th {
        top: 0;
    }

    .rbp-checkout-wrapper,
    .rbp-profile-wrapper {
        padding: 0 12px;
        margin: 20px auto;
    }

    .rbp-checkout-actions {
        flex-direction: column;
    }

    .rbp-btn-primary,
    .rbp-btn-secondary {
        width: 100%;
        text-align: center;
    }

    .rbp-profile-grid {
        grid-template-columns: 1fr;
    }

    .rbp-login-container {
        margin: 30px 16px;
        padding: 24px 20px;
    }
}

/* =============================================
   PRICELIST CARD LAYOUT (mobile)
   ============================================= */
@media (max-width: 768px) {

    /* Hide the sticky header row */
    .rbp-pricelist thead {
        display: none;
    }

    /* Hide supplier separator bars */
    .rbp-supplier-separator {
        display: none;
    }

    /* Hide table-separator gap between sections */
    .rbp-table-separator {
        height: 16px;
    }

    /* Each row becomes a card */
    .rbp-pricelist tbody tr {
        display: flex;
        flex-wrap: wrap;
        border: 1px solid #ddd;
        border-radius: 8px;
        margin-bottom: 10px;
        padding: 10px 12px;
        background: #fff;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    }

    /* Status colors still apply as card backgrounds */
    .rbp-pricelist tbody tr.nyhed    { background-color: rgb(187, 247, 208); border-color: #86efac; }
    .rbp-pricelist tbody tr.preorder { background-color: rgb(186, 230, 253); border-color: #7dd3fc; }
    .rbp-pricelist tbody tr.tilbud   { background-color: rgb(254, 240, 138); border-color: #fde047; }
    .rbp-pricelist tbody tr.udsolgt  { background-color: #fce4e4; border-color: #fca5a5; }

    /* Reset all td */
    .rbp-pricelist td {
        display: block;
        box-sizing: border-box;
        border-bottom: none;
        padding: 2px 4px;
        text-align: left;
        white-space: normal;
        font-size: 0.82rem;
    }

    /* Override desktop text-align utility classes */
    .rbp-pricelist td.text-center,
    .rbp-pricelist td.text-right {
        text-align: left;
    }

    /* --- Visual ordering via flexbox order --- */

    /* (7) Product name — card heading, FIRST */
    .rbp-pricelist td:nth-child(7) {
        order: 1;
        width: 100%;
        font-size: 0.95rem;
        font-weight: 700;
        color: #111;
        padding-bottom: 2px;
    }

    /* (6) Supplier — hidden */
    .rbp-pricelist td:nth-child(6) {
        display: none;
    }

    /* (8) Description — right below product name */
    .rbp-pricelist td:nth-child(8) {
        order: 2;
        width: 100%;
        font-size: 0.82rem;
        color: #555;
        padding-bottom: 4px;
    }
    .rbp-pricelist td:nth-child(8):empty {
        display: none;
    }

    /* (4) Status — below description, divider below */
    .rbp-pricelist td:nth-child(4) {
        order: 3;
        width: 100%;
        padding-bottom: 8px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }

    /* Two-column grid (col1 left, col2 right per row) */

    /* (3) Lager — col1 */
    .rbp-pricelist td:nth-child(3) {
        order: 4;
        width: 50%;
    }
    .rbp-pricelist td:nth-child(3)::before {
        content: "Lager: ";
        font-weight: 600;
        color: #555;
    }

    /* (5) Uge — col2 */
    .rbp-pricelist td:nth-child(5) {
        order: 5;
        width: 50%;
    }
    .rbp-pricelist td:nth-child(5)::before {
        content: "Uge: ";
        font-weight: 600;
        color: #555;
    }

    /* (9) ABV — col1 */
    .rbp-pricelist td:nth-child(9) {
        order: 6;
        width: 50%;
    }
    .rbp-pricelist td:nth-child(9)::before {
        content: "ABV: ";
        font-weight: 600;
        color: #555;
    }

    /* (12) Rating — col2 */
    .rbp-pricelist td:nth-child(12) {
        order: 7;
        width: 50%;
    }
    .rbp-pricelist td:nth-child(12)::before {
        content: "Rating: ";
        font-weight: 600;
        color: #555;
    }

    /* (10) Pris (packaged) / Pris/liter (kegged) — col1 */
    .rbp-packaged .rbp-pricelist td:nth-child(10) {
        order: 8;
        width: 50%;
    }
    .rbp-packaged .rbp-pricelist td:nth-child(10)::before {
        content: "Pris: ";
        font-weight: 600;
        color: #555;
    }
    .rbp-kegged .rbp-pricelist td:nth-child(10) {
        order: 8;
        width: 50%;
    }
    .rbp-kegged .rbp-pricelist td:nth-child(10)::before {
        content: "Pris/liter: ";
        font-weight: 600;
        color: #555;
    }

    /* (11) Kolli (packaged) / Pris (kegged) — col2 */
    .rbp-packaged .rbp-pricelist td:nth-child(11) {
        order: 9;
        width: 50%;
    }
    .rbp-packaged .rbp-pricelist td:nth-child(11)::before {
        content: "Kolli: ";
        font-weight: 600;
        color: #555;
    }
    .rbp-kegged .rbp-pricelist td:nth-child(11) {
        order: 9;
        width: 50%;
    }
    .rbp-kegged .rbp-pricelist td:nth-child(11)::before {
        content: "Pris: ";
        font-weight: 600;
        color: #555;
    }

    /* (1) Order select — last, full width */
    .rbp-pricelist td:nth-child(1) {
        order: 10;
        width: 100%;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
    }
    .rbp-pricelist td:nth-child(1) select {
        width: 100%;
        padding: 8px;
        font-size: 0.9rem;
    }
}

/* =============================================
   CART MODAL — mobile
   ============================================= */
@media (max-width: 768px) {

    /* Tighter modal on small screens */
    .rbp-modal-content {
        width: 96%;
        padding: 14px 12px;
    }

    /* Escape table layout so grid works reliably */
    .rbp-cart-table,
    .rbp-cart-table tbody,
    .rbp-cart-table tfoot {
        display: block;
        width: 100%;
    }

    /* Order total row: label left, amount right */
    .rbp-cart-table tfoot tr {
        display: flex;
        width: 100%;
    }

    .rbp-cart-table tfoot th:nth-child(1) {
        flex: 1;
        text-align: left;
        box-sizing: border-box;
    }

    .rbp-cart-table tfoot th:nth-child(2) {
        flex: 0 0 auto;
        text-align: right;
        box-sizing: border-box;
    }

    /* Hide empty delete-column placeholder */
    .rbp-cart-table tfoot th:nth-child(3) {
        display: none;
    }

    /* Hide thead */
    .rbp-cart-table thead {
        display: none;
    }

    /* Each row = 2-row grid card */
    .rbp-cart-table tbody tr {
        display: grid;
        grid-template-columns: auto auto 1fr auto;
        grid-template-areas:
            "name  name  name  name"
            "trash qty   price total";
        border-bottom: 1px solid #eee;
        padding: 10px 0;
    }

    /* Cancel alternating stripe */
    .rbp-cart-table tbody tr:nth-child(odd) td,
    .rbp-cart-table tbody tr:nth-child(even) td {
        background: transparent;
    }

    /* Reset all td */
    .rbp-cart-table td {
        display: block;
        box-sizing: border-box;
        border-bottom: none;
        padding: 2px 4px;
        white-space: normal;
        font-size: 0.82rem;
    }

    /* (1) Product name — full width row 1 */
    .rbp-cart-table td:nth-child(1) {
        grid-area: name;
        font-weight: 700;
        font-size: 0.88rem;
        padding-bottom: 6px;
    }

    /* (2) Qty select — row 2 */
    .rbp-cart-table td:nth-child(2) {
        grid-area: qty;
        align-self: center;
    }
    .rbp-cart-table td:nth-child(2) select {
        font-size: 0.8rem;
    }

    /* (3) Unit price — row 2, fills middle, right-aligned */
    .rbp-cart-table td:nth-child(3) {
        grid-area: price;
        color: #555;
        text-align: right;
        align-self: center;
    }

    /* (4) Line total — row 2, right edge */
    .rbp-cart-table td:nth-child(4) {
        grid-area: total;
        font-weight: 600;
        text-align: right;
        align-self: center;
    }

    /* (5) Delete icon — row 2, left */
    .rbp-cart-table td:nth-child(5) {
        grid-area: trash;
        align-self: center;
        padding-right: 6px;
    }
}

/* =============================================
   PROFILE PAGE — mobile
   ============================================= */
@media (max-width: 768px) {

    /* Stack company name above logout button */
    .rbp-profile-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .rbp-profile-header h2 {
        font-size: 1.3rem;
    }

    /* Summary pills stack vertically */
    .rbp-orders-summary {
        flex-direction: column;
        gap: 6px;
    }

    /* Remove box — flat layout on mobile */
    .rbp-orders-table-wrap {
        overflow-x: visible;
        padding: 0;
        background: none;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    /* Prevent logout button from overflowing viewport */
    .rbp-profile-header .rbp-btn-secondary {
        width: auto;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Hide thead */
    .rbp-orders-table thead {
        display: none;
    }

    /* Each row becomes a card */
    .rbp-orders-table tbody tr {
        display: flex;
        flex-wrap: wrap;
        border: 1px solid #ddd;
        border-radius: 8px;
        margin-bottom: 10px;
        padding: 10px 12px;
        background: #fff;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    }

    /* Cancel alternating row backgrounds inside cards */
    .rbp-orders-table tbody tr:nth-child(odd) td,
    .rbp-orders-table tbody tr:nth-child(even) td {
        background: transparent;
    }

    /* Reset all td */
    .rbp-orders-table td {
        display: block;
        box-sizing: border-box;
        border-bottom: none;
        padding: 2px 4px;
        text-align: left;
        white-space: normal;
        font-size: 0.82rem;
        vertical-align: top;
    }

    /* Override text-right in mobile */
    .rbp-orders-table td.text-right {
        text-align: left;
    }

    /* (2) Produkt — card heading, FIRST */
    .rbp-orders-table td:nth-child(2) {
        order: 1;
        width: 100%;
        font-size: 0.95rem;
        font-weight: 700;
        color: #111;
        padding-bottom: 2px;
    }

    /* (3) Beskrivelse — right below product name, hide if empty */
    .rbp-orders-table td:nth-child(3) {
        order: 2;
        width: 100%;
        color: #555;
        padding-bottom: 4px;
    }
    .rbp-orders-table td:nth-child(3):empty {
        display: none;
    }

    /* (1) Status — below description, divider below */
    .rbp-orders-table td:nth-child(1) {
        order: 3;
        width: 100%;
        padding-bottom: 8px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }

    /* (4) Antal — col1 */
    .rbp-orders-table td:nth-child(4) {
        order: 4;
        width: 50%;
    }
    .rbp-orders-table td:nth-child(4)::before {
        content: "Antal: ";
        font-weight: 600;
        color: #555;
    }

    /* (5) Stk. pris — col2 */
    .rbp-orders-table td:nth-child(5) {
        order: 5;
        width: 50%;
    }
    .rbp-orders-table td:nth-child(5)::before {
        content: "Stk. pris: ";
        font-weight: 600;
        color: #555;
    }

    /* (6) I alt — hidden on mobile */
    .rbp-orders-table td:nth-child(6) {
        display: none;
    }
}

/* =============================================
   CHECKOUT TABLE — mobile
   ============================================= */
@media (max-width: 768px) {

    /* Escape table layout */
    .rbp-checkout-table,
    .rbp-checkout-table tbody,
    .rbp-checkout-table tfoot {
        display: block;
        width: 100%;
    }

    /* Hide thead */
    .rbp-checkout-table thead {
        display: none;
    }

    /* Each row = 2-row grid card */
    .rbp-checkout-table tbody tr {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-areas:
            "name  name  name"
            "qty   price total";
        padding: 8px 6px;
        margin-bottom: 5px;
        background: #fff;
    }

    /* Striped rows */
    .rbp-checkout-table tbody tr:nth-child(even) {
        background: #eaeaea;
    }

    /* Remove status color backgrounds */
    .rbp-checkout-table tbody tr.nyhed,
    .rbp-checkout-table tbody tr.preorder,
    .rbp-checkout-table tbody tr.tilbud,
    .rbp-checkout-table tbody tr.udsolgt {
        background-color: transparent;
    }

    /* Cancel td-level stripe (background now on tr) */
    .rbp-checkout-table tbody tr:nth-child(odd) td,
    .rbp-checkout-table tbody tr:nth-child(even) td {
        background: transparent;
    }

    /* Reset td */
    .rbp-checkout-table td {
        display: block;
        box-sizing: border-box;
        border-bottom: none;
        padding: 2px 4px;
        font-size: 0.82rem;
    }

    /* (1) Product name — row 1, full width */
    .rbp-checkout-table td:nth-child(1) {
        grid-area: name;
        font-weight: 700;
        font-size: 0.88rem;
        padding-bottom: 4px;
    }

    /* (2) Antal — row 2, left */
    .rbp-checkout-table td:nth-child(2) {
        grid-area: qty;
        align-self: center;
        color: #555;
    }

    /* (3) Stk. pris — row 2, fills middle */
    .rbp-checkout-table td:nth-child(3) {
        grid-area: price;
        align-self: center;
        text-align: right;
        color: #555;
    }

    /* (4) Total — row 2, right edge */
    .rbp-checkout-table td:nth-child(4) {
        grid-area: total;
        align-self: center;
        text-align: right;
        font-weight: 600;
    }

    /* Tfoot: label left, total right */
    .rbp-checkout-table tfoot tr {
        display: flex;
        width: 100%;
        background: rgb(71, 85, 105);
        color: #fff;
        padding: 10px 6px;
        box-sizing: border-box;
    }

    .rbp-checkout-table tfoot th:nth-child(1) {
        flex: 1;
        text-align: left;
        box-sizing: border-box;
        background: transparent;
        border: none;
        color: #fff;
    }

    .rbp-checkout-table tfoot th:nth-child(2) {
        flex: 0 0 auto;
        text-align: right;
        box-sizing: border-box;
        background: transparent;
        border: none;
        color: #fff;
    }
}

/* =============================================
   Bestilt Column Styling
   ============================================= */
/* Only apply dark background to cells with values */
tbody .rbp-ordered-column.has-value {
    background-color: #333 !important;
    color: white !important;
}
