/*
 * WordPress-side corrections for the converted theme.
 * Linked last from templates/parts/styles.php.
 */

/* ------------------------------------------------------------------
 * Account area text on the dark shell.
 *
 * The Laravel design sat the orders table and the profile columns on light
 * cards -- .orders-table-wrapper.bg-white, thead #f5f5f5, .content-section-profile
 * #fefefe -- and baseStyles unsets all three so they render straight on the dark
 * body. Nothing declares a text colour for that area, so the table head, the
 * rows, the "No orders found." row and the Profile/Subscription headings fell
 * back to the browser default black and vanished against the page. The two
 * account links had no colour rule at all and came out as the browser's default
 * blue/purple.
 * ------------------------------------------------------------------ */
.orders-table-wrapper,
.content-section-profile,
.invoice-detail {
    color: var(--color-white, #fff);
}

.orders-table-wrapper table th,
.orders-table-wrapper table td,
.content-section-profile h1,
.content-section-profile h2,
.content-section-profile h3,
.content-section-profile h4,
.content-section-profile label,
.invoice-detail th,
.invoice-detail td {
    color: var(--color-white, #fff);
}

/* The head row lost its grey fill with the card behind it; a faint tint keeps
   it reading as a head rather than as one more body row. */
.orders-table-wrapper table thead {
    background-color: rgba(255, 255, 255, .06);
}

/* "My Orders" on the profile page and "View Invoice" in each row. */
.btn__simple.my-orders,
.orders-table td a.btn,
.invoice-detail td a.btn {
    color: var(--color-white, #fff);
}

.btn__simple.my-orders:hover,
.orders-table td a.btn:hover,
.invoice-detail td a.btn:hover {
    opacity: .75;
}

/* ==================================================================
 * Cookie modal.
 *
 * The converted modal kept three things the WordPress build cannot use as-is:
 * a hard-coded button colour that belongs to no palette on this site, a 2s
 * book-page-turn animation, and a centred dialog with nothing behind it. The
 * close X was also styled and then switched off with display:none, and its
 * stroke was painted white against a light panel. On top of that the panel
 * itself was light while every page around it is dark.
 *
 * Repainted here in the theme's own tokens: a dark panel that belongs to the
 * page, the brand accent on the primary action, a ghost secondary, a real
 * backdrop (inserted by the cookie script), a short fade, and a close X that
 * is visible and follows the text colour.
 * ================================================================== */
.cookie-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999999999;
    background: rgba(6, 7, 9, .68);
    opacity: 0;
    visibility: hidden;
    transition: opacity .24s ease, visibility .24s ease;
}

.cookie-backdrop.show-cookie {
    opacity: 1;
    visibility: visible;
}

#cookie-modal {
    --cookie-surface: #17191D;
    --cookie-border: rgba(255, 255, 255, .14);
    --cookie-text: var(--color-white, #fff);
    --cookie-muted: rgba(255, 255, 255, .70);
    --cookie-accent: var(--color-secondary);
    --cookie-accent-fg: #fff;

    box-sizing: border-box;
    max-width: 560px;
    width: calc(100% - 32px);
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 30px;
    border-radius: 14px;
    border: 1px solid var(--cookie-border);
    background: var(--cookie-surface);
    color: var(--cookie-text);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
    position: fixed;
    top: 50%;
    left: 50%;
    /* Every bundle ships .show-cookie{bottom:-360px} / .hide-cookie{bottom:-1px}
       from the original slide-up banner. Those are bare class rules, so they
       still apply to the centred dialog: top and bottom both resolved and the
       box stretched to ~890px with the content stranded at the top. The id
       outranks the class, so clearing the offsets here settles it. */
    right: auto;
    bottom: auto;
    /* The bundles disagree wildly here -- 99 in one, 10000000000 in another --
       and anything below the backdrop puts the scrim on top of the dialog. */
    z-index: 10000000001;
    transform: translate(-50%, -46%);
    opacity: 0;
    visibility: hidden;
    /* Kills the inherited 2s page-turn / flip keyframes in every bundle. */
    animation: none !important;
    filter: none !important;
    transition: opacity .24s ease, transform .24s ease, visibility .24s ease;
}

#cookie-modal.show-cookie {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%);
}

#cookie-modal.hide-cookie {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -46%);
}

