/* ============================
   VARIABLES
============================ */
#dapro-id-tabs {
    --accent: #ff90bb;
    --accent-light: #ffd4e6;
    --accent-dark: #ec649a;
    --text: #333;
    --text-light: #666;
    --text-black: #000;
    --border: #eee;
    --bg: #fff;
    --bg-light: #fafafa;
    --spacing-xs: 6px;
    --spacing-sm: 8px;
    --spacing-md: 15px;
    --spacing-lg: 20px;
    --spacing-xl: 25px;
    --spacing-xxl: 30px;
    --spacing-xxxl: 40px;
    --font-size-sm: 13px;
    --font-size-md: 14px;
    --font-size-base: 15px;
    --line-height: 1.7;
    --radius-sm: 10px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: 0.25s ease;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    contain: layout style paint;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* ============================
   TAB CONTAINER
============================ */
#dapro-id-tabs .woocommerce-tabs {
    border: 0 !important;
    padding: 0;
    margin: var(--spacing-xxxl) 0 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

#dapro-id-tabs .woocommerce-tabs ul.tabs {
    display: flex;
    gap: var(--spacing-sm);
    border: 0 !important;
    margin: 0 0 var(--spacing-xxl);
    padding: 0;
    background: 0 0 !important;
    list-style: none;
    flex-wrap: wrap;
    contain: layout style;
}

#dapro-id-tabs .woocommerce-tabs ul.tabs::before,
#dapro-id-tabs .woocommerce-tabs ul.tabs::after {
    display: none !important;
}

/* ============================
   TAB LINKS
============================ */
#dapro-id-tabs .woocommerce-tabs ul.tabs li {
    flex: 1;
    min-width: 0;
    border: 0 !important;
    background: 0 0;
    padding: 0;
    margin: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

#dapro-id-tabs .woocommerce-tabs ul.tabs li a {
    display: block;
    padding: 10px var(--spacing-md);
    font-size: var(--font-size-md);
    font-weight: 500;
    color: var(--text-black) !important;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    transition: border-color var(--transition), background-color var(--transition);
    will-change: border-color, background-color;
}

#dapro-id-tabs .woocommerce-tabs ul.tabs li a:hover {
    border-color: var(--accent-light);
    background-color: var(--accent-light);
}

#dapro-id-tabs .woocommerce-tabs ul.tabs li a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

#dapro-id-tabs .woocommerce-tabs ul.tabs li.active a {
    background-color: var(--accent-light);
    border-color: var(--accent);
    will-change: auto;
}

/* ============================
   TAB CONTENT
============================ */
#dapro-id-tabs .woocommerce-tabs .panel {
    padding: var(--spacing-xl);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    overflow-x: hidden;
    animation: fadeIn 0.3s ease;
    contain: layout style;
}

#dapro-id-tabs .woocommerce-tabs .panel > * {
    max-width: 100%;
    box-sizing: border-box;
}

/* Hide duplicate titles inside tab content (tabs already have titles) */
#dapro-id-tabs .woocommerce-tabs .panel > h1:first-child,
#dapro-id-tabs .woocommerce-tabs .panel > h2:first-child,
#dapro-id-tabs .woocommerce-tabs .panel > h3:first-child,
#dapro-id-tabs .woocommerce-tabs .panel > h4:first-child,
#dapro-id-tabs .woocommerce-tabs .panel > h5:first-child,
#dapro-id-tabs .woocommerce-tabs .panel > h6:first-child {
    display: none !important;
}

/* Also hide titles that might be wrapped in a div or other element */
#dapro-id-tabs .woocommerce-tabs .panel > div:first-child > h1:first-child,
#dapro-id-tabs .woocommerce-tabs .panel > div:first-child > h2:first-child,
#dapro-id-tabs .woocommerce-tabs .panel > div:first-child > h3:first-child,
#dapro-id-tabs .woocommerce-tabs .panel > div:first-child > h4:first-child,
#dapro-id-tabs .woocommerce-tabs .panel > div:first-child > h5:first-child,
#dapro-id-tabs .woocommerce-tabs .panel > div:first-child > h6:first-child {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    #dapro-id-tabs .woocommerce-tabs .panel {
        animation: none;
    }
}

