/*
 * Sidebar style 1: soft cards with an accent title underline.
 * Colors come from variables so the dark and black themes only swap values.
 * Logical properties keep the same rules correct for RTL and LTR.
 */
:root {
    --ahura-sb-accent: var(--ahura-sidebar-accent, #1d67e8);
    --ahura-sb-accent-soft: color-mix(in srgb, var(--ahura-sb-accent) 10%, transparent);
    --ahura-sb-card-bg: #fff;
    --ahura-sb-card-border: rgb(16 24 40 / 6%);
    --ahura-sb-card-shadow: 0 1px 2px rgb(16 24 40 / 4%), 0 12px 32px -18px rgb(16 24 40 / 18%);
    --ahura-sb-card-shadow-hover: 0 1px 2px rgb(16 24 40 / 5%), 0 18px 40px -20px rgb(16 24 40 / 28%);
    --ahura-sb-text: var(--ahura-c-text-primary, #191919);
    --ahura-sb-muted: #8b9099;
    --ahura-sb-divider: #eef0f3;
    --ahura-sb-soft: #f5f6f8;
}

html:is(.ahura-dark-theme, .ahura-black-theme) {
    --ahura-sb-accent-soft: color-mix(in srgb, var(--ahura-sb-accent) 20%, transparent);
    --ahura-sb-card-bg: var(--ahura-c-bg-secondary);
    --ahura-sb-card-border: var(--ahura-c-border-primary);
    --ahura-sb-card-shadow: 0 12px 32px -20px rgb(0 0 0 / 60%);
    --ahura-sb-card-shadow-hover: 0 18px 40px -20px rgb(0 0 0 / 75%);
    --ahura-sb-muted: #9a9ca3;
    --ahura-sb-divider: rgb(255 255 255 / 8%);
    --ahura-sb-soft: rgb(255 255 255 / 6%);
}

/* card */
.ahura-sidebar .sidebar-widget.sidebar-mode-1 {
    background: var(--ahura-sb-card-bg);
    border: 1px solid var(--ahura-sb-card-border);
    border-radius: var(--ahura-sidebar-widget-radius, 16px);
    box-shadow: var(--ahura-sb-card-shadow);
    color: var(--ahura-sb-text);
    margin-bottom: 20px;
    padding: 20px;
    transition: box-shadow .25s ease;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1:hover {
    box-shadow: var(--ahura-sb-card-shadow-hover);
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 form {
    margin-top: 0;
}

/* block widgets stack their parts with flow margins, the title already spaces them */
.ahura-sidebar .sidebar-widget.sidebar-mode-1 .wp-block-group__inner-container > * {
    margin-block: 0;
}

/* title */
.ahura-sidebar .sidebar-widget.sidebar-mode-1 :is(.sidebar-widget-title, .wp-block-heading, .wp-block-search__label) {
    position: relative;
    display: block;
    margin: 0 0 16px;
    padding: 0 0 14px;
    border-bottom: 1px solid var(--ahura-sb-divider);
    color: var(--ahura-sb-text);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.6;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 :is(.sidebar-widget-title, .wp-block-heading, .wp-block-search__label)::before {
    content: '';
    position: absolute;
    top: auto;
    bottom: -2px;
    inset-inline-start: 0;
    inset-inline-end: auto;
    width: 40px;
    height: 3px;
    border-radius: 3px;
    background-color: var(--ahura-sb-accent);
}

/* lists */
.ahura-sidebar .sidebar-widget.sidebar-mode-1 :is(ul, ol) {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 :is(ul:not([class]), .wp-block-categories, .wp-block-archives-list, .wp-block-page-list, .product-categories, .menu, .children) > li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    margin: 0;
    padding: 9px 0;
    border-bottom: 1px dashed var(--ahura-sb-divider);
    color: var(--ahura-sb-muted);
    font-size: 13px;
    line-height: 1.7;
    list-style: none;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 :is(ul:not([class]), .wp-block-categories, .wp-block-archives-list, .wp-block-page-list, .product-categories, .menu, .children) > li:first-child {
    padding-top: 0;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 :is(ul:not([class]), .wp-block-categories, .wp-block-archives-list, .wp-block-page-list, .product-categories, .menu, .children) > li:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 :is(ul:not([class]), .wp-block-categories, .wp-block-archives-list, .wp-block-page-list, .product-categories, .menu, .children) > li::before {
    content: '';
    flex: none;
    position: static;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--ahura-sb-accent) 35%, transparent);
    box-shadow: 0 0 0 3px transparent;
    transform: none;
    transition: background-color .2s ease, box-shadow .2s ease;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 :is(ul:not([class]), .wp-block-categories, .wp-block-archives-list, .wp-block-page-list, .product-categories, .menu, .children) > li:hover::before {
    background: var(--ahura-sb-accent);
    box-shadow: 0 0 0 3px var(--ahura-sb-accent-soft);
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 :is(ul:not([class]), .wp-block-categories, .wp-block-archives-list, .wp-block-page-list, .product-categories, .menu, .children) > li > a {
    display: block;
    flex: 1 1 0;
    min-width: 0;
    padding: 0;
    background: none;
    box-shadow: none;
    color: var(--ahura-sb-text);
    font-size: 14px;
    transition: color .2s ease, transform .2s ease;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 :is(ul:not([class]), .wp-block-categories, .wp-block-archives-list, .wp-block-page-list, .product-categories, .menu, .children) > li > a:hover {
    padding: 0;
    background: none;
    box-shadow: none;
    color: var(--ahura-sb-accent);
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .count {
    min-width: 26px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--ahura-sb-soft);
    color: var(--ahura-sb-muted);
    font-size: 12px;
    line-height: 22px;
    text-align: center;
    transition: background-color .2s ease, color .2s ease;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 li:hover > .count {
    background: var(--ahura-sb-accent-soft);
    color: var(--ahura-sb-accent);
}

/* nested categories and menus */
.ahura-sidebar .sidebar-widget.sidebar-mode-1 li > :is(ul.children, ul.sub-menu) {
    flex-basis: 100%;
    margin-top: 9px;
    padding: 0;
    padding-inline-start: 16px;
    border-inline-start: 1px dashed var(--ahura-sb-divider);
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 ul.product-categories li.cat-parent::before {
    position: static;
    content: '';
    transform: none;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--ahura-sb-divider);
    border-radius: 12px;
    background-color: var(--ahura-sb-soft);
    color: var(--ahura-sb-text);
    font-size: 14px;
}

/* search */
.ahura-sidebar .sidebar-widget.sidebar-mode-1 .wp-block-search__inside-wrapper {
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: var(--ahura-sb-soft);
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .wp-block-search__inside-wrapper:focus-within {
    border-color: var(--ahura-sb-accent);
    background: var(--ahura-sb-card-bg);
    box-shadow: 0 0 0 4px var(--ahura-sb-accent-soft);
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .wp-block-search__input {
    flex: 1 1 auto;
    min-width: 0;
    height: auto;
    margin: 0;
    padding: 8px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
    color: var(--ahura-sb-text);
    font-size: 14px;
    outline: 0;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .wp-block-search__button {
    flex: none;
    margin: 0;
    padding: 8px 16px;
    border: 0;
    border-radius: 10px;
    background: var(--ahura-sb-accent);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: filter .2s ease;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .wp-block-search__button:hover {
    filter: brightness(1.08);
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .wp-block-search__button svg {
    fill: currentColor;
}

/* latest posts block */
.ahura-sidebar .sidebar-widget.sidebar-mode-1 .wp-block-latest-posts > li {
    margin: 0;
    padding: 12px 0;
    border-bottom: 1px dashed var(--ahura-sb-divider);
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .wp-block-latest-posts > li:first-child {
    padding-top: 0;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .wp-block-latest-posts > li:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .wp-block-latest-posts > li:has(.wp-block-latest-posts__featured-image) {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    column-gap: 12px;
    align-items: center;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .wp-block-latest-posts__featured-image {
    grid-row: span 3;
    float: none;
    width: 64px;
    height: 64px;
    margin: 0;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .wp-block-latest-posts__featured-image img {
    width: 64px;
    height: 64px;
    max-width: none;
    margin: 0;
    border-radius: 12px;
    object-fit: cover;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .wp-block-latest-posts__post-title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: var(--ahura-sb-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.7;
    transition: color .2s ease;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .wp-block-latest-posts__post-title:hover {
    color: var(--ahura-sb-accent);
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 :is(.wp-block-latest-posts__post-date, .wp-block-latest-posts__post-author, .post-date, .wp-block-latest-comments__comment-date) {
    display: block;
    margin: 2px 0 0;
    color: var(--ahura-sb-muted);
    font-size: 12px;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .wp-block-latest-posts__post-excerpt {
    grid-column: 1 / -1;
    margin: 8px 0 0;
    color: var(--ahura-sb-muted);
    font-size: 13px;
    line-height: 1.8;
}

/* latest comments block */
.ahura-sidebar .sidebar-widget.sidebar-mode-1 .wp-block-latest-comments__comment {
    margin: 0;
    padding: 12px 0;
    border-bottom: 1px dashed var(--ahura-sb-divider);
    font-size: 13px;
    line-height: 1.8;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .wp-block-latest-comments__comment:first-child {
    padding-top: 0;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .wp-block-latest-comments__comment:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .wp-block-latest-comments__comment-avatar {
    border-radius: 50%;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .no-comments {
    padding: 16px;
    border-radius: 12px;
    background: var(--ahura-sb-soft);
    color: var(--ahura-sb-muted);
    font-size: 13px;
    text-align: center;
}

/* tag cloud */
.ahura-sidebar .sidebar-widget.sidebar-mode-1 :is(.tagcloud, .wp-block-tag-cloud) {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 :is(.tagcloud, .wp-block-tag-cloud) a {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--ahura-sb-soft);
    color: var(--ahura-sb-text);
    line-height: 1.5;
    transition: background-color .2s ease, color .2s ease;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 :is(.tagcloud, .wp-block-tag-cloud) a:hover {
    background: var(--ahura-sb-accent);
    color: #fff;
}

/* text widget */
.ahura-sidebar .sidebar-widget.sidebar-mode-1 .textwidget {
    padding: 0;
    color: var(--ahura-sb-muted);
    font-size: 14px;
    line-height: 1.9;
    text-align: start;
}

/* WooCommerce product lists (top rated, recent, on sale, ...) */
.ahura-sidebar .sidebar-widget.sidebar-mode-1 .product_list_widget li {
    position: relative;
    display: block;
    min-height: 64px;
    margin: 0;
    padding: 12px 0;
    padding-inline-start: 76px;
    border-bottom: 1px dashed var(--ahura-sb-divider);
    box-sizing: content-box;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .product_list_widget li:first-child {
    padding-top: 0;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .product_list_widget li:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .product_list_widget li a {
    display: block;
    width: auto;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .product_list_widget li img {
    position: absolute;
    top: 12px;
    inset-inline-start: 0;
    width: 64px;
    height: 64px;
    margin: 0;
    border-radius: 12px;
    background: var(--ahura-sb-soft);
    object-fit: cover;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .product_list_widget li:first-child img {
    top: 0;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .product_list_widget li .product-title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: var(--ahura-sb-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.7;
    transition: color .2s ease;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .product_list_widget li a:hover .product-title {
    color: var(--ahura-sb-accent);
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .product_list_widget li .star-rating {
    float: none;
    margin: 4px 0 2px;
    font-size: 11px;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .product_list_widget li :is(.woocommerce-Price-amount, del, ins) {
    padding: 0;
    color: var(--ahura-sb-accent);
    font-size: 13px;
    font-weight: 700;
    text-align: start;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .product_list_widget li del,
.ahura-sidebar .sidebar-widget.sidebar-mode-1 .product_list_widget li del .woocommerce-Price-amount {
    color: var(--ahura-sb-muted);
    font-weight: 400;
}

.ahura-sidebar .sidebar-widget.sidebar-mode-1 .product_list_widget li ins {
    text-decoration: none;
}
