/**
 * UX Enhancements CSS
 * تحسينات تجربة المستخدم لقالب Hozi
 * @version 1.0.0
 */

/* ==========================================================================
   1. SKELETON LOADING - تحميل هيكلي
   ========================================================================== */

/* Skeleton Base Styles */
.skeleton-loading {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Skeleton for Shipping Price */
.skeleton-shipping-price {
    display: inline-block;
    width: 60px;
    height: 20px;
    vertical-align: middle;
}

/* Skeleton for City Select */
.skeleton-city-select {
    width: 100%;
    height: 45px;
    border-radius: 8px;
}

/* Skeleton for Shipping Methods */
.skeleton-shipping-methods {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 0;
}

.skeleton-shipping-method {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.skeleton-radio {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.skeleton-text {
    height: 16px;
    flex: 1;
    max-width: 150px;
}

.skeleton-price {
    width: 50px;
    height: 16px;
}

/* Hide original spinner when skeleton is shown */
.hozi-skeleton-active #codplugin_gif {
    display: none !important;
}

/* ==========================================================================
   2. TOAST NOTIFICATIONS - إشعارات التنبيه
   ========================================================================== */

/* Toast Container */
.hozi-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
    pointer-events: none;
}

/* RTL Support */
html[dir="rtl"] .hozi-toast-container,
body.rtl .hozi-toast-container {
    right: auto;
    left: 20px;
}

/* Individual Toast */
.hozi-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
    border-right: 4px solid transparent;
    min-width: 280px;
    backdrop-filter: blur(10px);
}

html[dir="rtl"] .hozi-toast,
body.rtl .hozi-toast {
    transform: translateX(-120%);
    border-right: none;
    border-left: 4px solid transparent;
}

.hozi-toast.show {
    transform: translateX(0);
    opacity: 1;
}

/* Toast Icon */
.hozi-toast-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    font-size: 14px;
}

/* Toast Content */
.hozi-toast-content {
    flex: 1;
}

