/* ============================================
   Android Shop Widgets — Design System
   Desktop-first, fully responsive, RTL-ready
   ============================================ */

:root {
    --asw-primary: #2563eb;
    --asw-primary-hover: #1d4ed8;
    --asw-surface: #ffffff;
    --asw-bg: #f8fafc;
    --asw-text: #0f172a;
    --asw-muted: #64748b;
    --asw-border: #e2e8f0;
    --asw-radius: 12px;
    --asw-radius-sm: 8px;
    --asw-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.04);
    --asw-shadow-hover: 0 4px 12px rgba(15, 23, 42, 0.1), 0 8px 24px rgba(15, 23, 42, 0.06);
    --asw-gap: 1.25rem;
    --asw-font: 'Vazirmatn', system-ui, -apple-system, sans-serif;
}

/* ---------- Page builder shell ---------- */
.asw-page-builder,
.homepage-widgets,
.homepage-widgets .asw-page-builder {
    width: 100% !important;
    max-width: 100% !important;
    display: block;
    box-sizing: border-box;
}

.asw-row {
    width: 100% !important;
    margin: 0 0 1.75rem;
    box-sizing: border-box;
}

.asw-row--full {
    max-width: none !important;
    padding: 0;
}

.asw-container,
.asw-container--boxed {
    width: 100%;
    max-width: 1280px;
    margin-inline: auto;
    padding-inline: 1rem;
    box-sizing: border-box;
}
.asw-container--wide {
    width: 100%;
    max-width: 1600px;
    margin-inline: auto;
    padding-inline: 1rem;
    box-sizing: border-box;
}
@media (min-width: 1024px) {
    .asw-container,
    .asw-container--boxed,
    .asw-container--wide { padding-inline: 1.5rem; }
}

.asw-grid,
.asw-grid--4 {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: var(--asw-gap);
    width: 100% !important;
    align-items: stretch; /* equal height columns in the row */
    box-sizing: border-box;
}
.asw-grid--fullbleed {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 0;
    width: 100% !important;
}
.asw-grid--4.asw-grid--full {
    grid-template-columns: minmax(0, 1fr) !important;
}

.asw-col,
.asw-col-span-1,
.asw-col-span-2,
.asw-col-span-3,
.asw-col-span-4 {
    min-width: 0 !important;
    max-width: 100%;
    box-sizing: border-box;
}
.asw-col-span-1 { grid-column: span 1 !important; }
.asw-col-span-2 { grid-column: span 2 !important; }
.asw-col-span-3 { grid-column: span 3 !important; }
.asw-col-span-4 { grid-column: span 4 !important; }

.asw-col,
.asw-col-span-1,
.asw-col-span-2,
.asw-col-span-3,
.asw-col-span-4 {
    display: flex !important;
    flex-direction: column;
}
.asw-col__inner {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100% !important;
    min-height: 100%;
    min-width: 0;
    height: 100%;
}

.asw-widget {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    min-width: 0;
    height: 100%;
    box-sizing: border-box;
    font-family: var(--asw-font);
}
.asw-widget > * {
    flex: 1 1 auto;
}

.asw-widget > * {
    max-width: 100%;
    box-sizing: border-box;
}

/* Equal vertical size for widgets sharing a row */
.asw-col .widget-section,
.asw-col .asw-countdown,
.asw-col .asw-cta,
.asw-col .asw-newsletter,
.asw-col .asw-banner,
.asw-col .asw-products-carousel,
.asw-col .asw-products-grid,
.asw-col .asw-categories,
.asw-col .asw-brands,
.asw-col .asw-html {
    flex: 1 1 auto;
    height: 100%;
    min-height: 100%;
    box-sizing: border-box;
}
.asw-col .widget-section {
    display: flex;
    flex-direction: column;
}
.asw-col .widget-section .widget-body {
    flex: 1 1 auto;
}

/* ---------- Shared section chrome ---------- */
.widget-section {
    width: 100%;
    background: var(--asw-surface);
    border: 1px solid var(--asw-border);
    border-radius: var(--asw-radius);
    box-shadow: var(--asw-shadow);
    padding: 1.15rem 1.15rem 1.25rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.widget-header,
.asw-section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--asw-border);
}