/* ============================
   TYPOGRAPHY
============================ */
#dapro-id-tabs .woocommerce-tabs .panel,
#dapro-id-tabs .woocommerce-tabs .panel p,
#dapro-id-tabs .woocommerce-tabs .panel li,
#dapro-id-tabs .woocommerce-tabs .panel td,
#dapro-id-tabs .woocommerce-tabs .panel th {
    font-size: var(--font-size-base);
    line-height: var(--line-height);
    color: var(--text);
    max-width: 100%;
    box-sizing: border-box;
}

#dapro-id-tabs .woocommerce-tabs .panel h1,
#dapro-id-tabs .woocommerce-tabs .panel h2,
#dapro-id-tabs .woocommerce-tabs .panel h3,
#dapro-id-tabs .woocommerce-tabs .panel h4 {
    margin-bottom: var(--spacing-md);
    font-weight: 600;
    color: var(--accent-dark);
}

#dapro-id-tabs .woocommerce-tabs .panel img,
#dapro-id-tabs .woocommerce-tabs .panel iframe,
#dapro-id-tabs .woocommerce-tabs .panel video {
    max-width: 100%;
    height: auto;
}

/* ============================
   TABLES - RTL & Minimal Style
============================ */
#dapro-id-tabs .woocommerce-tabs table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    margin-bottom: var(--spacing-lg);
    border: none !important;
    border-radius: 0 !important;
    overflow: visible;
    box-shadow: none !important;
    background: transparent !important;
    contain: layout style;
    direction: rtl !important;
    text-align: right !important;
}

#dapro-id-tabs .woocommerce-tabs table th,
#dapro-id-tabs .woocommerce-tabs table td {
    padding: 12px 0;
    border: none !important;
    border-bottom: 1px solid var(--border) !important;
    text-align: right !important;
    background: transparent !important;
    direction: rtl !important;
    vertical-align: top;
}

/* First column (labels/headers) - right side in RTL */
#dapro-id-tabs .woocommerce-tabs table th:first-child,
#dapro-id-tabs .woocommerce-tabs table td:first-child {
    padding-right: 0;
    padding-left: var(--spacing-lg);
    text-align: right !important;
    font-weight: 500 !important;
    color: var(--text) !important;
    white-space: nowrap;
    min-width: 80px;
}

/* Second column (values) - left side in RTL */
#dapro-id-tabs .woocommerce-tabs table th:last-child,
#dapro-id-tabs .woocommerce-tabs table td:last-child {
    padding-left: 0;
    padding-right: 0;
    text-align: right !important;
    color: var(--text) !important;
    font-weight: 400 !important;
    width: auto;
}

#dapro-id-tabs .woocommerce-tabs table th {
    font-weight: 500 !important;
    font-size: var(--font-size-base) !important;
    color: var(--text) !important;
    background: transparent !important;
    border-bottom: 1px solid var(--border) !important;
    padding-bottom: 10px;
    padding-top: 8px;
}

#dapro-id-tabs .woocommerce-tabs table td {
    color: var(--text) !important;
    font-weight: 400 !important;
    font-style: normal !important;
    font-size: var(--font-size-base) !important;
    line-height: 1.6;
}

/* Make all text in table cells readable and RTL */
#dapro-id-tabs .woocommerce-tabs table td *,
#dapro-id-tabs .woocommerce-tabs table td p,
#dapro-id-tabs .woocommerce-tabs table td span,
#dapro-id-tabs .woocommerce-tabs table td a {
    color: var(--text) !important;
    font-style: normal !important;
    font-weight: 400 !important;
    direction: rtl !important;
    text-align: right !important;
}

/* English text in values should also be RTL aligned */
#dapro-id-tabs .woocommerce-tabs table td[dir="ltr"],
#dapro-id-tabs .woocommerce-tabs table td[lang="en"] {
    text-align: right !important;
}

#dapro-id-tabs .woocommerce-tabs table tr {
    transition: none;
}

#dapro-id-tabs .woocommerce-tabs table tr:hover td {
    background-color: transparent !important;
}

#dapro-id-tabs .woocommerce-tabs table tr:last-child td,
#dapro-id-tabs .woocommerce-tabs table tr:last-child th {
    border-bottom: none !important;
    padding-bottom: 0;
}

/* Better spacing for RTL layout */
#dapro-id-tabs .woocommerce-tabs table tbody tr:first-child th,
#dapro-id-tabs .woocommerce-tabs table tbody tr:first-child td {
    padding-top: 0;
}

/* ============================
   REVIEWS
============================ */
#dapro-id-tabs .woocommerce-Reviews {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