/* The "fold" gradient belonged to the page-turn animation. */
#cookie-modal::before {
    display: none !important;
}

#cookie-modal .modal-close {
    display: flex !important;
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--cookie-muted);
    cursor: pointer;
    transition: color .2s ease, background-color .2s ease;
}

#cookie-modal .modal-close:hover {
    color: var(--cookie-text);
    background: rgba(255, 255, 255, .08);
}

#cookie-modal .modal-close svg path {
    stroke: currentColor !important;
}

#cookie-modal .content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
}

#cookie-modal .icon-text-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding-right: 28px;
}

#cookie-modal .content .icon {
    display: flex;
    width: 40px;
    max-width: 40px;
    height: 40px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
}

#cookie-modal .content .icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#cookie-modal .content .icon img:hover {
    transform: none;
}

#cookie-modal .content .cookie-title {
    margin: 0;
    color: var(--cookie-text);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
}

#cookie-modal .content .cookie-desc {
    width: 100%;
    color: var(--cookie-muted);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
}

#cookie-modal .content .cookie-desc a {
    color: var(--cookie-text);
    font-weight: 600;
    text-decoration: underline;
}

/* The templates all emit <div class="terms-text-wrapper"></div> with nothing in
   it -- only some bundles bothered to hide it, and where they did not it opened
   a second flex gap between the text and the buttons. */
#cookie-modal .terms-text-wrapper:empty {
    display: none;
}

#cookie-modal .action-wrapper {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 4px;
}

#cookie-modal .action-wrapper .cookie-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: auto;
    padding: 11px 22px !important;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, opacity .2s ease;
}

#cookie-modal .action-wrapper .cookie-btn:hover,
#cookie-modal .action-wrapper .cookie-btn:active {
    transform: none;
}

#cookie-modal .action-wrapper .cookie-btn img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
}

#cookie-modal #decline-cookie {
    background: none !important;
    background-color: transparent !important;
    border-color: var(--cookie-border);
    color: var(--cookie-text);
}

#cookie-modal #decline-cookie:hover {
    border-color: var(--cookie-text);
    background-color: rgba(255, 255, 255, .08) !important;
}

/* Two ids are in use across these themes; the second was never given a rule,
   so the primary action rendered as an unstyled browser button. */
#cookie-modal #cookie-button,
#cookie-modal #accept-cookie-button {
    background: var(--cookie-accent) !important;
    color: var(--cookie-accent-fg) !important;
    border: 0;
}

#cookie-modal #cookie-button:hover,
#cookie-modal #accept-cookie-button:hover {
    opacity: .88;
}

#cookie-modal #cookie-button:hover img,
#cookie-modal #accept-cookie-button:hover img {
    transform: none;
}

@media screen and (max-width: 540px) {
    #cookie-modal {
        width: calc(100% - 24px);
        padding: 22px;
    }

    #cookie-modal .action-wrapper {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    #cookie-modal .action-wrapper .cookie-btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    #cookie-modal,
    .cookie-backdrop {
        transition: none;
    }
}

/* ------------------------------------------------------------------
 * .text-brand headings.
 *
 * The bundles' only rule for this class is scoped to the contact page's email
 * section, where it resolves to var(--color-white). Every other heading that
 * carries it -- Profile, Subscription, the policy pages -- matched no rule at
 * all and fell back to the browser default black, which is invisible on the
 * dark shell. The same gap applies to the headings inside .main-container: the
 * bundle sets their size and weight and never their colour.
 * ------------------------------------------------------------------ */
.text-brand {
    color: var(--color-white, #fff);
}

.main-container h1,
.main-container h2,
.main-container h3,
.main-container h4,
.main-container h5,
.main-container h6 {
    color: var(--color-white, #fff);
}