.widget-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--asw-text);
    line-height: 1.35;
}

.widget-subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.85rem;
    color: var(--asw-muted);
}

.asw-section-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--asw-primary);
    white-space: nowrap;
    text-decoration: none;
}
.asw-section-link:hover { color: var(--asw-primary-hover); }

.widget-body {
    flex: 1;
    min-width: 0;
}

/* Span-aware typography */
.asw-widget--span-1 .widget-title { font-size: 0.98rem; }
.asw-widget--span-2 .widget-title { font-size: 1.05rem; }
.asw-widget--span-1 .widget-section,
.asw-widget--span-2 .widget-section {
    padding: 0.95rem 0.95rem 1.05rem;
}
.asw-widget--span-1 .widget-header,
.asw-widget--span-2 .widget-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.55rem;
}

/* ---------- Product grids ---------- */
.grid {
    display: grid;
    gap: 0.85rem;
    width: 100%;
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.grid-8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }

/* Auto-adapt product columns by parent span */
.asw-widget--span-1 .grid-3,
.asw-widget--span-1 .grid-4,
.asw-widget--span-1 .grid-5,
.asw-widget--span-1 .grid-6,
.asw-widget--span-1 .grid-7,
.asw-widget--span-1 .grid-8,
.asw-widget--span-1 .asw-carousel__track {
    grid-template-columns: 1fr !important;
}
.asw-widget--span-2 .grid-4,
.asw-widget--span-2 .grid-5,
.asw-widget--span-2 .grid-6,
.asw-widget--span-2 .grid-7,
.asw-widget--span-2 .grid-8,
.asw-widget--span-2 .asw-carousel__track {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
.asw-widget--span-3 .grid-5,
.asw-widget--span-3 .grid-6,
.asw-widget--span-3 .grid-7,
.asw-widget--span-3 .grid-8 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.product-card {
    background: var(--asw-bg);
    border: 1px solid var(--asw-border);
    border-radius: var(--asw-radius-sm);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.product-card:hover {
    box-shadow: var(--asw-shadow-hover);
    transform: translateY(-2px);
    border-color: #cbd5e1;
}
.product-card__image {
    display: block;
    position: relative;
    aspect-ratio: 1 / 1;
    background: #f1f5f9;
    overflow: hidden;
}
.product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}
.product-card:hover .product-card__image img {
    transform: scale(1.04);
}
.product-card__badge {
    position: absolute;
    top: 8px;
    inset-inline-start: 8px;
    background: #dc2626;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    z-index: 1;
}
.product-card__body {
    padding: 0.7rem 0.75rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
}
.product-card__title {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.4;
}
.product-card__title a {
    color: var(--asw-text);
    text-decoration: none;
}
.product-card__title a:hover { color: var(--asw-primary); }
.product-card__price {
    font-weight: 700;
    color: var(--asw-primary);
    font-size: 0.92rem;
}
.product-card__price del {
    color: var(--asw-muted);
    font-weight: 500;
    font-size: 0.8rem;
    margin-inline-end: 0.25rem;
}
.product-card__rating {
    font-size: 0.75rem;
}
.product-card__cart {
    margin-top: auto;
    padding-top: 0.35rem;
}
.product-card__cart .button,
.product-card__cart a.button {
    display: inline-block;
    width: 100%;
    text-align: center;
    background: var(--asw-primary);
    color: #fff !important;
    border: none;
    border-radius: 6px;
    padding: 0.45rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
}
.product-card__cart .button:hover {
    background: var(--asw-primary-hover);
}

.asw-widget--span-1 .product-card__title { font-size: 0.82rem; }
.asw-widget--span-1 .product-card__body { padding: 0.55rem 0.6rem 0.7rem; }

/* Products carousel shell */
.asw-products-carousel,
.asw-products-grid {
    min-width: 0;
}
.asw-carousel {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}
.asw-carousel__track {
    display: grid;
    gap: 0.85rem;
    width: 100%;
}

/* ---------- Categories ---------- */
.asw-categories .asw-cat-grid {
    gap: 0.75rem;
}
.asw-cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: var(--asw-text);
    background: var(--asw-bg);
    border: 1px solid var(--asw-border);
    border-radius: var(--asw-radius-sm);
    padding: 0.85rem 0.5rem;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.asw-cat-card:hover {
    border-color: var(--asw-primary);
    box-shadow: var(--asw-shadow);
    transform: translateY(-2px);
    color: var(--asw-primary);
}
.asw-cat-card__img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    background: #e2e8f0;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.asw-cat-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.asw-cat-card__placeholder {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--asw-muted);
}
.asw-cat-card__name {
    font-size: 0.82rem;
    font-weight: 600;
}
.asw-cat-card__count {
    font-size: 0.72rem;
    color: var(--asw-muted);
    margin-top: 0.15rem;
}
.asw-widget--span-1 .asw-cat-card__img {
    width: 48px;
    height: 48px;
}

