/*
 * Ajlal Pro - Custom overrides
 * Elementor Pro + Dokan Pro compatibility styles
 *
 * @package Ajlal Pro
 */

/* ============ ELEMENTOR OVERRIDES ============ */
.elementor .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}
.elementor-widget-container .product-card {
    background: var(--bg);
    border-radius: var(--radius);
    overflow: hidden;
}

/* ============ DOKAN DASHBOARD FULLWIDTH ============ */
.dokan-dashboard-fullwidth .content-area {
    max-width: 100%;
    padding: 0;
}
.dokan-dashboard-fullwidth .dokan-dashboard-wrap {
    max-width: 100%;
}

/* ============ DOKAN STORE HEADER ============ */
.dokan-store-header {
    border-radius: var(--radius);
    overflow: hidden;
}
.dokan-store-header .store-banner {
    border-radius: var(--radius);
}

/* ============ WOOCOMMERCE CART SIDEBAR ============ */
.widget_shopping_cart {
    padding: 8px 0;
}
.widget_shopping_cart ul.cart_list {
    max-height: 300px;
    overflow-y: auto;
}
.widget_shopping_cart ul.cart_list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.widget_shopping_cart .total {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    padding: 12px 0;
}
.widget_shopping_cart .buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.widget_shopping_cart .buttons a {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.82rem;
}
.widget_shopping_cart .checkout {
    background: var(--primary);
    color: #fff !important;
}
.widget_shopping_cart .cart {
    border: 1.5px solid var(--primary);
    color: var(--primary) !important;
}

/* ============ CART POPUP - MODERNE & PROFESSIONNEL ============ */
.cart-popup-footer {
    flex: 0 0 auto;
    position: relative;
    z-index: 5;
    min-height: 104px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
}
#cartPanel > .popup-body {
    min-height: 0;
}
.cart-footer-stable {
    display: block;
}
.cart-footer-stable.is-empty .btn-validate-checkout {
    opacity: 0.45;
    pointer-events: none;
    filter: grayscale(0.35);
}
.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 0.95rem;
    color: var(--text);
}
.cart-total strong {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
}
.btn-validate-checkout {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px;
    background: linear-gradient(135deg, #ff8c00, #ffa500);
    color: #fff !important;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(255,140,0,0.25);
    letter-spacing: 0.3px;
}
.btn-validate-checkout:hover {
    background: linear-gradient(135deg, #e67e00, #ff8c00);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255,140,0,0.35);
}
.btn-validate-checkout:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255,140,0,0.2);
}
.cart-empty-msg {
    text-align: center;
    padding: 40px 0;
    color: var(--text2);
    font-size: 0.88rem;
}
.cart-empty-msg::before {
    content: '\1F6D2';
    display: block;
    font-size: 2.5rem;
    margin-bottom: 10px;
    opacity: 0.4;
}

/* Cart popup - MINI CART CUSTOM (images 48px) */
.cart-popup-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.cart-popup-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    align-items: center;
}
.cart-popup-item:last-child {
    border-bottom: none;
}
.cart-popup-item img {
    width: 48px !important;
    height: 48px !important;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.cart-popup-item-info {
    flex: 1;
    min-width: 0;
}
.cart-popup-item-name {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cart-popup-item-qty {
    font-size: 0.72rem;
    color: var(--text2);
    margin-top: 2px;
    display: block;
}
.cart-popup-item-price {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    min-width: 60px;
    text-align: right;
}
.cart-popup-item-remove {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #ccc;
    cursor: pointer;
    padding: 0;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
    line-height: 1;
    text-decoration: none;
}
.cart-popup-item-remove:hover {
    color: #fff;
    background: #e53935;
}

/* Override WooCommerce mini-cart widget styles in popup */
#cartBody .woocommerce-mini-cart-item img,
#cartBody .mini_cart_item img {
    width: 48px !important;
    height: 48px !important;
    border-radius: 8px;
    object-fit: cover;
}
#cartBody .woocommerce-mini-cart .quantity,
#cartBody .woocommerce-mini-cart .woocommerce-Price-amount {
    font-size: 0.78rem;
}
#cartBody .woocommerce-mini-cart .total {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    padding: 10px 0;
    margin-top: 8px;
    border-top: 1px solid var(--border);
}
#cartBody .woocommerce-mini-cart .buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
#cartBody .woocommerce-mini-cart .buttons a {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.82rem;
}
#cartBody .woocommerce-mini-cart .checkout {
    background: var(--primary);
    color: #fff !important;
}
#cartBody .woocommerce-mini-cart .cart {
    border: 1.5px solid var(--primary);
    color: var(--primary) !important;
}

