/* =========================================================
   ROOM33 FAVOURITES
   ========================================================= */

/* Wrapper — positioned top-right of the identity block on profiles */
.r33-identity {
    position: relative;
}

.r33-fav-hero-wrap {
    position: absolute;
    top: 30px;
    right: 20%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    /* prompt positions relative to this */
    isolation: isolate;
}

.r33-fav-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* Main favourite button — use tag+class for specificity over theme */
button.r33-fav-btn {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid #e7dcc0 !important;
    background: #fffdf8 !important;
    color: #7a6a3f !important;
    border-radius: 999px !important;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

button.r33-fav-btn:hover {
    background: #fffaf0 !important;
    border-color: #d7c389 !important;
    color: #b09040 !important;
    box-shadow: 0 3px 10px rgba(201,168,76,0.10);
    transform: translateY(-1px);
    text-decoration: none;
}

button.r33-fav-btn:focus,
button.r33-fav-btn:focus-visible {
    outline: none;
    border-color: #c9a84c !important;
    box-shadow: 0 0 0 3px rgba(201,168,76,0.18);
}

button.r33-fav-btn.is-active {
    background: #fff5f5 !important;
    border-color: #efc4c8 !important;
    color: #b4232f !important;
    box-shadow: 0 3px 10px rgba(180,35,47,0.08);
}

button.r33-fav-btn.is-active:hover {
    background: #ffefef !important;
    border-color: #e3a9af !important;
    color: #9f1f2a !important;
}

button.r33-fav-btn.r33-fav-loading,
button.r33-fav-btn:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
    color: #7a6a3f !important;
}

/* Heart icon — SVG via CSS mask, no text content needed */
.r33-fav-icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    position: relative;
    flex-shrink: 0;
}

.r33-fav-icon::before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 21s-6.716-4.35-9.192-8.192C.631 9.455 2.34 5 6.5 5c2.224 0 3.526 1.207 4.294 2.259C11.562 6.207 12.864 5 15.088 5 19.248 5 20.957 9.455 18.78 12.808 16.304 16.65 12 21 12 21z'/></svg>") center / contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 21s-6.716-4.35-9.192-8.192C.631 9.455 2.34 5 6.5 5c2.224 0 3.526 1.207 4.294 2.259C11.562 6.207 12.864 5 15.088 5 19.248 5 20.957 9.455 18.78 12.808 16.304 16.65 12 21 12 21z'/></svg>") center / contain no-repeat;
}

.r33-fav-btn.is-active .r33-fav-icon::before {
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M12 21s-6.716-4.35-9.192-8.192C.631 9.455 2.34 5 6.5 5c2.224 0 3.526 1.207 4.294 2.259C11.562 6.207 12.864 5 15.088 5 19.248 5 20.957 9.455 18.78 12.808 16.304 16.65 12 21 12 21z'/></svg>") center / contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M12 21s-6.716-4.35-9.192-8.192C.631 9.455 2.34 5 6.5 5c2.224 0 3.526 1.207 4.294 2.259C11.562 6.207 12.864 5 15.088 5 19.248 5 20.957 9.455 18.78 12.808 16.304 16.65 12 21 12 21z'/></svg>") center / contain no-repeat;
}

/* Label */
.r33-fav-label {
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

/* Count beside button */
.r33-fav-count {
    font-size: 13px;
    color: #8a8a8a;
    line-height: 1;
}

/* Compact version for card overlays */
.r33-fav-btn.is-compact {
    width: 42px;
    min-width: 42px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(4px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.r33-fav-btn.is-compact .r33-fav-label,
.r33-fav-btn.is-compact .r33-fav-count {
    display: none;
}

/* Overlay positioning for cards/images */
.r33-fav-overlay {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 8;
}

/* Saved count text block */
.r33-favourite-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #999;
    padding: 0;
    white-space: nowrap;
}

.r33-favourite-count strong {
    color: #777;
    font-weight: 600;
}

/* Login prompt tooltip */
.r33-fav-login-prompt {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid #e7dcc0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
    padding: 14px 16px;
    white-space: nowrap;
    z-index: 100;
    text-align: center;
}

.r33-fav-login-prompt::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: #fff;
    border-left: 1px solid #e7dcc0;
    border-top: 1px solid #e7dcc0;
    rotate: 45deg;
}

.r33-fav-login-prompt p {
    margin: 0 0 10px;
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

.r33-fav-login-prompt-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.r33-fav-login-btn,
.r33-fav-register-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.r33-fav-login-btn {
    background: linear-gradient(135deg, #d4af37, #c19b2e);
    color: #1b1b1b !important;
}

.r33-fav-register-btn {
    background: #f5f0e8;
    border: 1px solid #e7dcc0;
    color: #7a6a3f !important;
}

.r33-fav-login-btn:hover,
.r33-fav-register-btn:hover {
    opacity: 0.85;
    text-decoration: none;
}

/* Inline messages */
.r33-fav-message {
    margin-top: 8px;
    font-size: 13px;
    color: #777;
}

.r33-fav-message.is-error {
    color: #b4232f;
}

.r33-fav-message.is-success {
    color: #2f7a45;
}

/* =========================================================
   FAVOURITES LIST
   ========================================================= */

.r33-favourites-page {
    max-width: 1280px;
    margin: 30px auto 60px;
    padding: 0 20px;
}

.r33-favourites-header {
    margin-bottom: 24px;
}

.r33-favourites-title {
    margin: 0 0 6px;
    font-size: 30px;
    line-height: 1.15;
    font-weight: 700;
    color: #1a1a1a;
}

.r33-favourites-subtitle {
    margin: 0;
    font-size: 14px;
    color: #777;
}

/* Empty state */
.r33-favourites-empty {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 32px 28px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0,0,0,0.04);
}

.r33-favourites-empty-title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    color: #1f1f1f;
}

.r33-favourites-empty-text {
    margin: 0;
    font-size: 14px;
    color: #767676;
}

/* Grid */
.r33-favourites-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}

/* Card */
.r33-fav-card {
    position: relative;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.r33-fav-card.r33-fav-removing {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.r33-fav-card:hover {
    transform: translateY(-3px);
    border-color: #e5d3a4;
    box-shadow: 0 14px 34px rgba(0,0,0,0.08);
}

.r33-fav-card-media {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: #111;
}

.r33-fav-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.r33-fav-card-body {
    padding: 14px 14px 16px;
}

.r33-fav-card-title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
    color: #1e1e1e;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.r33-fav-card-meta {
    margin: 0 0 10px;
    font-size: 13px;
    color: #7a7a7a;
}

.r33-fav-card-price {
    margin: 0 0 14px;
    font-size: 14px;
    color: #3b3b3b;
    font-weight: 600;
}

.r33-fav-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.r33-fav-card-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 10px;
    background: linear-gradient(135deg, #d4af37, #c19b2e);
    color: #1b1b1b;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(193,155,46,0.2);
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.r33-fav-card-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(193,155,46,0.28);
    color: #1b1b1b;
    text-decoration: none;
}

/* Remove button (overlay on card image) */
.r33-fav-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(4px);
    color: #b4232f;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, color 0.18s ease;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    z-index: 2;
}

.r33-fav-remove:hover {
    background: #b4232f;
    color: #fff;
}

.r33-fav-remove.r33-fav-loading {
    opacity: 0.5;
    pointer-events: none;
}

@media (max-width: 1180px) {
    .r33-favourites-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .r33-favourites-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .r33-favourites-page {
        padding: 0 14px;
    }

    .r33-favourites-title {
        font-size: 24px;
    }

    .r33-favourites-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}
