:root {
    --taddart-burgundy: #8B0000;
    --taddart-charcoal: #333333;
    --taddart-gold: #D4AF37;
    --taddart-cream: #F5F5DC;
    --taddart-slate: #4B5D67;
}

/* THE JELLY MOTOR: Phase II Elite Card Styles */

/* 1. Base Shell */
.taddart-card-jelly {
    display: flex;
    flex-direction: column;
    height: 100%;
    grid-column: span 1;
    background-color: #ffffff;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.5s ease-in-out;
    border: 1px solid #f3f4f6;
}

.taddart-card-jelly:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(212, 175, 55, 0.1);
}

.taddart-elite-container {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    position: relative;
}

.taddart-elite-link {
    display: block;
    position: relative;
}

/* 2. Image Standardization — Ambient Glass-Box (1:1 Square) */
.taddart-elite-image-shell {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    width: 100%;
    background: linear-gradient(135deg, #1A1A1A 0%, #2C1A1A 100%);
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
    isolation: isolate;
    /* Create new stacking context to prevent bleed */
    clip-path: inset(0 round 1rem 1rem 0 0);
    /* Strict clipping of rounded corners */
}

/* Burgundy Anchor Bar (The Bleed Guard) */
.taddart-elite-image-shell::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--taddart-burgundy);
    z-index: 5;
    opacity: 0.8;
}

.taddart-elite-image-shell .splide,
.taddart-elite-image-shell .splide__track,
.taddart-elite-image-shell .splide__list,
.taddart-elite-image-shell .splide__slide {
    height: 100%;
}

.taddart-elite-image-cover {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    transition: transform 0.7s ease;
    position: relative;
    z-index: 1;
}

.taddart-card-jelly:hover .taddart-elite-image-cover {
    transform: scale(1.1);
}

/* 3. Liquid Glass Tag */
.taddart-liquid-glass {
    position: absolute;
    top: 1rem;
    right: 1rem;
    backdrop-filter: blur(12px);
    background-color: rgba(245, 245, 220, 0.6);
    /* Cream mask */
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
    padding: 0.375rem 1rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    z-index: 10;
    pointer-events: none;
}

.taddart-liquid-glass .price {
    color: #8B0000;
    font-weight: 800;
    font-size: 1.125rem;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.05));
}

/* 4. Minimalist Data Content */
.taddart-elite-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 1.25rem;
    background-color: #ffffff;
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
}

.taddart-elite-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.taddart-elite-title a {
    color: inherit;
    text-decoration: none;
}

.taddart-elite-meta-row {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #374151;
    border-top: 1px solid #f3f4f6;
    padding-top: 1rem;
}

.taddart-elite-meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.taddart-elite-meta-value {
    font-weight: 600;
    color: #111827;
}

.taddart-elite-meta-label {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.8;
}

.taddart-elite-separator {
    width: 1px;
    height: 1rem;
    background-color: #e5e7eb;
}

.taddart-elite-icon {
    width: 1rem;
    height: 1rem;
    color: #8B0000;
    flex-shrink: 0;
}

/* TADDART-ELITE: ICON CONSTRAIN */
.meta svg,
.es-listing__content svg {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0;
}

/* ==========================================================================
   PHASE III: LIQUID GLASS FORM STYLING
   ========================================================================== */

/* Core Wrapper */
.taddart-liquid-search {
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.2);
    /* Gold */
    border-radius: 9999px;
    /* Pill */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    margin-bottom: 2rem;
}

/* Desktop: Horizontal Pill, Mobile: Vertical Accordion handled dynamically by Form structure styling */
.taddart-liquid-search form {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
}

@media (max-width: 768px) {
    .taddart-liquid-search {
        border-radius: 1rem;
    }

    .taddart-liquid-search form {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Force Transparency on Internal Fields */
.taddart-liquid-search .es-field input,
.taddart-liquid-search .es-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--taddart-charcoal) !important;
    font-family: 'Almarai', sans-serif !important;
}

/* Restored Dropdown Affordance */
.taddart-liquid-search .es-field select {
    background-color: transparent !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B0000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 1rem center !important;
    background-size: 1.2em !important;
    appearance: none !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--taddart-charcoal) !important;
    font-family: 'Almarai', sans-serif !important;
    padding-right: 2.5rem !important;
}

/* RTL Adjustment */
[dir="rtl"] .taddart-liquid-search .es-field select {
    background-position: left 1rem center !important;
    padding-left: 2.5rem !important;
    padding-right: 1rem !important;
}

/* Update Button specific mockup colors */
.taddart-liquid-search .es-btn--primary {
    background: var(--taddart-burgundy) !important;
    color: #fff !important;
    border-radius: 9999px;
}