/* ============ VALIDATE ORDER PAGE (Page de validation légère) ============ */
.validate-order-page {
    max-width: 420px;
    margin: 0 auto;
    padding: 20px 16px;
}
.validate-order-page .vo-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    overflow: hidden;
    margin-bottom: 16px;
}
.validate-order-page .vo-header {
    background: linear-gradient(135deg, #ff8c00, #ffa500);
    padding: 20px 16px;
    text-align: center;
    color: #fff;
}
.validate-order-page .vo-header h1 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.validate-order-page .vo-header p {
    font-size: 0.8rem;
    opacity: 0.85;
}
.validate-order-page .vo-body {
    padding: 20px 16px;
}
.validate-order-page .vo-form .vo-field {
    margin-bottom: 16px;
}
.validate-order-page .vo-form .vo-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.validate-order-page .vo-form .vo-field label .vo-required {
    color: #e53935;
}
.validate-order-page .vo-form .vo-field input,
.validate-order-page .vo-form .vo-field select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 0.88rem;
    outline: none;
    background: #f9f9f9;
    transition: all 0.2s;
    box-sizing: border-box;
}
.validate-order-page .vo-form .vo-field input:focus,
.validate-order-page .vo-form .vo-field select:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255,140,0,0.08);
}
.validate-order-page .vo-form .vo-field .vo-icon {
    position: relative;
}
.validate-order-page .vo-form .vo-field .vo-icon input {
    padding-left: 38px;
}
.validate-order-page .vo-form .vo-field .vo-icon .field-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--text2);
    pointer-events: none;
}