.hozi-toast-title {
    font-weight: 600;
    font-size: 14px;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.hozi-toast-message {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.4;
}

/* Toast Close Button */
.hozi-toast-close {
    background: none;
    border: none;
    color: #adb5bd;
    cursor: pointer;
    padding: 0;
    font-size: 18px;
    line-height: 1;
    transition: color 0.2s ease;
    margin-right: -8px;
}

.hozi-toast-close:hover {
    color: #495057;
}

/* Toast Types */
.hozi-toast.success {
    border-right-color: #28a745;
}

.hozi-toast.success .hozi-toast-icon {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.hozi-toast.error {
    border-right-color: #dc3545;
}

.hozi-toast.error .hozi-toast-icon {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
    color: white;
}

.hozi-toast.warning {
    border-right-color: #ffc107;
}

.hozi-toast.warning .hozi-toast-icon {
    background: linear-gradient(135deg, #ffc107, #ffb300);
    color: #1a1a2e;
}

.hozi-toast.info {
    border-right-color: #17a2b8;
}

.hozi-toast.info .hozi-toast-icon {
    background: linear-gradient(135deg, #17a2b8, #0dcaf0);
    color: white;
}

/* RTL Toast Border */
html[dir="rtl"] .hozi-toast.success,
body.rtl .hozi-toast.success {
    border-left-color: #28a745;
}

html[dir="rtl"] .hozi-toast.error,
body.rtl .hozi-toast.error {
    border-left-color: #dc3545;
}

html[dir="rtl"] .hozi-toast.warning,
body.rtl .hozi-toast.warning {
    border-left-color: #ffc107;
}

html[dir="rtl"] .hozi-toast.info,
body.rtl .hozi-toast.info {
    border-left-color: #17a2b8;
}

/* Toast Progress Bar */
.hozi-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.hozi-toast-progress-bar {
    height: 100%;
    background: currentColor;
    animation: toast-progress 5s linear forwards;
}

@keyframes toast-progress {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* ==========================================================================
   3. ENHANCED ERROR MESSAGES - رسائل خطأ محسنة
   ========================================================================== */

/* WooCommerce Notice Override */
.woocommerce-notices-wrapper {
    margin-bottom: 20px;
}

.woocommerce-error,
.woocommerce-message,
.woocommerce-info {
    padding: 16px 20px !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important;
    margin-bottom: 15px !important;
    animation: notice-slide-in 0.4s ease-out !important;
}

@keyframes notice-slide-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.woocommerce-error {
    background: linear-gradient(135deg, #fff5f5, #ffe6e6) !important;
    color: #c53030 !important;
    border-right: 4px solid #dc3545 !important;
}

.woocommerce-error::before {
    content: "⚠️" !important;
    font-size: 20px !important;
    margin: 0 !important;
    background: none !important;
}

.woocommerce-message {
    background: linear-gradient(135deg, #f0fff4, #e6ffed) !important;
    color: #22543d !important;
    border-right: 4px solid #28a745 !important;
}

.woocommerce-message::before {
    content: "✅" !important;
    font-size: 20px !important;
    margin: 0 !important;
    background: none !important;
}

.woocommerce-info {
    background: linear-gradient(135deg, #ebf8ff, #e1f5fe) !important;
    color: #2b6cb0 !important;
    border-right: 4px solid #17a2b8 !important;
}

.woocommerce-info::before {
    content: "ℹ️" !important;
    font-size: 20px !important;
    margin: 0 !important;
    background: none !important;
}

/* RTL Support for notices */
html[dir="rtl"] .woocommerce-error,
html[dir="rtl"] .woocommerce-message,
html[dir="rtl"] .woocommerce-info {
    border-right: none !important;
    border-left: 4px solid !important;
}

html[dir="rtl"] .woocommerce-error {
    border-left-color: #dc3545 !important;
}

html[dir="rtl"] .woocommerce-message {
    border-left-color: #28a745 !important;
}

html[dir="rtl"] .woocommerce-info {
    border-left-color: #17a2b8 !important;
}

/* Custom Form Error Styling */
.codplugin-field-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15) !important;
    animation: shake 0.5s ease-in-out !important;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-5px);
    }

    40%,
    80% {
        transform: translateX(5px);
    }
}

.codplugin-error-message {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    animation: fade-in 0.3s ease;
}

.codplugin-error-message::before {
    content: "⚠";
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ==========================================================================
   4. SEARCHABLE STATE SELECT - بحث الولايات
   ========================================================================== */

/* State Search Container */
.hozi-state-search-container {
    position: relative;
    width: 100%;
}

/* Search Input */
.hozi-state-search-input {
    width: 100%;
    padding: 14px 45px 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
    cursor: pointer;
}

html[dir="rtl"] .hozi-state-search-input {
    padding: 14px 16px 14px 45px;
}

.hozi-state-search-input:focus {
    outline: none;
    border-color: var(--hozi-primary, #007AFF);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.hozi-state-search-input::placeholder {
    color: #a0aec0;
}

/* Search Icon */
.hozi-state-search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    pointer-events: none;
    transition: color 0.3s;
}

html[dir="rtl"] .hozi-state-search-icon {
    right: auto;
    left: 16px;
}

.hozi-state-search-container:focus-within .hozi-state-search-icon {
    color: var(--hozi-primary, #007AFF);
}

/* Input Wrapper */
.hozi-state-input-wrapper {
    position: relative;
    width: 100%;
}

/* Clear Button - Small and elegant */
.hozi-state-clear-btn {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    color: #94a3b8;
    transition: all 0.2s ease;
    z-index: 5;
    padding: 0;
    line-height: 1;
}

html[dir="rtl"] .hozi-state-clear-btn {
    left: auto;
    right: 12px;
}

.hozi-state-clear-btn:hover {
    background: #fee2e2;
    color: #dc2626;
    transform: translateY(-50%) scale(1.1);
}

/* Dropdown Header */
.hozi-state-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-bottom: 1px solid #e2e8f0;
    border-radius: 10px 10px 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.hozi-dropdown-title {
    font-weight: 600;
    font-size: 14px;
    color: #1a1a2e;
}

/* Close Button */
.hozi-state-close-btn {
    background: #e2e8f0;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    color: #64748b;
    transition: all 0.2s ease;
}

.hozi-state-close-btn:hover {
    background: #dc3545;
    color: #fff;
    transform: scale(1.1);
}

/* Dropdown */
.hozi-state-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    max-height: 300px;
    overflow-y: auto;
    z-index: 2147483647 !important;
    /* Maximum possible z-index */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

/* Parent container needs position relative and high z-index */
.hozi-state-search-container {
    position: relative !important;
    z-index: 2147483646 !important;
    /* Very high z-index */
}

/* When dropdown is open, add body class for stacking context fix */
body.hozi-dropdown-open .hozi-state-search-container {
    z-index: 2147483647 !important;
}

/* Lower z-index for ALL elements that might interfere when dropdown is open */
body.hozi-dropdown-open #codplugin-checkout>*,
body.hozi-dropdown-open #codplugin_woo_single_form>*,
body.hozi-dropdown-open .shipping-row,
body.hozi-dropdown-open .codplugin-shipping-option,
body.hozi-dropdown-open #shipping-methods,
body.hozi-dropdown-open #shipping-methods *,
body.hozi-dropdown-open .codplugin-shipping-input,
body.hozi-dropdown-open .codplugin-shipping-label,
body.hozi-dropdown-open .codplugin-price-row,
body.hozi-dropdown-open .codplugin-submit-row,
body.hozi-dropdown-open #nrwooconfirm,
body.hozi-dropdown-open .form-qte,
body.hozi-dropdown-open .woocommerce-variation-add-to-cart,
body.hozi-dropdown-open .variations_form,
body.hozi-dropdown-open .codplugin-checkout-title,
body.hozi-dropdown-open table,
body.hozi-dropdown-open .product-image,
body.hozi-dropdown-open .woocommerce-product-gallery,
body.hozi-dropdown-open .type-product,
body.hozi-dropdown-open .summary,
body.hozi-dropdown-open .entry-summary,
body.hozi-dropdown-open .atc-buy-button,
body.hozi-dropdown-open .sticky-atc-bar,
body.hozi-dropdown-open .codplugin_order_history,
body.hozi-dropdown-open #codplugin_order_history,
body.hozi-dropdown-open #codplugin_show_hide,
body.hozi-dropdown-open .button,
body.hozi-dropdown-open input[type="submit"],
body.hozi-dropdown-open .whatsapp-order-btn,
body.hozi-dropdown-open #codplugin_d_price,
body.hozi-dropdown-open .codplugin-dynamic-shipping,
body.hozi-dropdown-open label[for*="shipping"],
body.hozi-dropdown-open input[name="shipping_method"],
body.hozi-dropdown-open .codplugin-checkout-shipping {
    z-index: 1 !important;
    position: relative;
}

/* But keep the search container on top */
body.hozi-dropdown-open .hozi-state-search-container,
body.hozi-dropdown-open .hozi-state-search-container *,
body.hozi-dropdown-open .hozi-state-dropdown,
body.hozi-dropdown-open .hozi-state-dropdown * {
    z-index: 2147483647 !important;
}

/* Ensure dropdown options are clickable */
body.hozi-dropdown-open .hozi-state-option {
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 2147483647 !important;
}

/* Make sure parent containers don't clip the dropdown */
body.hozi-dropdown-open #codplugin-checkout,
body.hozi-dropdown-open #codplugin_woo_single_form,
body.hozi-dropdown-open .form-row,
body.hozi-dropdown-open .hozi-state-input-wrapper {
    overflow: visible !important;
}

/* Universal rule: lower z-index for EVERYTHING except the dropdown when open */
body.hozi-dropdown-open *:not(.hozi-state-search-container):not(.hozi-state-dropdown):not(.hozi-state-option):not(.hozi-state-input-wrapper):not(.hozi-state-search-input):not(.hozi-state-dropdown-header):not(.hozi-dropdown-title):not(.hozi-state-close-btn):not(.hozi-state-clear-btn):not(.hozi-state-search-icon):not(.hozi-state-option-icon) {
    z-index: auto !important;
}

/* Make sure the dropdown container has isolation */
.hozi-state-search-container {
    isolation: isolate;
}

/* Force the dropdown to be on top of everything */
.hozi-state-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown Items */
.hozi-state-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.hozi-state-option:last-child {
    border-bottom: none;
}

.hozi-state-option:hover,
.hozi-state-option.highlighted {
    background: linear-gradient(135deg, #f0f7ff, #e8f4ff);
}

.hozi-state-option.selected {
    background: var(--hozi-primary, #007AFF);
    color: white;
}

.hozi-state-option-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 122, 255, 0.1);
    border-radius: 6px;
    font-size: 12px;
}

.hozi-state-option.selected .hozi-state-option-icon {
    background: rgba(255, 255, 255, 0.2);
}

/* No Results */
.hozi-state-no-results {
    padding: 20px;
    text-align: center;
    color: #718096;
    font-size: 14px;
}

.hozi-state-no-results::before {
    content: "🔍";
    display: block;
    font-size: 24px;
    margin-bottom: 8px;
}

/* ==========================================================================
   5. MICRO-ANIMATIONS - رسوم متحركة صغيرة
   ========================================================================== */

/* Button Hover Effects */
#nrwooconfirm,
.codplugin-submit-btn,
button[type="submit"],
.button,
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#nrwooconfirm:hover,
.codplugin-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 122, 255, 0.3);
}

#nrwooconfirm:active,
.codplugin-submit-btn:active {
    transform: translateY(0);
}

/* Ripple Effect */
.hozi-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple-effect 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-effect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Quantity Buttons Animation */
#codplugin_add_button,
#codplugin_remove_button {
    transition: all 0.2s ease !important;
}

#codplugin_add_button:hover,
#codplugin_remove_button:hover {
    transform: scale(1.1);
}

#codplugin_add_button:active,
#codplugin_remove_button:active {
    transform: scale(0.95);
}

/* Count Animation */
#codplugin_count_button {
    transition: all 0.2s ease;
}

