/* =============================================================================
   MY ACCOUNT — sidebar + subscription page restyle
   Loaded only on account pages (see inc/my-account-subscriptions.php).
   Brand colours reused from the rest of the site: navy #102456, yellow
   #f4dd6c. Card layout is built on <table>/<tr>/<td> (not divs) in the
   subscription-details.php / subscription-totals-table.php overrides — the
   Self-Service Dashboard plugin's JS binds to those exact tag/class
   combinations, so this file uses `display: flex/grid` on the table
   elements rather than restructuring the markup itself.
   ========================================================================= */

/* ---- sidebar navigation ---- */
.woocommerce-account .woocommerce-MyAccount-navigation ul {
    background: #fff;
    border: 1px solid #ececec;
    padding: 8px 0;
    text-decoration: none;
    text-transform: uppercase;
}
.woocommerce-account .woocommerce-MyAccount-navigation ul li {
    border-left: 3px solid transparent;
}
.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
    color: #102456;
    display: block;
    font-size: 0.85em;
    letter-spacing: 0.02em;
    padding: 11px 24px;
    text-decoration: none;
}
.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover {
    color: #f8dc54;
}
.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active {
    border-left-color: #f8dc54;
}
.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a {
    color: #f8dc54;
    font-weight: bold;
}

/* ---- page heading + "Add new product" button ---- */
.woocommerce-account .woocommerce-MyAccount-content > h2:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: "bikobold";
    text-transform: uppercase;
}
.wpr-add-product.button {
    background-color: #f8dc54;
    border: none;
    border-radius: 4px;
    color: #102456 !important;
    float: right;
    font-family: "bikobold";
    margin-bottom: 20px;
    padding: 12px 20px;
    text-decoration: none !important;
    text-transform: uppercase;
}
.wpr-add-product.button:hover {
    background-color: #102456;
    color: #fff !important;
}

/* ---- shared table reset: these stay real <table>s for plugin-JS
   compatibility, CSS just strips the table chrome ---- */
.nibble-subscription-table,
.nibble-subscription-totals-table {
    border: none;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}
.nibble-subscription-table tbody,
.nibble-subscription-totals-table tbody {
    display: block;
}

/* ---- 4-card summary row ---- */
.nibble-cards-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 36px;
}
.nibble-card {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 6px;
    box-sizing: border-box;
    display: flex;
    flex: 1 1 200px;
    flex-direction: column;
    padding: 18px 20px;
}
.nibble-card-icon {
    height: 24px;
    margin-bottom: 10px;
    width: 24px;
}
.nibble-card-label {
    color: #102456;
    font-family: "bikoregular";
    font-size: 0.75em;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.nibble-card-value {
    color: #102456;
    font-size: 1.15em;
    font-weight: bold;
    margin-top: 4px;
}
.nibble-card-meta {
    color: #102456;
    font-size: 0.85em;
    margin-top: 4px;
}
.nibble-card-meta--toggle {
    align-items: center;
    display: flex;
    gap: 8px;
}
.nibble-card-value .ssd-skip-renewal.button,
.nibble-card-meta .ssd-skip-renewal.button {
    background: none;
    border: none;
    color: #102456;
    display: inline-block;
    font-size: 0.7em;
    margin-left: 6px;
    padding: 0;
    text-decoration: underline;
}
.nibble-card-value .ssd-skip-renewal.button:hover,
.nibble-card-meta .ssd-skip-renewal.button:hover{
    color: #F4DA40 !important;
}
.ssd-skip-renewal-form .ssd-skip-renewal-input{
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 6px 10px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
}
.ssd-skip-renewal-form .ssd-skip-renewal-save{
    min-width: 80px;
    padding: 10px;
    font-size: 14px;
    line-height: 14px;
    margin: 5px;
    background-color: #f8dc54;
    cursor: pointer;
}
.ssd-skip-renewal-form .ssd-skip-renewal-cancel{
    min-width: 80px;
    padding: 10px;
    font-size: 14px;
    line-height: 14px;
    margin: 5px;
    background-color: hwb(52 87% 2%);
    cursor: pointer;

}
.ssd-skip-renewal-form .ssd-skip-renewal-cancel:hover{
    background-color: var(--color-dark);
}
.nibble-subscription-view .nibble-card .nibble-card-action {
    background-color: #f8dc54;
    /* This link also carries a "button" class now (needed so the Self-
       Service Dashboard plugin's JS can find it - see subscription-
       details.php) which brings in the site's generic .button/.box-link
       rule (border, min-width: 170px). border/min-width are reset here so
       adding that class doesn't also change this button's look. */
    border: none;
    border-radius: 4px;
    color: #102456!important;
    display: inline-block;
    font-family: "bikobold";
    font-size: 0.8em;
    margin-top: 10px;
    min-width: 0;
    padding: 8px 14px;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    width: fit-content;
}
.nibble-subscription-view .nibble-card .nibble-card-action:hover {
    background-color: #102456;
    color: #fff!important;
}
.nibble-status-active .nibble-card-value,
.nibble-status-active { color: #1a7f37; }
.nibble-status-on-hold .nibble-card-value,
.nibble-status-cancelled .nibble-card-value,
.nibble-status-expired .nibble-card-value { color: #9b1533; }

/* ---- "Change frequency" row (Self-Service Dashboard plugin) — kept as a
   real <tr>/<td> for its jQuery(#id...) bindings, restyled into a slim
   line under the cards; first <td> label is hidden since the FREQUENCY
   card above already labels it. ---- */
#sf_change_frequency_subscription_row {
    display: block;
}
#sf_change_frequency_subscription_row > td:first-child {
    display: none;
}
#sf_change_frequency_subscription_row > td:last-child {
    display: block;
    padding: 0 0 16px;
}
#sf_change_frequency_subscription_row .view,
#sf_change_frequency_subscription_row .edit {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
/* The <select> was shrinking to fit inside the flex row with no explicit
   size, which let its selected option's text wrap across multiple lines
   instead of showing on one — fix its box so it renders (and behaves) like
   a normal dropdown. */