/* Order summary in validate page */
.validate-order-page .vo-summary {
    background: #f8fafa;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}
.validate-order-page .vo-summary h3 {
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.validate-order-page .vo-summary .vo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 0.82rem;
}
.validate-order-page .vo-summary .vo-item .vo-item-name {
    color: var(--text);
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.validate-order-page .vo-summary .vo-item .vo-item-qty {
    color: var(--text2);
    margin: 0 10px;
    font-size: 0.75rem;
}
.validate-order-page .vo-summary .vo-item .vo-item-price {
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}
.validate-order-page .vo-summary .vo-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 2px solid var(--border);
    font-size: 1rem;
    font-weight: 700;
}
.validate-order-page .vo-summary .vo-total span {
    color: var(--text);
}
.validate-order-page .vo-summary .vo-total strong {
    color: var(--primary);
    font-size: 1.2rem;
}

/* Validate button */
.validate-order-page .vo-submit {
    display: block;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #ff8c00, #ffa500);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 4px 14px rgba(255,140,0,0.3);
    text-align: center;
    text-decoration: none;
}
.validate-order-page .vo-submit:hover {
    background: linear-gradient(135deg, #e67e00, #ff8c00);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255,140,0,0.4);
}
.validate-order-page .vo-submit:active {
    transform: translateY(0);
}
.validate-order-page .vo-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Messages et liens de la page de validation */
.validate-order-page .vo-error-box {
    margin: 0 0 16px;
    padding: 12px 14px;
    color: #a61b1b;
    background: #fff1f1;
    border: 1px solid #ffd2d2;
    border-radius: 10px;
    font-size: 0.82rem;
    line-height: 1.45;
}
.validate-order-page .vo-error-box p {
    margin: 0 0 4px;
}
.validate-order-page .vo-error-box p:last-child {
    margin-bottom: 0;
}
.validate-order-page .vo-continue-link {
    display: block;
    padding: 10px;
    color: var(--text2);
    font-size: 0.82rem;
    text-align: center;
    text-decoration: none;
}
.validate-order-page .vo-continue-link:hover {
    color: var(--primary);
}
.validate-order-page .vo-home-link {
    margin-top: 20px;
}

/* Success state */
.validate-order-page .vo-success {
    text-align: center;
    padding: 30px 20px;
}
.validate-order-page .vo-success .vo-checkmark {
    width: 60px;
    height: 60px;
    background: #e8f5e9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.8rem;
    color: #4CAF50;
}
.validate-order-page .vo-success h2 {
    color: var(--primary);
    font-size: 1.1rem;
    margin-bottom: 8px;
}
.validate-order-page .vo-success p {
    color: var(--text2);
    font-size: 0.85rem;
}

/* ============ SEARCH ============ */
.header-search input {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.82rem;
    outline: none;
    background: rgba(255,255,255,0.15);
    color: #fff;
}
.header-search input::placeholder {
    color: rgba(255,255,255,0.6);
}

/* ============ MOBILE MENU LIST ============ */
.mobile-menu-list li {
    border-bottom: 1px solid var(--border);
}
.mobile-menu-list li a {
    display: block;
    padding: 14px 0;
    font-size: 0.92rem;
    color: var(--text);
}
.mobile-menu-list li a:hover {
    color: var(--primary);
}

/* ============ PAGINATION ============ */
.woocommerce-pagination {
    text-align: center;
    padding: 16px 0;
}
.woocommerce-pagination .page-numbers {
    display: inline-flex;
    gap: 6px;
}
.woocommerce-pagination .page-numbers a,
.woocommerce-pagination .page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 50%;
    font-size: 0.8rem;
}
.woocommerce-pagination .page-numbers span.current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ============ MY ACCOUNT FORMS ============ */
.woocommerce-MyAccount-content form .form-row {
    margin-bottom: 10px;
}
.woocommerce-MyAccount-content form input[type="text"],
.woocommerce-MyAccount-content form input[type="email"],
.woocommerce-MyAccount-content form input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.88rem;
    outline: none;
    box-sizing: border-box;
}
.woocommerce-MyAccount-content form input:focus {
    border-color: var(--primary);
}
.woocommerce-MyAccount-content form button {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
}

/* ============ CHECKOUT CUSTOM FIELDS ============ */
.woocommerce-checkout #ajlal_custom_fields {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg3);
    border-radius: var(--radius);
}
.woocommerce-checkout #ajlal_custom_fields h3 {
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
}
.woocommerce-checkout #ajlal_custom_fields .form-row input {
    width: 100%;
    padding: 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.88rem;
    outline: none;
    background: #fff;
    transition: border-color 0.2s;
}
.woocommerce-checkout #ajlal_custom_fields .form-row input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(8, 84, 76, 0.1);
}
.woocommerce-checkout #ajlal_custom_fields .form-row label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    display: block;
}

/* ============ NOTICES ============ */
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
    padding: 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    margin-bottom: 12px;
}
.woocommerce-message { background: var(--bg3); color: var(--primary-dark); }
.woocommerce-error { background: #ffebee; color: #c62828; }
.woocommerce-info { background: #e3f2fd; color: #1565c0; }

/* ============ CART AU-DESSUS DU FOOTER MOBILE ============ */
#cartOverlay {
    z-index: 12000;
}
#cartPanel {
    z-index: 12001;
}
body:has(#cartOverlay.active) .mobile-nav {
    visibility: hidden;
    pointer-events: none;
}
@media (max-width: 768px) {
    #cartPanel {
        bottom: 0;
        height: 100dvh;
        max-height: 100dvh;
    }
    #cartFooter {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
}