#dapro-id-tabs .woocommerce-Reviews #comments h2 {
    color: var(--text) !important;
    margin: 0 0 var(--spacing-md) 0 !important;
    padding: 0 !important;
    font-size: var(--font-size-base) !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: none !important;
    background: transparent !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

#dapro-id-tabs .woocommerce-Reviews ol.commentlist {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

#dapro-id-tabs .woocommerce-Reviews .comment_container,
#dapro-id-tabs .woocommerce-Reviews li.comment {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

#dapro-id-tabs .woocommerce-Reviews .comment-text .meta,
#dapro-id-tabs .woocommerce-Reviews .comment-text .comment-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    width: 100%;
}

#dapro-id-tabs .woocommerce-Reviews .comment-text strong {
    color: var(--text);
    font-weight: 600;
}

#dapro-id-tabs .woocommerce-Reviews .comment-text time {
    color: var(--text-light);
}

#dapro-id-tabs .woocommerce-Reviews img.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
}

#dapro-id-tabs .woocommerce-Reviews .description {
    width: 100%;
    color: var(--text);
    margin-top: var(--spacing-md);
}

#dapro-id-tabs .woocommerce-Reviews #review_form_wrapper,
#dapro-id-tabs .woocommerce-Reviews #respond {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-sizing: border-box;
}

#dapro-id-tabs .woocommerce-Reviews .comment-form-rating,
#dapro-id-tabs .woocommerce-Reviews .comment-form-comment,
#dapro-id-tabs .woocommerce-Reviews .comment-form-author,
#dapro-id-tabs .woocommerce-Reviews .comment-form-email {
    margin-bottom: var(--spacing-md);
    width: 100%;
}

#dapro-id-tabs .woocommerce-Reviews .comment-form label {
    display: block;
    margin-bottom: var(--spacing-xs);
    color: var(--text);
    font-weight: 500;
}

/* ============================
   CUSTOM STAR RATING - Our New System
============================ */
.star-rating.ella-custom-rating {
    position: relative;
    display: inline-block !important;
    height: 1em;
    width: 5.4em;
    vertical-align: middle;
    font-size: 1em;
    line-height: 1;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    direction: ltr;
    text-align: left;
}

/* RTL support: mirror the star direction so fill starts from the right */
[dir="rtl"] .star-rating.ella-custom-rating,
body.rtl .star-rating.ella-custom-rating,
html[dir="rtl"] .star-rating.ella-custom-rating {
    direction: rtl;
    text-align: right;
}

/* Hide old WooCommerce content */
.star-rating.ella-custom-rating::before,
.star-rating.ella-custom-rating::after {
    display: none !important;
    content: none !important;
}

.star-rating.ella-custom-rating span {
    display: none !important;
}

/* Stars container */
.star-rating.ella-custom-rating .ella-stars-container {
    position: relative;
    display: block;
    width: 5.4em;
    height: 1em;
    line-height: 1em;
}

/* RTL container keeps glyph order right-to-left */
[dir="rtl"] .star-rating.ella-custom-rating .ella-stars-container,
body.rtl .star-rating.ella-custom-rating .ella-stars-container,
html[dir="rtl"] .star-rating.ella-custom-rating .ella-stars-container {
    direction: rtl;
    text-align: right;
}

/* Empty stars (background layer) */
.star-rating.ella-custom-rating .ella-stars-empty {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-size: 1em;
    line-height: 1em;
    color: #e0e0e0;
    white-space: nowrap;
    z-index: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Position empty stars from the right in RTL */
[dir="rtl"] .star-rating.ella-custom-rating .ella-stars-empty,
body.rtl .star-rating.ella-custom-rating .ella-stars-empty,
html[dir="rtl"] .star-rating.ella-custom-rating .ella-stars-empty {
    left: auto;
    right: 0;
    text-align: right;
}

/* Filled stars (foreground layer, clipped) */
.star-rating.ella-custom-rating .ella-stars-filled {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    overflow: hidden;
    font-size: 1em;
    line-height: 1em;
    color: var(--accent);
    white-space: nowrap;
    z-index: 2;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    /* Width is set by JavaScript based on rating */
}

/* Clip from the right side in RTL so the fill animates correctly */
[dir="rtl"] .star-rating.ella-custom-rating .ella-stars-filled,
body.rtl .star-rating.ella-custom-rating .ella-stars-filled,
html[dir="rtl"] .star-rating.ella-custom-rating .ella-stars-filled {
    left: auto;
    right: 0;
    text-align: right;
}

/* Hide old WooCommerce star ratings that haven't been converted yet */
.star-rating:not(.ella-custom-rating) {
    opacity: 0.3;
    pointer-events: none;
}

/* ============================
   BUTTONS & FORMS
============================ */
#dapro-id-tabs .woocommerce button,
#dapro-id-tabs .woocommerce button.button,
#dapro-id-tabs .woocommerce a.button,
#dapro-id-tabs .woocommerce input[type="submit"] {
    background: var(--accent) !important;
    border: 0 !important;
    color: #fff !important;
    border-radius: var(--radius-md) !important;
    padding: 10px var(--spacing-lg) !important;
    font-weight: 600;
    font-size: var(--font-size-base);
    transition: background-color 0.2s ease;
    transform: translateZ(0);
}

