/* Widget Design System — Laragh Kids Theme */

.wgt-card {
    --wgt-accent: var(--kids-orange, #FF8A1F);
    --wgt-accent-soft: rgba(255, 138, 31, 0.12);
    --wgt-border: rgba(43, 42, 74, 0.08);
    --wgt-shadow: var(--kids-shadow-soft, 0 8px 24px rgba(43, 42, 74, 0.08));
    background: var(--kids-surface, #fff);
    border: 1px solid var(--wgt-border);
    border-radius: var(--kids-radius-sm, 14px);
    box-shadow: var(--wgt-shadow);
    overflow: hidden;
}

.wgt-card--sidebar {
    border-radius: 18px;
}

.wgt-card--banner {
    border: 0;
    box-shadow: var(--kids-shadow, 0 12px 30px rgba(255, 138, 31, 0.18));
}

.wgt-card--muted {
    background: linear-gradient(180deg, #fff 0%, #fffaf2 100%);
}

.wgt-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.95rem 1.1rem 0.75rem;
    border-bottom: 1px solid var(--wgt-border);
}

.wgt-card__title-wrap {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.wgt-card__icon {
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--wgt-accent-soft);
    color: var(--wgt-accent);
    flex-shrink: 0;
    font-size: 1rem;
}

.wgt-card__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: var(--kids-ink, #2B2A4A);
    line-height: 1.35;
}

.wgt-card__action {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--kids-orange-deep, #F06D00);
    text-decoration: none;
    white-space: nowrap;
}

.wgt-card__action:hover {
    color: var(--kids-coral, #FF5A6B);
}

.wgt-card__body {
    padding: 1rem 1.1rem 1.1rem;
}

.wgt-card--banner .wgt-card__body {
    padding: 0;
}

.wgt-card__body--flush {
    padding: 0;
}

.wgt-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.45rem;
    padding: 1.35rem 1rem;
    color: var(--kids-muted, #6B7280);
}

.wgt-state__icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(107, 114, 128, 0.1);
    color: var(--kids-muted, #6B7280);
    font-size: 1.15rem;
}

.wgt-state__title {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--kids-ink, #2B2A4A);
}

.wgt-state__text {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.5;
}

.wgt-state--error .wgt-state__icon {
    background: rgba(255, 90, 107, 0.12);
    color: var(--kids-coral, #FF5A6B);
}

.wgt-state--loading .wgt-state__icon {
    animation: wgt-pulse 1.2s ease-in-out infinite;
}

@keyframes wgt-pulse {
    0%, 100% { opacity: 0.45; transform: scale(0.96); }
    50% { opacity: 1; transform: scale(1); }
}

.widget-slot .widget {
    margin-bottom: 1rem;
}

.widget-slot .widget:last-child {
    margin-bottom: 0;
}

/* Banner */
.wgt-banner {
    position: relative;
    display: block;
    border-radius: inherit;
    overflow: hidden;
    background: linear-gradient(135deg, #fff4dc, #ffe8bf);
}

.wgt-banner__media {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 7;
    object-fit: cover;
}

.wgt-banner__overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: 1rem 1.1rem;
    background: linear-gradient(180deg, rgba(43, 42, 74, 0) 0%, rgba(43, 42, 74, 0.72) 100%);
    color: #fff;
}

.wgt-banner__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.35;
}

.wgt-banner__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.45rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    opacity: 0.92;
}

/* Product slider */
.wgt-product-slider__track {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 0.35rem;
    scrollbar-width: thin;
}

.wgt-product-slider__track::-webkit-scrollbar {
    height: 6px;
}

.wgt-product-slider__track::-webkit-scrollbar-thumb {
    background: rgba(43, 42, 74, 0.18);
    border-radius: 999px;
}

.wgt-product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.wgt-product-grid .wgt-product-slide {
    flex: none;
    width: 100%;
    min-width: 0;
}

.widget--width-full .wgt-product-grid,
.widget--width-container .wgt-product-grid,
.widget--width-custom .wgt-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .widget--width-full .wgt-product-grid,
    .widget--width-container .wgt-product-grid,
    .widget--width-custom .wgt-product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.wgt-product-slide {
    flex: 0 0 min(160px, 48%);
    scroll-snap-align: start;
    border: 1px solid rgba(43, 42, 74, 0.08);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wgt-product-slide:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(43, 42, 74, 0.1);
}

.wgt-product-slide__link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.wgt-product-slide__media {
    aspect-ratio: 1 / 1;
    background: #fff8ef;
    overflow: hidden;
}

.wgt-product-slide__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wgt-product-slide__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--kids-orange, #FF8A1F);
    font-size: 1.6rem;
}

.wgt-product-slide__body {
    padding: 0.75rem 0.8rem 0.85rem;
}

.wgt-product-slide__name {
    margin: 0 0 0.35rem;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--kids-ink, #2B2A4A);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
}

.wgt-product-slide__price {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--kids-orange-deep, #F06D00);
}

.wgt-product-slide__price-old {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--kids-muted, #6B7280);
    text-decoration: line-through;
}

/* Categories */
.wgt-category-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.wgt-category-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(43, 42, 74, 0.07);
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.wgt-category-item:hover {
    background: var(--wgt-accent-soft);
    border-color: rgba(255, 138, 31, 0.25);
    transform: translateX(-2px);
    color: inherit;
}

[dir="ltr"] .wgt-category-item:hover {
    transform: translateX(2px);
}

.wgt-category-item__icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--chip-soft, #FFE4C2);
    color: var(--chip-ink, #C45A00);
    flex-shrink: 0;
    overflow: hidden;
}

.wgt-category-item__icon--1 { --chip-soft: #FFE4C2; --chip-ink: #C45A00; background: #FFE4C2; color: #C45A00; }
.wgt-category-item__icon--2 { --chip-soft: #D6F1FF; --chip-ink: #0A6EAE; background: #D6F1FF; color: #0A6EAE; }
.wgt-category-item__icon--3 { --chip-soft: #D4F8EC; --chip-ink: #0F8A64; background: #D4F8EC; color: #0F8A64; }
.wgt-category-item__icon--4 { --chip-soft: #FFD6DC; --chip-ink: #C23042; background: #FFD6DC; color: #C23042; }
.wgt-category-item__icon--5 { --chip-soft: #FFF3C2; --chip-ink: #9A7400; background: #FFF3C2; color: #9A7400; }
.wgt-category-item__icon--6 { --chip-soft: #EDE4FF; --chip-ink: #5B3DB8; background: #EDE4FF; color: #5B3DB8; }

.wgt-category-item__icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wgt-category-item__meta {
    flex: 1;
    min-width: 0;
}

.wgt-category-item__name {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--kids-ink, #2B2A4A);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wgt-category-item__count {
    display: block;
    font-size: 0.74rem;
    color: var(--kids-muted, #6B7280);
    margin-top: 0.1rem;
}

.wgt-category-item__arrow {
    color: var(--kids-orange, #FF8A1F);
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Latest posts */
.wgt-post-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.wgt-post-item {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 0.75rem;
    align-items: start;
    text-decoration: none;
    color: inherit;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(43, 42, 74, 0.08);
}

.wgt-post-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.wgt-post-item__thumb {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    overflow: hidden;
    background: #eef6ff;
    flex-shrink: 0;
}

.wgt-post-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wgt-post-item__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--kids-sky, #3DB9FF);
    font-size: 1.35rem;
}

.wgt-post-item__title {
    margin: 0 0 0.25rem;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.45;
    color: var(--kids-ink, #2B2A4A);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wgt-post-item__meta {
    font-size: 0.74rem;
    color: var(--kids-muted, #6B7280);
}

.wgt-post-item:hover .wgt-post-item__title {
    color: var(--kids-orange-deep, #F06D00);
}

.wgt-video {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #111;
}

.wgt-video iframe,
.wgt-video video {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.wgt-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.wgt-gallery__item {
    display: block;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: #fff8ef;
}

.wgt-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wgt-banner-slider__track {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 0.35rem;
}

.wgt-banner-slider__slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
}

.wgt-multi-banner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.wgt-multi-banner__item {
    display: block;
    border-radius: 12px;
    overflow: hidden;
}

.wgt-multi-banner__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    aspect-ratio: 16 / 10;
}

.wgt-text-ad__body {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--kids-ink, #2B2A4A);
}

.wgt-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wgt-menu li + li {
    margin-top: 0.4rem;
}

.wgt-menu a {
    color: var(--kids-ink, #2B2A4A);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
}

.wgt-menu ul {
    list-style: none;
    margin: 0.35rem 0 0;
    padding: 0 0.9rem 0 0;
}

.wgt-menu ul a {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--kids-muted, #6B7280);
}

.wgt-social {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wgt-social__link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    color: var(--kids-ink, #2B2A4A);
    font-weight: 700;
}

.wgt-search .form-control,
.wgt-newsletter .form-control {
    border-radius: 12px;
}

/* HTML content */
.wgt-html__body {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--kids-ink, #2B2A4A);
}

.wgt-html__body :last-child {
    margin-bottom: 0;
}

/* Admin preview frame */
.wgt-preview-frame {
    border: 1px dashed rgba(43, 42, 74, 0.18);
    border-radius: 16px;
    background: #fffaf2;
    padding: 1rem;
    min-height: 180px;
}

.wgt-preview-frame .widget-slot {
    margin: 0;
}

@media (max-width: 767.98px) {
    .wgt-card__header {
        padding: 0.85rem 0.95rem 0.65rem;
    }

    .wgt-card__body {
        padding: 0.85rem 0.95rem 0.95rem;
    }

    .wgt-product-slide {
        flex-basis: min(85%, 200px);
    }

    .wgt-banner__media {
        aspect-ratio: 16 / 10;
    }
}

/* Homepage section widgets already have their own spacing (mb-5). */
.widget-slot--home .widget {
    margin-bottom: 0;
}