/* ============ WISHLIST + POPUP CATÉGORIES v1.5 ============ */
.ajlal-popup-empty {
    min-height: 230px;
    padding: 36px 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #64748b;
    text-align: center;
}
.ajlal-popup-empty strong { color: #0f3f38; font-size: 1rem; }
.ajlal-popup-empty-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin-bottom: 6px;
    border-radius: 50%;
    background: #edf8f4;
    color: #087a68;
    font-size: 2rem;
}
.ajlal-popup-loading {
    min-height: 180px;
    display: grid;
    place-items: center;
    color: #64748b;
    font-weight: 700;
}
.ajlal-wishlist-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
}
.ajlal-wishlist-item {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 12px;
    padding: 10px;
    border: 1px solid #e4ece9;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(5, 75, 63, .06);
}
.ajlal-wishlist-thumb,
.ajlal-wishlist-thumb img {
    width: 74px;
    height: 74px;
    border-radius: 11px;
}
.ajlal-wishlist-thumb {
    display: block;
    overflow: hidden;
    background: #f4f7f6;
}
.ajlal-wishlist-thumb img { display: block; object-fit: cover; }
.ajlal-wishlist-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.ajlal-wishlist-name {
    overflow: hidden;
    color: #123c35;
    font-size: .91rem;
    font-weight: 800;
    line-height: 1.35;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ajlal-wishlist-price {
    margin-top: 4px;
    color: #087a68;
    font-size: .9rem;
    font-weight: 800;
}
.ajlal-wishlist-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 7px;
}
.ajlal-wishlist-cart {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border: 0;
    border-radius: 9px;
    background: #087a68;
    color: #fff;
    font: inherit;
    font-size: .78rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}