/* ==========================================================================
   PHASE III: MOBILE GRID HARDENING
   High-specificity override to enforce 2-col desktop / 1-col mobile.
   Beats Tailwind utility classes and Elementor container overrides.
   ========================================================================== */
body .js-es-listings,
body .es-listings {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 3rem !important;
    max-width: 1100px;
    margin-inline: auto;
    padding-inline: 1.5rem;
}

@media (max-width: 767px) {

    body .js-es-listings,
    body .es-listings {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================
   PHASE IV: HEART ENGINE CSS
   Wishlist button appearance + active (saved) state.
   ========================================================================== */
.taddart-elite-image-shell .taddart-heart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, background 0.2s ease;
    text-decoration: none;
}

.taddart-elite-image-shell .taddart-heart-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.65);
}

/* Active state: property is in wishlist */
.taddart-elite-image-shell .taddart-heart-btn.es-wishlist-link--active svg,
.taddart-elite-image-shell .taddart-heart-btn.es-wishlist-link--active svg path {
    fill: #8B0000;
    stroke: #8B0000;
}

/* Loading/preload shimmer */
.taddart-elite-image-shell .taddart-heart-btn.es-wishlist-link--preload {
    opacity: 0.5;
    pointer-events: none;
}

/* ==========================================================================
   PHASE V: OPPENHEIM TYPE BADGE
   Property type pill — Burgundy, uppercase, centered between metadata and price.
   ========================================================================== */
.taddart-type-badge {
    display: inline-block;
    background: var(--taddart-burgundy);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.2rem 0.85rem;
    border-radius: 9999px;
}

/* ==========================================================================
   PHASE VI: LIQUID GLASS ARROWS
   Styled Splide navigation to float inside the frame with blur effects.
   ========================================================================== */
.taddart-elite-image-shell .taddart-ghost-motor .splide__arrow {
    position: absolute !important;
    opacity: 1 !important;
    visibility: visible !important;
    background: var(--taddart-burgundy) !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 0 15px rgba(139, 0, 0, 0.4) !important;
    border-radius: 50% !important;
    width: 36px !important;
    height: 36px !important;
    z-index: 50 !important;
    /* Above ambient blur */
    top: 50% !important;
    transform: translateY(-50%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
}

.taddart-elite-image-shell .taddart-ghost-motor .splide__arrow:hover {
    background: #ffffff !important;
    border-color: var(--taddart-burgundy) !important;
    transform: translateY(-50%) scale(1.1) !important;
}

.taddart-elite-image-shell .taddart-ghost-motor .splide__arrow--prev {
    display: none !important;
}

.taddart-elite-image-shell .taddart-ghost-motor .splide__arrow--next {
    right: 15px !important;
}

/* TADDART-ELITE: ARROW ROTATION FIX */
.taddart-ghost-motor .splide__arrow svg {
    transform: none !important;
    /* Kill all inherited flips */
}

/* Visual RIGHT arrow (Next in LTR, Prev in RTL) must point LEFT for Arabic */
.taddart-ghost-motor .splide__arrow--next svg {
    transform: rotate(180deg) !important;
}

.taddart-elite-image-shell .taddart-ghost-motor .splide__pagination {
    bottom: 10px !important;
    z-index: 51 !important;
}

.taddart-elite-image-shell .taddart-ghost-motor .splide__pagination__page {
    background: rgba(255, 255, 255, 0.5) !important;
    border: 1px solid var(--taddart-burgundy) !important;
    width: 8px !important;
    height: 8px !important;
    margin: 3px !important;
}

.taddart-elite-image-shell .taddart-ghost-motor .splide__pagination__page.is-active {
    background: var(--taddart-burgundy) !important;
    transform: scale(1.2) !important;
}

/* TASK 20.1: Liquid Pill Trigger Button */
.taddart-pill-trigger {
    display: inline-block !important;
    border: 1px solid var(--taddart-gold) !important;
    border-radius: 9999px !important;
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    padding: 8px 20px !important;
    color: var(--taddart-charcoal) !important;
    font-family: 'Almarai', sans-serif !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
}

.taddart-pill-trigger:hover {
    background: rgba(212, 175, 55, 0.2) !important;
    color: var(--taddart-burgundy) !important;
    border-color: var(--taddart-burgundy) !important;
}

/* ==========================================================================
   PHASE VI: eBay SIDEBAR (THE DRAWER) & CSS NEUTRALIZATION
   Transforms Estatik native more-fields panel into a fixed right drawer.
   ========================================================================== */

/* Add absolute overlay styles as they were stripped previously */
.taddart-pro-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.5) !important;
    z-index: 99999998 !important;
    /* One step below drawer */
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.4s ease !important;
}