#sf_change_frequency_subscription_row select#sf_subscription_frequency {
    -webkit-appearance: menulist;
    appearance: auto;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    flex: 0 0 auto;
    height: 40px;
    line-height: 1.2;
    min-width: 220px;
    overflow: hidden;
    padding: 6px 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: auto;
}
#sf_change_frequency_subscription_row a.button,
#sf_change_frequency_subscription_row button {
    background-color: transparent;
    border: 1px solid #102456;
    border-radius: 4px;
    color: #102456 !important;
    cursor: pointer;
    font-size: 0.8em;
    padding: 6px 12px;
    text-decoration: none;
    text-transform: uppercase;
    margin: 0px;
    min-height: 40px;
    line-height: 22px;
    align-items: center;
    display: flex;
    justify-content: center;
}
#sf_change_frequency_subscription_row a.button:hover,
#sf_change_frequency_subscription_row button:hover {
    background-color: #102456;
    color: #fff !important;
}

/* ---- generic hidden hook rows (auto-renew toggle already shown in the
   Payment method card; anything else another plugin adds here stays
   readable but out of the way) ---- */
.nibble-subscription-table > tbody > tr:not(.nibble-cards-row):not(.nibble-actions-row):not(.nibble-meta-row):not(#sf_change_frequency_subscription_row) {
    display: block;
}

/* ---- primary action buttons row (Cancel, Change shipping, ...) ---- */
.nibble-actions-row {
    display: block;
    margin-bottom: 20px;
}
.nibble-actions-row td {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.nibble-action-button {
    background-color: #f8dc54;
    border-radius: 4px;
    color: #102456 !important;
    display: inline-block;
    font-family: "bikobold";
    padding: 12px 22px;
    text-decoration: none !important;
    text-transform: uppercase;
}
.nibble-action-button:hover {
    background-color: #102456;
    color: #fff !important;
}
.nibble-action-button--danger {
    background-color: #b3261e;
    color: #fff !important;
}
.nibble-action-button--danger:hover {
    background-color: #102456;
}

/* ---- secondary dates (start / end / trial end) ---- */
.nibble-meta-row {
    display: block;
    margin-bottom: 20px;
}
.nibble-meta-row td {
    color: #102456;
    display: flex;
    flex-wrap: wrap;
    font-size: 0.85em;
    gap: 20px;
}
.nibble-meta-row strong {
    color: #102456;
}

/* ---- product row ---- */
.nibble-subscription-totals-table > tbody > tr.nibble-product-row {
    align-items: center;
    border: 1px solid #ececec;
    border-radius: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
    padding: 14px;
}
.nibble-product-image {
    flex: 0 0 auto;
}
.nibble-product-image img {
    border-radius: 4px;
    display: block;
    height: 64px;
    object-fit: cover;
    width: 64px;
}
.nibble-subscription-totals-table td.product-name {
    color: #102456;
    flex: 1 1 240px;
}
.nibble-subscription-totals-table td.product-name a {
    color: #102456;
    font-weight: bold;
}
.nibble-subscription-totals-table td.product-quantity {
    color: #102456;
}
.nibble-subscription-totals-table td.product-total {
    color: #102456;
    flex: 0 0 auto;
    font-weight: bold;
    text-align: right;
}
.nibble-subscription-totals-table .remove_item {
    flex: 0 0 auto;
}

/* ---- totals + delivery grid ---- */
.nibble-totals-row {
    display: block;
}
.nibble-totals-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    padding: 16px 0;
}
.nibble-totals-cell {
    display: flex;
    flex-direction: column;
}
.nibble-totals-label {
    color: #102456;
    font-size: 0.75em;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.nibble-totals-value {
    color: #102456;
    font-weight: bold;
    margin-top: 4px;
}

/* ---- help box ---- */
.nibble-subscription-help {
    align-items: flex-start;
    background: #f3f1ed;
    border-radius: 6px;
    display: flex;
    gap: 14px;
    margin-top: 24px;
    padding: 20px;
    margin-bottom: 24px;
}
.nibble-subscription-help-icon {
    flex: 0 0 auto;
    height: 26px;
    margin-top: 2px;
    width: 26px;
}
.nibble-subscription-help-text strong {
    color: #102456;
    display: block;
    margin-bottom: 6px;
}
.nibble-subscription-help-text p {
    color: #102456;
    margin: 0;
}
.nibble-subscription-help-text a {
    color: #102456;
    text-decoration: underline;
}

/* ---- pause date picker "Restart on" label (added via JS — see
   js/my-account-subscription.js — the picker markup itself is generated
   by the Self-Service Dashboard plugin over AJAX and left untouched) ---- */
.nibble-pause-restart-label {
    color: #102456;
    display: block;
    font-family: "bikobold";
    font-size: 0.85em;
    margin-bottom: 6px;
    text-transform: uppercase;
    width: 100%;
}

@media (max-width: 640px) {
    .nibble-cards-row {
        flex-direction: column;
    }
    .nibble-subscription-totals-table td.product-total {
        text-align: left;
    }
}


.woocommerce form .form-row-wide, .woocommerce-page form .form-row-wide.update_totals_on_change .woocommerce-input-wrapper .country_to_state{
    background: none;
    border: 0px;
    width: auto; 
    margin-top: 14px;
}
.woocommerce form .form-row-wide, .woocommerce-page form .form-row-wide.update_totals_on_change .woocommerce-input-wrapper .country_to_state .customSelectInner{
    width: auto !important;
}