/* ---------- Brands ---------- */
.asw-brands-grid {
    gap: 0.75rem;
}
.asw-brand-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 72px;
    padding: 0.75rem;
    background: var(--asw-bg);
    border: 1px solid var(--asw-border);
    border-radius: var(--asw-radius-sm);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.asw-brand-item:hover {
    border-color: #cbd5e1;
    box-shadow: var(--asw-shadow);
}
.asw-brand-item img {
    max-height: 40px;
    max-width: 100%;
    width: auto;
    object-fit: contain;
}
.asw-brands--gray .asw-brand-item img {
    filter: grayscale(1);
    opacity: 0.7;
    transition: filter 0.2s, opacity 0.2s;
}
.asw-brands--gray .asw-brand-item:hover img {
    filter: none;
    opacity: 1;
}
.asw-brand-item__name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--asw-muted);
}

/* ---------- Slider ---------- */
.asw-slider {
    position: relative;
    width: 100% !important;
    overflow: hidden;
    border-radius: var(--asw-radius);
    background: #0f172a;
    --asw-slider-height: 420px;
    --asw-slider-height-m: 260px;
}
.asw-row--full .asw-slider {
    border-radius: 0;
}
.asw-slider__viewport {
    width: 100%;
    height: var(--asw-slider-height);
    overflow: hidden;
    position: relative;
}
.asw-slider__track {
    display: flex;
    width: 100%;
    height: 100%;
}
.asw-slider__slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    position: relative;
    display: none;
}
.asw-slider__slide.is-active { display: block; }
.asw-slider__img,
.asw-slider__slide img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
}
.asw-slider__placeholder {
    width: 100%;
    height: 100%;
    min-height: var(--asw-slider-height);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 55%, #1e3a8a 100%);
    color: #fff;
    font-size: clamp(1.25rem, 3vw, 2rem);
    font-weight: 700;
}
.asw-slider__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,var(--asw-slider-overlay, 0.25));
    pointer-events: none;
}
.asw-slider__content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
    color: #fff;
    z-index: 2;
    pointer-events: none;
}
.asw-slider__content a,
.asw-slider__content .btn { pointer-events: auto; }
.asw-slider__content--center { align-items: center; text-align: center; }
.asw-slider__content--left { align-items: flex-start; text-align: start; }
.asw-slider__content--right { align-items: flex-end; text-align: end; }
.asw-slider__title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.25rem, 3vw, 2.25rem);
    color: #fff;
    text-shadow: 0 1px 8px rgba(0,0,0,0.25);
}
.asw-slider__subtitle {
    margin: 0 0 1rem;
    opacity: 0.92;
}
.asw-slider__link-area {
    position: absolute;
    inset: 0;
    z-index: 1;
}
.asw-slider__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    box-shadow: var(--asw-shadow);
}
.asw-slider__nav--prev { inset-inline-end: 12px; }
.asw-slider__nav--next { inset-inline-start: 12px; }
.asw-slider__dots {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
    z-index: 3;
}
.asw-slider__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    border: none;
    padding: 0;
    cursor: pointer;
}
.asw-slider__dot.is-active { background: #fff; }
@media (max-width: 767px) {
    .asw-slider__viewport { height: var(--asw-slider-height-m, 260px); }
    .asw-slider__placeholder { min-height: var(--asw-slider-height-m, 260px); }
}

/* ---------- Banner ---------- */
.asw-banner {
    position: relative;
    width: 100%;
    border-radius: var(--asw-radius);
    overflow: hidden;
    background: var(--asw-banner-bg, #0f172a);
    color: var(--asw-banner-color, #fff);
    min-height: var(--asw-banner-h, 280px);
}
.asw-row--full .asw-banner { border-radius: 0; }
.asw-banner__link { display: block; color: inherit; text-decoration: none; }
.asw-banner__inner {
    position: relative;
    min-height: var(--asw-banner-h, 280px);
    display: flex;
    align-items: center;
}
.asw-banner__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.asw-banner__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,var(--asw-banner-overlay, 0.3));
}
.asw-banner__content {
    position: relative;
    z-index: 1;
    padding: 1.75rem;
    width: 100%;
}
.asw-banner__inner--center .asw-banner__content { text-align: center; }
.asw-banner__inner--left .asw-banner__content { text-align: start; }
.asw-banner__inner--right .asw-banner__content { text-align: end; }
.asw-banner__title {
    margin: 0 0 0.4rem;
    font-size: clamp(1.2rem, 2.5vw, 1.75rem);
    color: inherit;
}
.asw-banner__sub { margin: 0 0 0.85rem; opacity: 0.9; }
.asw-banner__btn {
    display: inline-block;
    background: #fff;
    color: #0f172a !important;
    padding: 0.55rem 1.1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ---------- Mini banners ---------- */
.asw-mini-banners .grid { gap: 0.85rem; }
.asw-mini-banner {
    position: relative;
    display: block;
    border-radius: var(--asw-radius-sm);
    overflow: hidden;
    height: var(--asw-mini-h, 160px);
    background: #e2e8f0;
    text-decoration: none;
    color: #fff;
}
.asw-mini-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}
.asw-mini-banner:hover img { transform: scale(1.05); }
.asw-mini-banner__title {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    padding: 0.65rem 0.85rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.65));
    font-weight: 600;
    font-size: 0.9rem;
}
.asw-mini-banner__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(135deg, #64748b, #334155);
    font-weight: 600;
}