#dapro-id-tabs .woocommerce button:hover,
#dapro-id-tabs .woocommerce a.button:hover,
#dapro-id-tabs .woocommerce input[type="submit"]:hover {
    background: var(--accent-dark) !important;
}

#dapro-id-tabs .woocommerce-tabs a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

#dapro-id-tabs .woocommerce-tabs a:hover {
    opacity: 0.7;
}

#dapro-id-tabs input,
#dapro-id-tabs textarea,
#dapro-id-tabs select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    font-size: var(--font-size-base);
    background: var(--bg);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#dapro-id-tabs input:focus,
#dapro-id-tabs textarea:focus,
#dapro-id-tabs select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
    outline: 0;
}

#dapro-id-tabs .woocommerce-error,
#dapro-id-tabs .woocommerce-info,
#dapro-id-tabs .woocommerce-message {
    border-radius: var(--radius-md) !important;
    border: 0 !important;
    padding: 14px var(--spacing-lg) !important;
    background: var(--accent-light) !important;
    color: var(--accent-dark) !important;
}

#dapro-id-tabs .woocommerce-tabs .panel > *:last-child {
    margin-bottom: 0;
}

/* ============================
   RESPONSIVE
============================ */
@media (max-width: 768px) {
    #dapro-id-tabs .woocommerce-tabs ul.tabs {
        gap: var(--spacing-xs);
        margin: 0 0 var(--spacing-lg);
    }

    #dapro-id-tabs .woocommerce-tabs ul.tabs li {
        flex: 1 1 calc(33.333% - 4px);
    }

    #dapro-id-tabs .woocommerce-tabs ul.tabs li a {
        padding: 10px var(--spacing-sm);
        font-size: var(--font-size-sm);
    }

    #dapro-id-tabs .woocommerce-tabs .panel {
        padding: var(--spacing-lg) var(--spacing-md);
        border-radius: var(--radius-md);
    }

    #dapro-id-tabs .woocommerce-tabs table {
        font-size: var(--font-size-md);
        border-radius: var(--radius-sm);
    }

    #dapro-id-tabs .woocommerce-tabs table th,
    #dapro-id-tabs .woocommerce-tabs table td {
        padding: 10px 12px;
    }

    #dapro-id-tabs .woocommerce-Reviews .comment_container,
    #dapro-id-tabs .woocommerce-Reviews li.comment {
        flex-direction: column;
        padding: var(--spacing-md);
        gap: var(--spacing-sm);
    }

    #dapro-id-tabs .woocommerce-Reviews .comment-text .meta,
    #dapro-id-tabs .woocommerce-Reviews .comment-text .comment-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    #dapro-id-tabs .woocommerce-Reviews img.avatar {
        width: 40px;
        height: 40px;
    }

    #dapro-id-tabs .woocommerce-Reviews #review_form_wrapper,
    #dapro-id-tabs .woocommerce-Reviews #respond {
        padding: var(--spacing-md);
    }

    #dapro-id-tabs .woocommerce-Reviews #comments h2 {
        font-size: 1.2em;
    }

    #dapro-id-tabs .star-rating.ella-custom-rating {
        width: 4.86em;
        font-size: 0.9em;
    }
    
    #dapro-id-tabs .star-rating.ella-custom-rating .ella-stars-container {
        width: 4.86em;
    }
}

/* ============================
   ACCESSIBILITY
============================ */
@media (prefers-reduced-motion: reduce) {
    #dapro-id-tabs *,
    #dapro-id-tabs *::before,
    #dapro-id-tabs *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

#dapro-id-tabs button:focus-visible,
#dapro-id-tabs input:focus-visible,
#dapro-id-tabs textarea:focus-visible,
#dapro-id-tabs select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