.ajlal-wishlist-remove {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    margin-inline-start: auto;
    padding: 0;
    border: 1px solid #f0c9c9;
    border-radius: 9px;
    background: #fff5f5;
    color: #c62828;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}
.wishlist-btn.active {
    background: #fff0f1 !important;
    color: #d51f35 !important;
    box-shadow: 0 4px 14px rgba(213, 31, 53, .18);
}
.ajlal-category-panel { width: min(720px, 100vw); }
#categoryBody { padding: 12px; background: #f6faf8; }
.ajlal-category-products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.ajlal-category-products .product-card {
    min-width: 0;
    margin: 0;
    background: #fff;
}
@media (min-width: 700px) {
    .ajlal-category-products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    .ajlal-wishlist-list { padding: 10px; }
    .ajlal-wishlist-item { grid-template-columns: 64px minmax(0, 1fr); }
    .ajlal-wishlist-thumb,
    .ajlal-wishlist-thumb img { width: 64px; height: 64px; }
}

/* Boutons des catégories configurables */
button.cat-item {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}
button.cat-item:focus-visible {
    outline: 3px solid rgba(8, 122, 104, .28);
    outline-offset: 3px;
}
button.cat-item.is-disabled {
    opacity: .45;
    cursor: not-allowed;
}

#wishlistOverlay,
#categoryOverlay { z-index: 12000; }
#wishlistPanel,
#categoryPanel { z-index: 12001; }
body:has(#wishlistOverlay.active) .mobile-nav,
body:has(#categoryOverlay.active) .mobile-nav {
    visibility: hidden;
    pointer-events: none;
}
@media (max-width: 768px) {
    #wishlistPanel,
    #categoryPanel {
        bottom: 0;
        height: 100dvh;
        max-height: 100dvh;
    }
}

/* ============ STORIES VIDÉO AJLAL v1.6 ============ */
.ajlal-stories {
    position: relative;
    padding: 14px 0 12px;
    overflow: hidden;
    border-bottom: 1px solid #e8efed;
    background: #fff;
}
.ajlal-stories-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 11px;
}
.ajlal-stories-heading h2 {
    margin: 0;
    color: #123c35;
    font-size: clamp(.98rem, 3.8vw, 1.15rem);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -.015em;
}
.ajlal-stories-heading > span {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #edf8f4;
    color: #087a68;
    font-size: .68rem;
    font-weight: 800;
    white-space: nowrap;
}
.ajlal-stories-rail {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    margin-inline: -4px;
    padding: 2px 4px 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.ajlal-stories-rail::-webkit-scrollbar { display: none; }
.ajlal-story-trigger {
    width: 72px;
    min-width: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 0;
    scroll-snap-align: start;
    border: 0;
    background: transparent;
    color: #333333;
    font: inherit;
    text-align: center;
    cursor: pointer;
}
.ajlal-story-trigger:focus-visible {
    outline: 3px solid rgba(8, 122, 104, .3);
    outline-offset: 4px;
    border-radius: 12px;
}
.ajlal-story-ring {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    padding: 3px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff8c00 4%, #13a88e 48%, #f5bd46 100%);
    box-shadow: 0 5px 15px rgba(8, 84, 76, .19);
    transition: transform .2s ease, box-shadow .2s ease;
}
.ajlal-story-trigger:hover .ajlal-story-ring {
    transform: translateY(-2px) scale(1.025);
    box-shadow: 0 8px 20px rgba(8, 84, 76, .25);
}
.ajlal-story-thumb {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
    overflow: hidden;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #dcefe9;
}
.ajlal-story-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}
.ajlal-story-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #0b665c, #0a433e);
}
.ajlal-story-placeholder svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}
.ajlal-story-play {
    position: absolute;
    inset-inline-end: -1px;
    bottom: -1px;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #ff8c00;
    color: #fff;
    box-shadow: 0 2px 7px rgba(0, 0, 0, .22);
}
.ajlal-story-play svg {
    width: 11px;
    height: 11px;
    margin-inline-start: 1px;
    fill: currentColor;
}
.ajlal-story-label {
    width: 100%;
    overflow: hidden;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.ajlal-story-open { overflow: hidden; }
.ajlal-story-viewer {
    position: fixed;
    inset: 0;
    z-index: 30000;
    display: grid;
    place-items: center;
    padding: 18px;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease, visibility .22s ease;
}
.ajlal-story-viewer.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}
.ajlal-story-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 18, 16, .92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.ajlal-story-stage {
    position: relative;
    z-index: 1;
    width: min(430px, 100%);
    height: min(820px, calc(100dvh - 36px));
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 22px;
    background: #07110f;
    box-shadow: 0 28px 75px rgba(0, 0, 0, .52);
    transform: translateY(14px) scale(.985);
    transition: transform .26s cubic-bezier(.2, .75, .3, 1);
}
.ajlal-story-viewer.active .ajlal-story-stage {
    transform: translateY(0) scale(1);
}
.ajlal-story-progress {
    position: absolute;
    z-index: 8;
    top: max(11px, env(safe-area-inset-top));
    inset-inline: 12px;
    display: flex;
    gap: 4px;
}
.ajlal-story-progress > span {
    height: 3px;
    flex: 1 1 0;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .37);
}
.ajlal-story-progress i {
    width: 0;
    height: 100%;
    display: block;
    border-radius: inherit;
    background: #fff;
    box-shadow: 0 0 5px rgba(255, 255, 255, .35);
}
.ajlal-story-topbar {
    position: absolute;
    z-index: 8;
    top: max(24px, calc(env(safe-area-inset-top) + 13px));
    inset-inline: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #fff;
}
.ajlal-story-brand {
    min-width: 0;
    display: grid;
    grid-template-columns: 34px minmax(0, auto);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 9px;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .45));
}
.ajlal-story-brandmark {
    width: 34px;
    height: 34px;
    grid-row: 1 / 3;
    display: grid;
    place-items: center;
    border: 2px solid rgba(255, 255, 255, .88);
    border-radius: 50%;
    background: #ff8c00;
    color: #fff;
    font-family: Georgia, serif;
    font-size: 1rem;
    font-weight: 800;
}
.ajlal-story-brand strong {
    max-width: 210px;
    overflow: hidden;
    font-size: .82rem;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ajlal-story-brand small {
    color: rgba(255, 255, 255, .76);
    font-size: .65rem;
    font-weight: 700;
}
.ajlal-story-tools {
    display: flex;
    align-items: center;
    gap: 4px;
}
.ajlal-story-sound,
.ajlal-story-close {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .22);
    color: #fff;
    font: inherit;
    cursor: pointer;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}