.count-changing {
    animation: count-pop 0.3s ease;
}

@keyframes count-pop {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }
}

/* Input Focus Animation */
#codplugin-checkout input:not([type="hidden"]):not([type="submit"]):not([type="radio"]):not([type="checkbox"]),
#codplugin-checkout select,
#codplugin-checkout textarea {
    transition: all 0.3s ease !important;
}

#codplugin-checkout input:not([type="hidden"]):not([type="submit"]):not([type="radio"]):not([type="checkbox"]):focus,
#codplugin-checkout select:focus,
#codplugin-checkout textarea:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.15) !important;
}

/* Card/Product Animation */
.product-item,
.item-product {
    transition: all 0.3s ease;
}

.product-item:hover,
.item-product:hover {
    transform: translateY(-5px);
}

/* ==========================================================================
   6. PROGRESS STEPS - خطوات الشراء
   ========================================================================== */

/* Progress Container */
.hozi-checkout-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 16px;
    position: relative;
}

/* Progress Line */
.hozi-progress-line {
    position: absolute;
    top: 50%;
    left: 60px;
    right: 60px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    z-index: 1;
}

.hozi-progress-line-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--hozi-primary, #007AFF), var(--hozi-secondary, #5856D6));
    border-radius: 2px;
    transition: width 0.5s ease;
    width: 0%;
}