/* ---------- Countdown ---------- */
.asw-countdown {
    width: 100%;
    background: var(--asw-cd-bg, #0f172a);
    color: var(--asw-cd-color, #fff);
    border-radius: var(--asw-radius);
    padding: 1.35rem 1.15rem;
    box-sizing: border-box;
    box-shadow: var(--asw-shadow);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100%;
}
.asw-countdown__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    text-align: center;
}
.asw-countdown__title {
    margin: 0;
    color: inherit;
    font-size: 1.2rem;
    font-weight: 700;
}
.asw-countdown__sub { margin: 0; opacity: 0.85; font-size: 0.9rem; }
.asw-countdown__timer {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
}
.asw-countdown__unit {
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    min-width: 58px;
    text-align: center;
}
.asw-countdown__unit span,
.asw-cd-days, .asw-cd-hours, .asw-cd-mins, .asw-cd-secs {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--asw-cd-accent, #f59e0b);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}
.asw-countdown__unit small {
    font-size: 0.65rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.asw-countdown__btn {
    margin-top: 0.25rem;
    display: inline-block;
    background: var(--asw-cd-accent, #f59e0b);
    color: #0f172a !important;
    padding: 0.5rem 1.1rem;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
}
.asw-widget--span-1 .asw-countdown__unit {
    min-width: 46px;
    padding: 0.4rem 0.45rem;
}
.asw-widget--span-1 .asw-countdown__unit span { font-size: 1.1rem; }
.asw-widget--span-1 .asw-countdown__title { font-size: 1rem; }

/* ---------- CTA ---------- */
.asw-cta {
    width: 100%;
    border-radius: var(--asw-radius);
    background: var(--asw-cta-bg, #2563eb);
    color: #fff;
    box-shadow: var(--asw-shadow);
    overflow: hidden;
    min-height: 100%;
    display: flex;
    align-items: center;
}
.asw-cta__inner {
    padding: 1.75rem 1.35rem;
    text-align: center;
    width: 100%;
}
.asw-cta__title {
    color: inherit;
    margin: 0 0 0.4rem;
    font-size: 1.25rem;
}
.asw-cta__text {
    margin: 0;
    opacity: 0.9;
    font-size: 0.92rem;
}
.asw-cta__btn {
    margin-top: 1rem;
    display: inline-block;
    background: #fff !important;
    color: #0f172a !important;
    padding: 0.55rem 1.2rem;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
}
.asw-widget--span-1 .asw-cta__inner { padding: 1.25rem 1rem; }
.asw-widget--span-1 .asw-cta__title { font-size: 1.05rem; }

/* ---------- Newsletter ---------- */
.asw-newsletter {
    width: 100%;
    min-height: 100%;
}
.asw-newsletter__inner {
    text-align: center;
    padding: 1.5rem 1.2rem;
    background: var(--asw-surface);
    border: 1px solid var(--asw-border);
    border-radius: var(--asw-radius);
    box-shadow: var(--asw-shadow);
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.asw-newsletter__inner h2,
.asw-newsletter__title {
    margin: 0 0 0.35rem;
    font-size: 1.2rem;
}
.asw-newsletter__desc {
    margin: 0 0 0.85rem;
    color: var(--asw-muted);
    font-size: 0.9rem;
}
.asw-newsletter-form {
    display: flex;
    gap: 0.5rem;
    max-width: 420px;
    margin: 0 auto;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}
.asw-newsletter-form input[type="email"] {
    flex: 1;
    min-width: 140px;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--asw-border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
}
.asw-newsletter-form button,
.asw-newsletter-form .btn {
    background: var(--asw-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.6rem 1.1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.asw-widget--span-1 .asw-newsletter-form {
    flex-direction: column;
}
.asw-widget--span-1 .asw-newsletter-form input[type="email"] {
    width: 100%;
}

/* ---------- Posts ---------- */
.asw-post-card {
    background: var(--asw-bg);
    border: 1px solid var(--asw-border);
    border-radius: var(--asw-radius-sm);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
}
.asw-post-card:hover {
    box-shadow: var(--asw-shadow-hover);
    transform: translateY(-2px);
}
.asw-post-card .product-card__image {
    aspect-ratio: 16 / 10;
}
.asw-post-card .product-card__body {
    padding: 0.75rem;
}
.asw-post-card h3 {
    margin: 0 0 0.35rem;
    font-size: 0.92rem;
    line-height: 1.4;
}
.asw-post-card h3 a {
    color: var(--asw-text);
    text-decoration: none;
}
.asw-post-card h3 a:hover { color: var(--asw-primary); }

/* ---------- FAQ / Accordion ---------- */
.asw-faq-item {
    border: 1px solid var(--asw-border);
    border-radius: var(--asw-radius-sm);
    margin-bottom: 0.5rem;
    overflow: hidden;
    background: var(--asw-bg);
}
.asw-faq-item summary,
.asw-faq-item__q {
    padding: 0.75rem 1rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}
.asw-faq-item__a {
    padding: 0 1rem 0.85rem;
    color: var(--asw-muted);
    font-size: 0.92rem;
}

/* ---------- Icon boxes / stats / social / contact ---------- */
.asw-icon-box,
.asw-stat-item {
    text-align: center;
    padding: 1.15rem 0.85rem;
    background: var(--asw-bg);
    border: 1px solid var(--asw-border);
    border-radius: var(--asw-radius-sm);
    height: 100%;
}
.asw-icon-box__icon,
.asw-stat-item__num {
    font-size: 1.75rem;
    color: var(--asw-primary);
    font-weight: 700;
    margin-bottom: 0.4rem;
}
.asw-icon-box__title,
.asw-stat-item__label {
    font-weight: 600;
    font-size: 0.95rem;
}
.asw-icon-box__text {
    font-size: 0.85rem;
    color: var(--asw-muted);
    margin-top: 0.3rem;
}

.asw-social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}
.asw-social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--asw-primary);
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}
.asw-social-links a:hover { background: var(--asw-primary-hover); }

.asw-contact-info {
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--asw-text);
}
.asw-contact-info a { color: var(--asw-primary); }

/* ---------- Heading / Divider / HTML / Search ---------- */
.asw-heading {
    text-align: center;
    padding: 0.5rem 0;
}
.asw-heading__title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}
.asw-heading__sub {
    margin: 0.35rem 0 0;
    color: var(--asw-muted);
}
.asw-heading--left { text-align: start; }
.asw-heading--right { text-align: end; }

.asw-divider {
    border: none;
    border-top: 1px solid var(--asw-border);
    margin: 0.5rem 0;
}

.asw-html__content {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--asw-text);
}
.asw-html__content img {
    border-radius: var(--asw-radius-sm);
}

.asw-search-form {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}
.asw-search-form input[type="search"] {
    flex: 1;
    padding: 0.65rem 1rem;
    border: 1px solid var(--asw-border);
    border-radius: 6px;
    font-family: inherit;
}
.asw-search-form button {
    background: var(--asw-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.65rem 1.1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

/* ---------- Testimonials ---------- */
.asw-testimonial {
    background: var(--asw-bg);
    border: 1px solid var(--asw-border);
    border-radius: var(--asw-radius-sm);
    padding: 1.15rem;
    height: 100%;
}
.asw-testimonial__text {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--asw-text);
    margin: 0 0 0.85rem;
}
.asw-testimonial__author {
    font-weight: 600;
    font-size: 0.85rem;
}
.asw-testimonial__role {
    font-size: 0.75rem;
    color: var(--asw-muted);
}

/* ---------- Empty / fallback ---------- */
.widget-body .text-center,
.asw-widget .text-center {
    color: var(--asw-muted);
    font-size: 0.9rem;
    padding: 1.5rem 0.5rem;
    margin: 0;
}

/* ---------- Buttons shared ---------- */
.btn,
.btn-primary {
    display: inline-block;
    background: var(--asw-primary);
    color: #fff !important;
    border: none;
    border-radius: 6px;
    padding: 0.55rem 1.15rem;
    font-weight: 600;
    text-decoration: none;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
}
.btn:hover,
.btn-primary:hover { background: var(--asw-primary-hover); }

/* ---------- Responsive breakpoints ---------- */
@media (max-width: 991px) {
    .asw-grid--4 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    .asw-col-span-1 { grid-column: span 1 !important; }
    .asw-col-span-2,
    .asw-col-span-3,
    .asw-col-span-4 { grid-column: span 2 !important; }

    .grid-4, .grid-5, .grid-6, .grid-7, .grid-8 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .asw-grid--4 {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    .asw-col-span-1,
    .asw-col-span-2,
    .asw-col-span-3,
    .asw-col-span-4 {
        grid-column: span 1 !important;
    }
    .grid-2, .grid-3, .grid-4, .grid-5, .grid-6, .grid-7, .grid-8 {
        grid-template-columns: minmax(0, 1fr);
    }
    .widget-section {
        padding: 0.9rem;
    }
    .asw-section-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Visibility helpers */
@media (min-width: 992px) {
    .asw-hide-desktop { display: none !important; }
}
@media (min-width: 576px) and (max-width: 991px) {
    .asw-hide-tablet { display: none !important; }
}
@media (max-width: 575px) {
    .asw-hide-mobile { display: none !important; }
}

/* ========== Advanced widgets ========== */
.asw-image { margin: 0; width: 100%; }
.asw-image img { width: 100%; height: auto; display: block; }
.asw-image figcaption { margin-top: 0.5rem; font-size: 0.85rem; color: var(--asw-muted); text-align: center; }
.asw-image--empty {
    padding: 2rem; text-align: center; background: var(--asw-bg); border: 1px dashed var(--asw-border);
    border-radius: var(--asw-radius); color: var(--asw-muted);
}

.asw-button-wrap { display: flex; width: 100%; }
.asw-button-wrap--center { justify-content: center; }
.asw-button-wrap--start { justify-content: flex-start; }
.asw-button-wrap--end { justify-content: flex-end; }
.asw-btn {
    display: inline-block; border-radius: 8px; font-weight: 600; text-decoration: none;
    font-family: inherit; transition: background .15s, color .15s, border-color .15s; border: 2px solid transparent;
}
.asw-btn--sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.asw-btn--md { padding: 0.6rem 1.25rem; font-size: 0.95rem; }
.asw-btn--lg { padding: 0.8rem 1.6rem; font-size: 1.05rem; }
.asw-btn--primary { background: var(--asw-primary); color: #fff !important; }
.asw-btn--primary:hover { background: var(--asw-primary-hover); }
.asw-btn--outline { background: transparent; border-color: var(--asw-primary); color: var(--asw-primary) !important; }
.asw-btn--outline:hover { background: var(--asw-primary); color: #fff !important; }
.asw-btn--dark { background: #0f172a; color: #fff !important; }
.asw-btn--light { background: #fff; color: #0f172a !important; border-color: var(--asw-border); }

.asw-gallery-item { margin: 0; border-radius: var(--asw-radius-sm); overflow: hidden; background: var(--asw-bg); border: 1px solid var(--asw-border); }
.asw-gallery-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.asw-gallery-item__ph { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; color: var(--asw-muted); background: #e2e8f0; }
.asw-gallery-item figcaption { padding: 0.45rem 0.6rem; font-size: 0.8rem; color: var(--asw-muted); }

.asw-icon-list__ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.asw-icon-list__ul li { display: flex; align-items: flex-start; gap: 0.65rem; font-size: 0.95rem; }
.asw-icon-list__icon {
    flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: rgba(37,99,235,0.1);
    color: var(--asw-primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem;
}

.asw-tabs__nav { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1rem; border-bottom: 1px solid var(--asw-border); padding-bottom: 0.5rem; }
.asw-tabs__tab {
    border: none; background: transparent; padding: 0.5rem 0.9rem; border-radius: 6px; font-weight: 600;
    font-family: inherit; cursor: pointer; color: var(--asw-muted); font-size: 0.9rem;
}
.asw-tabs__tab.is-active { background: var(--asw-primary); color: #fff; }
.asw-tabs__panel { display: none; font-size: 0.95rem; line-height: 1.65; color: var(--asw-text); }
.asw-tabs__panel.is-active { display: block; }

.asw-team-card { text-align: center; padding: 1rem 0.75rem; background: var(--asw-bg); border: 1px solid var(--asw-border); border-radius: var(--asw-radius-sm); }
.asw-team-card__avatar {
    width: 88px; height: 88px; border-radius: 50%; overflow: hidden; margin: 0 auto 0.75rem;
    background: #e2e8f0; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 700; color: var(--asw-muted);
}
.asw-team-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.asw-team-card__name { margin: 0 0 0.2rem; font-size: 1rem; }
.asw-team-card__role { margin: 0; font-size: 0.85rem; color: var(--asw-muted); }
.asw-widget--span-1 .asw-team-card__avatar { width: 64px; height: 64px; }

.asw-price-card {
    background: var(--asw-bg); border: 1px solid var(--asw-border); border-radius: var(--asw-radius);
    padding: 1.35rem 1.15rem; text-align: center; height: 100%; display: flex; flex-direction: column; gap: 0.75rem;
}
.asw-price-card.is-featured { border-color: var(--asw-primary); box-shadow: 0 0 0 2px rgba(37,99,235,0.15); background: #fff; }
.asw-price-card__name { margin: 0; font-size: 1.05rem; }
.asw-price-card__price { font-size: 2rem; font-weight: 800; color: var(--asw-text); line-height: 1; }
.asw-price-card__price small { font-size: 0.9rem; font-weight: 500; color: var(--asw-muted); }
.asw-price-card__features { list-style: none; margin: 0; padding: 0; text-align: start; flex: 1; }
.asw-price-card__features li { padding: 0.35rem 0; border-bottom: 1px solid var(--asw-border); font-size: 0.9rem; }
.asw-price-card .asw-btn { margin-top: auto; width: 100%; text-align: center; box-sizing: border-box; }

.asw-progress-item { margin-bottom: 0.85rem; }
.asw-progress-item__label { display: flex; justify-content: space-between; font-size: 0.88rem; font-weight: 600; margin-bottom: 0.35rem; }
.asw-progress-item__bar { height: 10px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.asw-progress-item__bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--asw-primary), #60a5fa); border-radius: 999px; }

.asw-alert { border-radius: var(--asw-radius-sm); padding: 0.95rem 1.1rem; border: 1px solid transparent; }
.asw-alert__title { display: block; margin-bottom: 0.25rem; }
.asw-alert__text { margin: 0; font-size: 0.92rem; }
.asw-alert--info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.asw-alert--success { background: #f0fdf4; border-color: #bbf7d0; color: #14532d; }
.asw-alert--warning { background: #fffbeb; border-color: #fde68a; color: #78350f; }
.asw-alert--danger { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }

.asw-announce {
    background: var(--asw-ann-bg, #0f172a); color: var(--asw-ann-color, #fff);
    text-align: center; padding: 0.65rem 1rem; font-size: 0.9rem; font-weight: 600;
}
.asw-announce a { color: inherit; text-decoration: none; }
.asw-row--full .asw-announce { border-radius: 0; }

.asw-map__frame { width: 100%; border-radius: var(--asw-radius-sm); overflow: hidden; background: #e2e8f0; }
.asw-map__frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.asw-map__placeholder { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--asw-muted); }

.asw-login .login-username,
.asw-login .login-password,
.asw-login .login-remember,
.asw-login .login-submit { margin-bottom: 0.75rem; }
.asw-login input[type="text"],
.asw-login input[type="password"] {
    width: 100%; padding: 0.55rem 0.75rem; border: 1px solid var(--asw-border); border-radius: 6px; font-family: inherit;
}
.asw-login .button {
    background: var(--asw-primary); color: #fff; border: none; border-radius: 6px; padding: 0.55rem 1.1rem; font-weight: 600; cursor: pointer;
}

.asw-breadcrumbs ol {
    list-style: none; margin: 0; padding: 0.5rem 0; display: flex; flex-wrap: wrap; gap: 0.35rem; font-size: 0.85rem; color: var(--asw-muted);
}
.asw-breadcrumbs li:not(:last-child)::after { content: "/"; margin-inline-start: 0.35rem; opacity: 0.5; }
.asw-breadcrumbs a { color: var(--asw-primary); text-decoration: none; }

/* Span-aware advanced */
.asw-widget--span-1 .asw-price-card__price { font-size: 1.5rem; }
.asw-widget--span-1 .asw-tabs__tab { padding: 0.4rem 0.65rem; font-size: 0.8rem; }

/* Advanced style system (Elementor-like) */
.asw-widget .widget-title {
    color: var(--asw-title-color, inherit);
    font-size: var(--asw-title-size, inherit);
    font-weight: var(--asw-title-weight, inherit);
}
.asw-widget.asw-shadow-none,
.asw-widget.asw-shadow-none .widget-section {
    box-shadow: none !important;
}
.asw-widget.asw-has-overlay {
    position: relative;
}
.asw-widget.asw-has-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--asw-overlay, transparent);
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
}
.asw-widget.asw-has-overlay > * {
    position: relative;
    z-index: 1;
}


/* Preserve cell order: DOM order matches builder when both share dir */
.asw-page-builder[dir="rtl"] .asw-grid--4,
.asw-page-builder[dir="rtl"] .asw-grid {
    direction: rtl;
}
.asw-page-builder[dir="ltr"] .asw-grid--4,
.asw-page-builder[dir="ltr"] .asw-grid {
    direction: ltr;
}
/* Adjacent same-type widgets stay in separate columns (no collapse) */
.asw-grid--4 > .asw-col {
    min-width: 0;
}
