/*
 * Favourites module styles.
 *
 * - .woh-fav-btn          — the heart button (used on cards, single pages, account)
 * - .woh-fav-wrap         — Elementor widget wrapper, supports overlay positioning
 * - .woh-fav-modal        — login/register modal rendered in wp_footer
 * - .woh-fav-account      — My Account tab grid
 *
 * Colour defaults can be overridden via Elementor controls or theme CSS.
 */

/* =====================================================================
   Button
   ===================================================================== */
.woh-fav-btn {
    appearance: none;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    color: #6e6e6e;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    line-height: 1;
    font: inherit;
    transition: color .15s ease, background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.woh-fav-btn:hover  { color: #c33; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08); }
.woh-fav-btn:focus-visible { outline: 2px solid #c33; outline-offset: 2px; }
.woh-fav-btn.is-favourited { color: #c33; }
.woh-fav-btn.is-loading { opacity: .6; pointer-events: none; }

.woh-fav-btn--small  { padding: 4px 8px;  }
.woh-fav-btn--medium { padding: 6px 12px; }
.woh-fav-btn--large  { padding: 8px 16px; font-size: .95rem; }

.woh-fav-btn__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.woh-fav-btn__icon svg {
    width: 22px;
    height: 22px;
    transition: transform .15s ease;
}
.woh-fav-btn--small  .woh-fav-btn__icon svg { width: 18px; height: 18px; }
.woh-fav-btn--large  .woh-fav-btn__icon svg { width: 26px; height: 26px; }
.woh-fav-btn:active .woh-fav-btn__icon svg { transform: scale(0.9); }

.woh-fav-btn .woh-fav-btn__icon-filled  { display: none; }
.woh-fav-btn.is-favourited .woh-fav-btn__icon-outline { display: none; }
.woh-fav-btn.is-favourited .woh-fav-btn__icon-filled  { display: block; }

.woh-fav-btn__label {
    font-size: .85rem;
    font-weight: 500;
    letter-spacing: .01em;
}

/* Wrap used by the Elementor widget */
.woh-fav-wrap--overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
}
.woh-fav-wrap--inline {
    display: inline-flex;
}

/* =====================================================================
   Elementor CSS-class trigger
   Any Elementor element with .woh-fav-toggle becomes a heart toggle.
   Style the active state by targeting .woh-fav-toggle.is-favourited
   in your theme. Defaults below give a sensible idle/saved feel.
   ===================================================================== */
.woh-fav-toggle {
    cursor: pointer;
    transition: transform .15s ease, color .15s ease;
}
.woh-fav-toggle:hover { transform: scale(1.06); }
.woh-fav-toggle:focus-visible { outline: 2px solid #c33; outline-offset: 3px; }

/* Default icon-widget colour swap when saved.
   !important is used deliberately: Elementor renders per-element rules
   like `.elementor-element-XXX .elementor-icon { color: ... }` whose
   specificity ties ours (0,2,0) and wins by cascade order. The state
   colour has to override the user's design here. */
.woh-fav-toggle.is-favourited .elementor-icon,
.woh-fav-toggle.is-favourited .elementor-icon-wrapper i,
.woh-fav-toggle.is-favourited .elementor-icon-wrapper svg,
.woh-fav-toggle.is-favourited svg {
    color: #c33 !important;
    fill: #c33 !important;
    border-color: #c33 !important;
}
/* SVG icons with inline fill attributes also need to be overridden. */
.woh-fav-toggle.is-favourited svg [fill]:not([fill="none"]),
.woh-fav-toggle.is-favourited svg path:not([fill="none"]) {
    fill: #c33 !important;
}

/* Click pulse — quick scale-up + back. */
.woh-fav-pulse {
    animation: woh-fav-pulse .35s ease-out;
}
@keyframes woh-fav-pulse {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.18); }
    100% { transform: scale(1); }
}

/* Tiny burst — six dots fly outwards from the icon centre. */
.woh-fav-burst {
    position: fixed;
    z-index: 100001;
    pointer-events: none;
    width: 0;
    height: 0;
}
.woh-fav-burst span {
    position: absolute;
    left: -3px;
    top: -3px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #c33;
    opacity: 1;
    transform: rotate(var(--angle)) translateY(0);
    animation: woh-fav-burst .6s ease-out forwards;
}
@keyframes woh-fav-burst {
    0%   { transform: rotate(var(--angle)) translateY(0)    scale(1);   opacity: 1; }
    100% { transform: rotate(var(--angle)) translateY(-26px) scale(0.4); opacity: 0; }
}

/* Toast — bottom-right slide-in. */
.woh-fav-toast {
    position: fixed;
    z-index: 100002;
    right: 20px;
    bottom: 20px;
    background: #1f2937;
    color: #fff;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: .95rem;
    line-height: 1.3;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
    max-width: calc(100vw - 40px);
}
.woh-fav-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.woh-fav-toast[data-variant="added"]   { background: #16a34a; }
.woh-fav-toast[data-variant="removed"] { background: #4b5563; }
.woh-fav-toast[data-variant="error"]   { background: #b91c1c; }

/* =====================================================================
   Modal
   Selectors are deliberately scoped under .woh-fav-modal to outrank
   theme/Elementor button rules (e.g. body button, .elementor-button).
   text-decoration / text-transform / box-shadow are reset explicitly
   because Hello Elementor child and similar themes touch them on
   button hover/focus/active states.
   ===================================================================== */
.woh-fav-modal[hidden] { display: none; }
.woh-fav-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.woh-fav-modal .woh-fav-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}
.woh-fav-modal .woh-fav-modal__content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 440px;
    padding: 32px 28px 28px;
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
}

/* Shared reset applied to every <button> inside the modal so theme rules
   for `button`, `.elementor-button`, `body button` etc. can't bleed in. */
.woh-fav-modal button {
    appearance: none;
    -webkit-appearance: none;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    color: inherit;
    cursor: pointer;
    font: inherit;
    letter-spacing: normal;
    line-height: 1.2;
    margin: 0;
    padding: 0;
    text-decoration: none;
    text-shadow: none;
    text-transform: none;
}
.woh-fav-modal button:hover,
.woh-fav-modal button:focus,
.woh-fav-modal button:active {
    text-decoration: none;
    box-shadow: none;
}

.woh-fav-modal .woh-fav-modal__close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    color: #777;
    font-size: 26px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.woh-fav-modal .woh-fav-modal__close:hover {
    background: #f3f4f6;
    color: #111;
}

.woh-fav-modal .woh-fav-modal__title {
    margin: 0 0 6px;
    font-size: 1.35rem;
    color: #111;
    text-decoration: none;
}
.woh-fav-modal .woh-fav-modal__lede {
    margin: 0 0 20px;
    color: #555;
    font-size: .95rem;
    line-height: 1.45;
}

.woh-fav-modal .woh-fav-modal__tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid #e5e5e5;
    margin: 0 0 18px;
}
.woh-fav-modal .woh-fav-modal__tab {
    background: transparent;
    border-bottom: 2px solid transparent;
    padding: 10px 14px;
    font-weight: 500;
    color: #6b7280;
    transform: translateY(1px);
    text-decoration: none;
}
.woh-fav-modal .woh-fav-modal__tab:hover { color: #111; }
.woh-fav-modal .woh-fav-modal__tab.is-active {
    color: #111;
    border-bottom-color: #c33;
}
.woh-fav-modal .woh-fav-modal__tab[aria-selected="true"] {
    color: #111;
    border-bottom-color: #c33;
}

.woh-fav-modal .woh-fav-modal__notice {
    background: #fdecea;
    color: #8a1f1f;
    border-radius: 6px;
    padding: 10px 12px;
    margin: 0 0 14px;
    font-size: .9rem;
}
.woh-fav-modal .woh-fav-modal__notice.is-success {
    background: #e8f5e9;
    color: #1b5e20;
}

.woh-fav-modal .woh-fav-modal__panel { display: grid; gap: 12px; }
.woh-fav-modal .woh-fav-modal__panel[hidden] { display: none; }

.woh-fav-modal .woh-fav-modal__field {
    display: grid;
    gap: 4px;
    font-size: .9rem;
    color: #444;
}
.woh-fav-modal .woh-fav-modal__field input {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    padding: 10px 12px;
    font: inherit;
    background: #fff;
    color: #111;
    box-shadow: none;
}
.woh-fav-modal .woh-fav-modal__field input:focus {
    border-color: #c33;
    outline: none;
    box-shadow: 0 0 0 3px rgba(204, 51, 51, 0.15);
}

.woh-fav-modal .woh-fav-modal__small {
    margin: 0;
    font-size: .8rem;
    color: #666;
    line-height: 1.45;
}
.woh-fav-modal .woh-fav-modal__small a {
    color: inherit;
    text-decoration: underline;
}

.woh-fav-modal .woh-fav-modal__submit {
    background-color: #1f2937;
    color: #ffffff;
    border-radius: 6px;
    padding: 12px 16px;
    font-weight: 600;
    letter-spacing: .01em;
    text-decoration: none;
    transition: background-color .15s ease;
    width: 100%;
}
.woh-fav-modal .woh-fav-modal__submit:hover {
    background-color: #111827;
    color: #ffffff;
}
.woh-fav-modal .woh-fav-modal__submit:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* =====================================================================
   Account tab
   ===================================================================== */
.woh-fav-account__empty {
    text-align: center;
    padding: 40px 20px;
    color: #555;
}
.woh-fav-account__empty h3 { margin: 0 0 8px; }
.woh-fav-account__empty-links { margin-top: 16px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.woh-fav-account__grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

.woh-fav-account__item {
    border: 1px solid #ececec;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: opacity .2s ease, transform .2s ease;
}
.woh-fav-account__item.is-removing { opacity: 0; transform: translateY(-4px); }

.woh-fav-account__media {
    display: block;
    aspect-ratio: 4/3;
    background: #f4f4f4;
    overflow: hidden;
}
.woh-fav-account__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.woh-fav-account__media-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f1f1f1, #e4e4e4);
}

.woh-fav-account__body { padding: 14px 14px 16px; display: grid; gap: 6px; }
.woh-fav-account__badge {
    align-self: start;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #4b5563;
}
/* Title: explicit 16px / 700, theme body colour. Specificity bumped + color
   forced via inherit !important so theme heading-link rules (h4 a) can't
   bleed in and make it the brand link colour. */
.woh-fav-account .woh-fav-account__title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    color: inherit;
}
.woh-fav-account .woh-fav-account__title a,
.woh-fav-account .woh-fav-account__title a:hover,
.woh-fav-account .woh-fav-account__title a:focus {
    color: inherit !important;
    text-decoration: none;
    font-weight: inherit;
}
.woh-fav-account .woh-fav-account__title a:hover {
    text-decoration: underline;
}

.woh-fav-account__price { margin: 0; color: #222; font-weight: 600; font-size: .95rem; }

.woh-fav-account__actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}
.woh-fav-account__view {
    font-size: .85rem;
    font-weight: 500;
    text-decoration: none;
    color: #1f2937;
}
.woh-fav-account__view:hover { text-decoration: underline; }
.woh-fav-account__remove {
    appearance: none;
    background: none;
    border: 0;
    color: #888;
    cursor: pointer;
    font-size: .85rem;
    padding: 4px 6px;
}
.woh-fav-account__remove:hover { color: #c33; }