/* Progress Step */
.hozi-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 2;
    position: relative;
}

/* Step Circle */
.hozi-progress-step-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #a0aec0;
    transition: all 0.4s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.hozi-progress-step.active .hozi-progress-step-circle {
    border-color: var(--hozi-primary, #007AFF);
    background: linear-gradient(135deg, var(--hozi-primary, #007AFF), var(--hozi-secondary, #5856D6));
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(0, 122, 255, 0.3);
}

.hozi-progress-step.completed .hozi-progress-step-circle {
    border-color: #28a745;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.hozi-progress-step.completed .hozi-progress-step-circle::after {
    content: "✓";
    font-weight: bold;
}

/* Step Label */
.hozi-progress-step-label {
    font-size: 12px;
    font-weight: 600;
    color: #718096;
    text-align: center;
    max-width: 80px;
    transition: color 0.3s ease;
}

.hozi-progress-step.active .hozi-progress-step-label {
    color: var(--hozi-primary, #007AFF);
}

.hozi-progress-step.completed .hozi-progress-step-label {
    color: #28a745;
}

/* Mobile Responsive */
@media (max-width: 576px) {
    .hozi-checkout-progress {
        padding: 15px 10px;
    }

    .hozi-progress-step-circle {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .hozi-progress-step-label {
        font-size: 10px;
        max-width: 60px;
    }

    .hozi-progress-line {
        left: 40px;
        right: 40px;
    }

    .hozi-toast-container {
        left: 10px;
        right: 10px;
        max-width: none;
    }

    .hozi-toast {
        min-width: auto;
    }
}

/* ==========================================================================
   7. LOADING STATES - حالات التحميل
   ========================================================================== */

/* Button Loading State */
.hozi-btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.hozi-btn-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: btn-spinner 0.8s linear infinite;
}

@keyframes btn-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Pulse Animation */
.hozi-pulse {
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Success Checkmark Animation */
.hozi-success-checkmark {
    width: 56px;
    height: 56px;
    margin: 0 auto;
}

.hozi-success-checkmark svg {
    width: 100%;
    height: 100%;
}

.hozi-success-checkmark .circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.hozi-success-checkmark .check {
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

/* ==========================================================================
   8. VISIBILITY & LAYOUT FIXES - إصلاحات العرض والتخطيط
   ========================================================================== */

/* 1. Fix Single Product Title & Content overlapping Header */
/* Add spacing for desktop and responsive views */
.single-product .product-summary-wrap,
.single-product .entry-summary,
.single-product .summary,
body.single-product .content-area,
.single-product .site-main {
    padding-top: 100px !important;
    position: relative;
    z-index: 5;
}

/* Ensure Title is Visible and clearly listed */
.product_title.entry-title,
h1.product_title {
    clear: both;
    display: block;
    margin-top: 20px !important;
    margin-bottom: 15px !important;
    line-height: 1.3;
    position: relative;
    z-index: 5;
    visibility: visible !important;
    padding-top: 10px;
}

/* 2. Fix Price Display & Spacing */
.product .price,
.single-product .price {
    margin-bottom: 20px !important;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 5;
    position: relative;
    height: auto !important;
}

/* Ensure price text doesn't overlap old price */
.price del,
.price ins {
    display: inline-block;
}

/* 3. Remove Unwanted Scrollbars from Product Lists */
/* Force containers to expand instead of scrolling */
.products,
.ul.products,
.product-category-list,
.widget_products,
.elementor-widget-products,
.elementor-widget-container,
.shop-page-content .products {
    overflow: visible !important;
    overflow-y: visible !important;
    max-height: none !important;
    height: auto !important;
}

/* Specific fix for grid containers that might have fixed heights */
.product-grid-container,
.archive-products,
.related.products,
.upsells.products {
    overflow: hidden;
    /* Clear floats but don't scroll */
    overflow-y: visible !important;
    height: auto !important;
}

/* Global scrollbar fix for body content areas */
body.archive .site-content,
body.post-type-archive-product .site-content {
    overflow: visible !important;
    height: auto !important;
}