.ajlal-story-close { font-size: 1.85rem; font-weight: 300; line-height: 1; }
.ajlal-story-sound svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.ajlal-story-sound .sound-on { display: none; }
.ajlal-story-sound.is-unmuted .sound-on { display: block; }
.ajlal-story-sound.is-unmuted .sound-off { display: none; }
.ajlal-story-media {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: #07110f;
}
.ajlal-story-media::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(0, 0, 0, .42) 0, transparent 21%, transparent 77%, rgba(0, 0, 0, .2) 100%);
}
.ajlal-story-media video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    background: #07110f;
    cursor: pointer;
}
.ajlal-story-pause-state {
    position: absolute;
    z-index: 7;
    width: 72px;
    height: 72px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 50%;
    background: rgba(0, 0, 0, .48);
    color: #fff;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
}
.ajlal-story-pause-state:not([hidden]) { display: grid; }
.ajlal-story-pause-state svg {
    width: 31px;
    height: 31px;
    margin-inline-start: 4px;
    fill: currentColor;
}
.ajlal-story-nav {
    position: absolute;
    z-index: 6;
    top: 23%;
    bottom: 16%;
    width: 25%;
    display: flex;
    align-items: center;
    padding: 0 10px;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, .88);
    cursor: pointer;
}
.ajlal-story-nav svg {
    width: 33px;
    height: 33px;
    padding: 7px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .25);
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
}
.ajlal-story-nav:hover svg,
.ajlal-story-nav:focus-visible svg { opacity: 1; }
.ajlal-story-prev { inset-inline-start: 0; justify-content: flex-start; }
.ajlal-story-next { inset-inline-end: 0; justify-content: flex-end; }
.ajlal-story-nav[disabled] { cursor: default; opacity: .3; }
.ajlal-story-sound:focus-visible,
.ajlal-story-close:focus-visible,
.ajlal-story-nav:focus-visible,
.ajlal-story-pause-state:focus-visible {
    outline: 3px solid rgba(255, 255, 255, .92);
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .ajlal-stories { padding-block: 12px 9px; }
    .ajlal-story-viewer { padding: 0; }
    .ajlal-story-stage {
        width: 100%;
        height: 100dvh;
        max-height: none;
        border: 0;
        border-radius: 0;
    }
    .ajlal-story-nav svg { opacity: .78; }
    .ajlal-story-nav { width: 20%; }
}
@media (min-width: 769px) {
    .ajlal-stories-rail { gap: 18px; }
    .ajlal-story-trigger { width: 80px; min-width: 80px; }
    .ajlal-story-ring { width: 74px; height: 74px; }
}
@media (prefers-reduced-motion: reduce) {
    .ajlal-story-ring,
    .ajlal-story-viewer,
    .ajlal-story-stage,
    .ajlal-story-nav svg { transition: none !important; }
}

/* Confirmation locale pour les ajouts multiples du popup catégorie */
#categoryPanel .add-cart-btn.ajlal-add-confirmed,
#categoryPanel .add-cart-btn.ajlal-add-confirmed:hover {
    background: #168a62 !important;
    color: #fff !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 5px 14px rgba(22, 138, 98, .2);
}