.taddart-pro-overlay.is-active {
    opacity: 1 !important;
    visibility: visible !important;
}

/* THE SIDEBAR DRAWER: High-Authority Stacking Context */
.taddart-elite-sidebar {
    position: fixed !important;
    top: 0 !important;
    right: -100% !important;
    /* Move offscreen */
    width: 400px !important;
    height: 100vh !important;
    background: #ffffff !important;
    z-index: 99999999 !important;
    /* Ultimate Authority */
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.5s cubic-bezier(0.77, 0, 0.175, 1) !important;
    overflow-y: auto !important;
}

.taddart-elite-sidebar--visible.is-active {
    right: 0 !important;
}

/* ==========================================================================
   TASK 45.3: STACKING CONTEXT SOVEREIGNTY
   Enforce isolation and extreme z-index to escape "Jelly Card" transform traps.
   ========================================================================== */
.taddart-pro-sidebar,
.taddart-pro-overlay,
.select2-container--open {
    isolation: isolate !important;
    z-index: 99999999 !important;
    position: fixed !important;
}

/* ==========================================================================
   TASK 48.4: THE AUTHORITATIVE PILL & ENGINE STYLING
   Logic: 5-Segment Glass Pill with High-Authority Stacking.
   ========================================================================== */

.taddart-pill-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(212, 175, 55, 0.3);
    /* Faint Gold Border */
    border-radius: 50px;
    padding: 6px 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    direction: rtl;
    /* Forced RTL for Mockup Accuracy */
    max-width: fit-content;
    margin: 10px 0;
}

.taddart-pill-segment {
    position: relative;
    padding: 0 10px;
    flex-shrink: 0;
}

.taddart-pill-segment:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 0;
    /* Left side in RTL creates right-to-left divider */
    top: 25%;
    height: 50%;
    width: 1px;
    background: rgba(0, 0, 0, 0.08);
    /* Faint Vertical Divider */
}

/* Elite Pill Select Styling */
.taddart-pill-select {
    border: none !important;
    background: transparent !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #263238 !important;
    padding: 8px 30px 8px 10px !important;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23d4af37' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    outline: none !important;
}

.taddart-pill-trigger-wrapper {
    padding-right: 10px;
}

.taddart-pro-trigger {
    background: var(--taddart-burgundy) !important;
    color: #fff !important;
    border: none !important;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(128, 0, 32, 0.2);
}

.taddart-pro-trigger:hover {
    transform: scale(1.05);
    background: #960026 !important;
}

/* Drawer Refinements: Iconic Selectors & Dual Inputs */
.taddart-dual-input {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.taddart-elite-input,
.taddart-elite-select {
    width: 100%;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.taddart-elite-input:focus {
    border-color: var(--taddart-gold);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1);
    outline: none;
}

.taddart-icon-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.taddart-icon-btn {
    flex: 1;
    min-width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.taddart-icon-btn svg {
    margin-bottom: 6px;
    color: #6c757d;
}

.taddart-icon-btn.is-active {
    border-color: var(--taddart-burgundy);
    background: rgba(128, 0, 32, 0.05);
}

.taddart-icon-btn.is-active svg {
    color: var(--taddart-burgundy);
}

.taddart-icon-btn.is-active span {
    color: var(--taddart-burgundy);
    font-weight: 600;
}

/* MOBILE TRANSFORMATION */
@media (max-width: 768px) {
    .taddart-pill-container {
        display: none !important;
    }

    /* Side menu from the LEFT (Master Directive) */
    .taddart-elite-sidebar {
        right: auto !important;
        left: -100% !important;
        width: 100% !important;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1) !important;
    }

    .taddart-elite-sidebar--visible.is-active {
        left: 0 !important;
        right: auto !important;
    }

    /* Mobile Filter Button */
    .taddart-mobile-filter-btn {
        width: 100%;
        padding: 14px;
        background: var(--taddart-burgundy) !important;
        color: #fff !important;
        border: none !important;
        border-radius: 12px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        margin: 10px 0;
        box-shadow: 0 4px 15px rgba(128, 0, 32, 0.2);
    }
}

/* GOLD CHEVRON REFINEMENT (Task 35.4) */
.taddart-navbar-sort .taddart-pill-select {
    padding-right: 35px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23d4af37' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'%3E%3C/path%3E%3C/svg%3E") !important;
    background-position: right 12px center !important;
    border-radius: 10px !important;
    background-color: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(212, 175, 55, 0.2) !important;
    transition: all 0.3s ease;
}

.taddart-navbar-sort .taddart-pill-select:focus {
    border-color: var(--taddart-gold) !important;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1) !important;
}

@media (max-width: 480px) {
    .taddart-elite-sidebar {
        width: 100% !important;
    }
}