/* =====================================
   CS Back In Stock - Full Stylesheet
   ===================================== */

/* Base wrapper */
.csbis-wrap {
    margin: 1rem 0;
}

/* Modal backdrop */
.csbis-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}

/* Modal card container */
.csbis-card {
    background: #fff;
    padding: 1.25rem;
    border-radius: 0.75rem;
    max-width: 420px;
    width: 92%;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.csbis-card h3 {
    margin-top: 0;
    font-size: 1.2rem;
}

.csbis-card input {
    width: 100%;
    padding: 0.75rem;
    margin: 0.4rem 0 1rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    font-size: 1rem;
}

/* Woo/Impreza button adjustments inside modal */
.csbis-card .button,
.csbis-card .us-btn-style_9 {
    margin-right: 0.5rem;
    margin-top: 0.3rem;
    padding: 0.7rem 1.2rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    white-space: nowrap;
}

/* Message area */
.csbis-msg {
    margin-top: 0.5rem;
}

/* Admin list styling */
.csbis-admin {
    margin: 1rem 0;
}

/* Table base */
.csbis-table {
    width: 100%;
    border-collapse: collapse;
}

.csbis-table th,
.csbis-table td {
    padding: 0.6rem;
    border-bottom: 1px solid #eaeaea;
    text-align: left;
}

/* Status badge */
.csbis-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 0.35rem;
    background: #f3f4f6;
    font-size: 12px;
}

/* =====================================
   MOBILE-FRIENDLY SUBSCRIPTION TABLE
   ===================================== */
@media (max-width: 768px) {
    .csbis-my-subs table.shop_table,
    .csbis-admin table.widefat {
        width: 100%;
        border: 0;
        border-collapse: collapse;
    }

    /* Hide header row */
    .csbis-my-subs table.shop_table thead {
        display: none;
    }

    /* Card-like layout for rows */
    .csbis-my-subs table.shop_table tr,
    .csbis-admin table.widefat tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #ddd;
        border-radius: 0.5rem;
        background: #fff;
        padding: 0.75rem;
    }

    /* Each cell becomes a flex row */
    .csbis-my-subs table.shop_table td,
    .csbis-admin table.widefat td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.4rem 0;
        border: none;
        text-align: left;
        font-size: 0.95rem;
    }

    /* Labels for each cell */
    .csbis-my-subs table.shop_table td::before,
    .csbis-admin table.widefat td::before {
        content: attr(data-label);
        flex: 0 0 45%;
        font-weight: 600;
        color: #555;
        text-transform: capitalize;
    }

    /* Impreza button override for full width on mobile */
    .csbis-my-subs .us-btn-style_9,
    .csbis-admin .us-btn-style_9,
    .csbis-my-subs .button,
    .csbis-admin .button {
        width: 100%;
        margin-top: 0.5rem;
        font-size: 0.9rem;
        text-align: center;
        border-radius: 0.5rem;
        box-sizing: border-box;
    }
}

/* Enhance readability in all views */
.csbis-my-subs td,
.csbis-my-subs th {
    word-break: break-word;
}

/* =====================================
   Tighter layout for mobile cards
   ===================================== */
@media (max-width: 768px) {
    /* Reduce gap between label and value */
    .csbis-my-subs table.shop_table td {
        align-items: flex-start;
        padding: 0.25rem 0;
    }

    .csbis-my-subs table.shop_table td::before {
        flex: 0 0 25%;
        font-weight: 600;
        color: #444;
        margin-right: 0.25rem;
        line-height: 1.3;
    }

    .csbis-my-subs table.shop_table td a,
    .csbis-my-subs table.shop_table td span,
    .csbis-my-subs table.shop_table td button {
        line-height: 1.3;
    }
}
/* Match Impreza button height and style for email field */
.csbis-card .csbis-email {
    display: block;
    width: 100%;
    height: 2.5rem; /* ✅ desired height */
    padding: 0 1rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    font-size: 1rem;
    line-height: 2.5rem;
    box-sizing: border-box;
    background: #fff;
    color: #333;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.csbis-card .csbis-email:focus {
    border-color: var(--color-content-primary, #333);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.csbis-card .csbis-email::placeholder {
    color: #999;
}
/* Vertically center all table cell content */
.csbis-my-subs table.shop_table td,
.csbis-my-subs table.shop_table th,
.csbis-admin table.widefat td,
.csbis-admin table.widefat th {
    vertical-align: middle;
}

/* Optional: tighten spacing and align Unsubscribe button better */
.csbis-my-subs table.shop_table td button,
.csbis-admin table.widefat td button {
    margin: 0;
    vertical-align: middle;
}

/* Optional: if the text still looks a hair off, align text baseline */
.csbis-my-subs table.shop_table td,
.csbis-admin table.widefat td {
    line-height: 1.4;
}
