/*
 * Direct Form Checkout - Shopify-Inspired Styles
 * Clean, stable, mobile-first checkout form
 */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap');

:root {
    --dfc-primary: #2c6ecb;
    --dfc-primary-dark: #1e5296;
    --dfc-success: #2cb67d;
    --dfc-success-light: #e6f7f1;
    --dfc-error: #d82c0d;
    --dfc-error-light: #fdecea;
    --dfc-border: #d1d5db;
    --dfc-text: #202223;
    --dfc-muted: #6d7175;
    --dfc-bg-main: #ffffff;
    --dfc-bg-section: #fafbfc;
    --dfc-radius: 6px;
    --dfc-radius-sm: 4px;
    --dfc-radius-lg: 12px;
    --dfc-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --dfc-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Sticky Floating Order Button */
.dfc-sticky-order-btn {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: #fff !important;
    border: none !important;
    border-top: 1px solid var(--dfc-border) !important;
    border-radius: 0 !important;
    padding: 10px 16px !important;
    box-shadow: none !important;
    z-index: 9999 !important;
    animation: slideUpFull 0.3s ease-out !important;
}

.dfc-sticky-order-btn-inner {
    display: flex !important;
    width: 100% !important;
    max-width: 680px !important;
    margin: 0 auto !important;
    border: none !important;
    border-radius: var(--dfc-radius) !important;
    padding: 14px 20px !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    background: var(--dfc-primary) !important;
    color: #fff !important;
    cursor: pointer !important;
    text-align: center !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1) !important;
    font-family: 'Cairo', sans-serif !important;
    direction: rtl !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    min-height: 50px !important;
    position: relative !important;
    overflow: hidden !important;
}

.dfc-sticky-order-btn-inner::before {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 0 !important;
    height: 0 !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.2) !important;
    transform: translate(-50%, -50%) !important;
    transition: width 0.6s ease, height 0.6s ease !important;
}

.dfc-sticky-order-btn-inner:hover::before {
    width: 400px !important;
    height: 400px !important;
}

.dfc-sticky-order-btn-inner:hover {
    background: var(--dfc-primary-dark) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15) !important;
}

.dfc-sticky-order-btn-inner:active {
    transform: translateY(0) !important;
    box-shadow: 0 -1px 6px rgba(0, 0, 0, 0.1) !important;
}

.dfc-sticky-order-btn-inner svg {
    width: 18px !important;
    height: 18px !important;
    display: block !important;
    order: 2 !important;
}

.dfc-sticky-order-btn-inner span {
    order: 1 !important;
}

@keyframes slideUpFull {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bounce Animation Keyframes */
@keyframes bounce {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(0.9);
    }
    50% {
        transform: scale(1.1);
    }
    75% {
        transform: scale(0.95);
    }
}

@keyframes checkboxBounce {
    0% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.25);
    }
    60% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

.direct-form-checkout-wrapper {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--dfc-text);
    background: var(--dfc-bg-main);
    border-radius: var(--dfc-radius);
    border: 1px solid var(--dfc-border);
    padding: 12px !important;
    margin: 0 !important;
    box-shadow: none !important;
    max-width: 680px !important;
    box-sizing: border-box !important;
    direction: rtl !important;
    text-align: right !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Force RTL for all elements inside wrapper */
.direct-form-checkout-wrapper *,
.direct-form-checkout-wrapper label,
.direct-form-checkout-wrapper input,
.direct-form-checkout-wrapper select,
.direct-form-checkout-wrapper textarea,
.direct-form-checkout-wrapper span,
.direct-form-checkout-wrapper div,
.direct-form-checkout-wrapper p,
.direct-form-checkout-wrapper h1,
.direct-form-checkout-wrapper h2,
.direct-form-checkout-wrapper h3,
.direct-form-checkout-wrapper h4 {
    direction: rtl !important;
    text-align: right !important;
}

.dfc-form {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

.dfc-title {
    margin: 0 0 8px 0 !important;
    font-family: 'Cairo', sans-serif !important;
    font-size: 1.4rem !important;
    font-weight: 600 !important;
    color: var(--dfc-text) !important;
    text-align: right !important;
    direction: rtl !important;
}

.dfc-messages {
    min-height: 0 !important;
}

.dfc-notice {
    border-radius: var(--dfc-radius) !important;
    padding: 10px 14px !important;
    margin-bottom: 10px !important;
    font-family: 'Cairo', sans-serif !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    font-size: 0.9rem !important;
}

.dfc-notice-info {
    background: #e0f2fe !important;
    color: #075985 !important;
    border: 1px solid #7dd3fc !important;
}

.dfc-notice-success {
    background: #d1fae5 !important;
    color: #065f46 !important;
    border: 1px solid #6ee7b7 !important;
}

.dfc-notice-error {
    background: #fee2e2 !important;
    color: #991b1b !important;
    border: 1px solid #fca5a5 !important;
}

.dfc-bundles-section {
    background: var(--dfc-bg-section) !important;
    border-radius: var(--dfc-radius) !important;
    padding: 10px !important;
    border: 1px solid var(--dfc-border) !important;
    margin-bottom: 10px !important;
}

.dfc-bundles-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 12px !important;
    margin-bottom: 8px !important;
}

.dfc-bundles-section h3 {
    margin: 0 !important;
    font-family: 'Cairo', sans-serif !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: var(--dfc-text) !important;
    text-align: right !important;
    direction: rtl !important;
}

.dfc-clear-bundle {
    border: none !important;
    background: transparent !important;
    color: var(--dfc-primary) !important;
    padding: 4px 8px !important;
    border-radius: var(--dfc-radius-sm) !important;
    font-family: 'Cairo', sans-serif !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    text-decoration: underline !important;
}

.dfc-clear-bundle:hover,
.dfc-clear-bundle:focus {
    color: var(--dfc-primary-dark) !important;
}

.dfc-clear-bundle[hidden] {
    display: none !important;
}

.dfc-bundles-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

.dfc-bundle-option {
    display: flex !important;
    gap: 10px !important;
    padding: 6px !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 8px !important;
    background: #fff !important;
    cursor: pointer !important;
    transition: none !important;
    align-items: center !important;
    margin-bottom: 8px !important;
}

.dfc-bundle-option:hover {
    border-color: #c7d7e8 !important;
}

.dfc-bundle-option.selected {
    border-color: #2196F3 !important;
    background: #E3F2FD !important;
}

.dfc-bundle-option.loading {
    opacity: 0.5 !important;
    pointer-events: none !important;
}

.dfc-bundle-option input[type="checkbox"] {
    display: none !important;
}

.dfc-bundle-checkbox {
    display: none !important;
}

.dfc-bundle-content {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 12px !important;
    flex: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

.bundle-image {
    flex-shrink: 0 !important;
    width: 150px !important;
    height: 90px !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%) !important;
}

.bundle-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

.bundle-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    flex: 1 !important;
    min-width: 0 !important;
    justify-content: center !important;
}

.bundle-title {
    color: #000 !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    max-width: 100% !important;
    width: 100% !important;
    text-shadow: none !important;
    font-family: 'Cairo', sans-serif !important;
}

.bundle-price {
    font-weight: 700 !important;
    color: #1a1a1a !important;
    font-size: 1.3rem !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    text-align: left !important;
}

.bundle-original-price {
    font-family: 'Cairo', sans-serif !important;
    font-size: 0.9rem !important;
    color: #999 !important;
    text-decoration: line-through !important;
    font-weight: 400 !important;
}

.bundle-badge {
    display: inline-flex !important;
    align-items: center !important;
    background: #c3170d !important;
    color: #fff !important;
    padding: 4px 10px !important;
    border-radius: 6px !important;
    font-family: 'Cairo', sans-serif !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    width: fit-content !important;
}

.bundle-badge.best-value {
    background: #4CAF50 !important;
}

.bundle-price-wrapper {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
}

.bundle-badge.popular {
    background: #FF9800 !important;
}

/* Bundle Summary Box */
.dfc-bundle-summary {
    background: #f5f5f5 !important;
    border-radius: 8px !important;
    padding: 12px !important;
    margin-top: 16px !important;
    display: none;
}

.dfc-bundle-summary-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 6px 0 !important;
    font-family: 'Cairo', sans-serif !important;
    font-size: 1rem !important;
    font-weight: 400 !important;
    color: #1a1a1a !important;
}

.dfc-bundle-summary-row.dfc-discount-row {
    border-bottom: 1px solid #ddd !important;
    padding-bottom: 12px !important;
    margin-bottom: 8px !important;
}

.dfc-bundle-summary-row .discount-label-bundle {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.dfc-bundle-summary-row .discount-value {
    color: #d32f2f !important;
    font-weight: 700 !important;
}

.dfc-bundle-summary-total {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding-top: 6px !important;
    font-family: 'Cairo', sans-serif !important;
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
}

.bundle-products {
    display: none !important;
}

.bundle-product-item {
    display: none !important;
}

.dfc-order-info-text {
    margin-top: 12px !important;
    padding: 12px !important;
    background: #f0f9ff !important;
    border-radius: 8px !important;
    color: #1a1a1a !important;
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
    text-align: center !important;
    font-weight: 500 !important;
    border: 1px solid #bfdbfe !important;
    font-family: 'Cairo', sans-serif !important;
}

.dfc-product-section {
    background: var(--dfc-bg-section) !important;
    border-radius: var(--dfc-radius) !important;
    padding: 12px !important;
    border: 1px solid var(--dfc-border) !important;
    margin-bottom: 12px !important;
}

.dfc-product-section h3 {
    margin: 0 0 8px 0 !important;
    font-family: 'Cairo', sans-serif !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: var(--dfc-text) !important;
    text-align: right !important;
    direction: rtl !important;
}

.dfc-product-info {
    display: grid !important;
    grid-template-columns: 90px 1fr !important;
    gap: 14px !important;
    align-items: start !important;
}

.dfc-product-info .product-image {
    width: 90px !important;
    height: 90px !important;
    overflow: hidden !important;
    border-radius: var(--dfc-radius) !important;
    background: #fff !important;
}

.dfc-product-info .product-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: var(--dfc-radius) !important;
    border: 1px solid var(--dfc-border) !important;
}

.product-details {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

.product-title {
    margin: 0 !important;
    font-family: 'Cairo', sans-serif !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: var(--dfc-text) !important;
    line-height: 1.4 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
    width: 100% !important;
}

.product-price {
    font-family: 'Cairo', sans-serif !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: var(--dfc-text) !important;
}

.product-quantity {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.product-quantity label {
    font-family: 'Cairo', sans-serif !important;
    font-weight: 500 !important;
    font-size: 0.9rem !important;
    margin: 0 !important;
    color: var(--dfc-text) !important;
}

.dfc-qty-input {
    width: 80px !important;
    border-radius: var(--dfc-radius) !important;
    border: 1px solid var(--dfc-border) !important;
    padding: 8px 10px !important;
    font-family: 'Cairo', sans-serif !important;
    font-size: 1rem !important;
    font-weight: 400 !important;
    text-align: center !important;
    background: #fff !important;
    box-sizing: border-box !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

.dfc-qty-input:focus {
    border-color: var(--dfc-primary) !important;
    outline: none !important;
    box-shadow: none !important;
}

/* FORM INPUTS - CRITICAL STYLES */
.dfc-form-group {
    display: block !important;
    margin-bottom: 8px !important;
    clear: both !important;
    width: 100% !important;
}

.dfc-form-group label {
    display: block !important;
    font-family: 'Cairo', sans-serif !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    margin-bottom: 4px !important;
    color: var(--dfc-text) !important;
    text-align: left !important;
    direction: ltr !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Input wrapper for validation icon */
.dfc-input-wrapper {
    position: relative !important;
    display: block !important;
    width: 100% !important;
}

.dfc-input-wrapper .dfc-input {
    padding-left: 40px !important;
}

/* Validation icon container */
.dfc-validation-icon {
    position: absolute !important;
    left: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 20px !important;
    height: 20px !important;
    display: none !important;
    pointer-events: none !important;
    z-index: 10 !important;
}

.dfc-validation-icon svg {
    width: 20px !important;
    height: 20px !important;
    display: block !important;
}

.dfc-validation-icon .dfc-icon-valid {
    color: var(--dfc-success) !important;
    display: none !important;
}

/* Show validation icon only when input is valid */
.dfc-input-wrapper .dfc-input.is-valid ~ .dfc-validation-icon {
    display: block !important;
}

.dfc-input-wrapper .dfc-input.is-valid ~ .dfc-validation-icon .dfc-icon-valid {
    display: block !important;
}

/* Border color changes for validation states */
.dfc-input-wrapper .dfc-input.is-valid,
.dfc-input-wrapper input.dfc-input.is-valid,
#direct-checkout-form .dfc-input-wrapper .dfc-input.is-valid,
input#dfc-phone.is-valid {
    border-color: var(--dfc-success) !important;
    background-color: var(--dfc-success-light) !important;
}

.dfc-input-wrapper .dfc-input.is-invalid,
.dfc-input-wrapper input.dfc-input.is-invalid,
#direct-checkout-form .dfc-input-wrapper .dfc-input.is-invalid,
#direct-checkout-form input[type="tel"].is-invalid,
input#dfc-phone.is-invalid,
.dfc-form input.is-invalid,
#dfc-phone.is-invalid,
input.is-invalid#dfc-phone,
.dfc-input-wrapper input#dfc-phone.is-invalid {
    border-color: #d82c0d !important;
    border-width: 2px !important;
    border-style: solid !important;
    background-color: rgba(216, 44, 13, 0.05) !important;
    box-shadow: 0 0 0 3px rgba(216, 44, 13, 0.15) !important;
    outline: none !important;
}

/* Additional focus state for invalid input */
.dfc-input-wrapper .dfc-input.is-invalid:focus,
input#dfc-phone.is-invalid:focus,
.dfc-form input.is-invalid:focus {
    border-color: #d82c0d !important;
    box-shadow: 0 0 0 4px rgba(216, 44, 13, 0.2) !important;
}

.required {
    color: var(--dfc-error) !important;
}

.dfc-input,
.dfc-select,
.dfc-textarea,
input.dfc-input,
select.dfc-select,
textarea.dfc-textarea,
#direct-checkout-form input.dfc-input,
#direct-checkout-form select.dfc-select,
#direct-checkout-form textarea.dfc-textarea {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 40px !important;
    border-radius: var(--dfc-radius) !important;
    border: 1px solid var(--dfc-border) !important;
    padding: 9px 12px !important;
    font-size: 0.95rem !important;
    line-height: 1.4 !important;
    background: #fff !important;
    background-color: #fff !important;
    color: var(--dfc-text) !important;
    font-family: 'Cairo', sans-serif !important;
    font-weight: 400 !important;
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    transition: border-color 0.15s ease !important;
    direction: rtl !important;
    text-align: right !important;
    position: relative !important;
    z-index: 1 !important;
}

.dfc-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23202223' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: left 12px center !important;
    padding-left: 36px !important;
    padding-right: 13px !important;
    cursor: pointer !important;
}

input.dfc-input,
input#dfc-fullname,
input#dfc-phone {
    height: 40px !important;
    min-height: 40px !important;
}

textarea.dfc-textarea,
textarea#dfc-address {
    min-height: 65px !important;
    resize: vertical !important;
}

select.dfc-select,
select#dfc-ville {
    height: 40px !important;
    min-height: 40px !important;
}

.dfc-input:focus,
.dfc-select:focus,
.dfc-textarea:focus {
    border-color: var(--dfc-primary) !important;
    outline: none !important;
    box-shadow: none !important;
}

.dfc-input.error,
.dfc-select.error,
.dfc-textarea.error {
    border-color: var(--dfc-error) !important;
}

.dfc-input.success,
.dfc-select.success,
.dfc-textarea.success {
    border-color: var(--dfc-success) !important;
}

.dfc-input::placeholder,
.dfc-textarea::placeholder {
    color: var(--dfc-muted) !important;
    opacity: 0.8 !important;
}

.dfc-textarea {
    min-height: 80px !important;
    resize: vertical !important;
}

/* ========================================================================
   NUCLEAR OVERRIDES - Maximum specificity to override ANY theme
   ======================================================================== */

/* Force display and visibility with maximum specificity */
body .direct-form-checkout-wrapper input[type="text"],
body .direct-form-checkout-wrapper input[type="tel"],
body .direct-form-checkout-wrapper input[type="number"],
body .direct-form-checkout-wrapper select,
body .direct-form-checkout-wrapper textarea,
body #dfc-fullname,
body #dfc-phone,
body #dfc-ville,
body #dfc-address,
html body .direct-form-checkout-wrapper input#dfc-fullname,
html body .direct-form-checkout-wrapper input#dfc-phone,
html body .direct-form-checkout-wrapper select#dfc-ville,
html body .direct-form-checkout-wrapper textarea#dfc-address,
.direct-form-checkout-wrapper .dfc-form input[type="text"],
.direct-form-checkout-wrapper .dfc-form input[type="tel"],
.direct-form-checkout-wrapper .dfc-form select,
.direct-form-checkout-wrapper .dfc-form textarea {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    clip: auto !important;
    clip-path: none !important;
    height: auto !important;
    min-height: 44px !important;
    max-height: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 11px 13px !important;
    border: 1px solid var(--dfc-border) !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    color: #202223 !important;
    font-size: 16px !important;
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    box-sizing: border-box !important;
    border-radius: 6px !important;
    vertical-align: middle !important;
    outline: none !important;
    text-indent: 0 !important;
    text-align: right !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
    text-transform: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
    transform: none !important;
    transition: border-color 0.2s ease !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    pointer-events: auto !important;
    cursor: text !important;
    z-index: 1 !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    float: none !important;
    clear: none !important;
    overflow: visible !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Textarea specific height */
body .direct-form-checkout-wrapper textarea#dfc-address,
html body .direct-form-checkout-wrapper textarea#dfc-address {
    min-height: 100px !important;
    resize: vertical !important;
    cursor: text !important;
}

/* Select dropdown specific */
body .direct-form-checkout-wrapper select#dfc-ville,
html body .direct-form-checkout-wrapper select#dfc-ville {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23202223' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: left 12px center !important;
    padding-left: 36px !important;
    padding-right: 13px !important;
    cursor: pointer !important;
}

/* Focus states with maximum specificity */
body .direct-form-checkout-wrapper input[type="text"]:focus,
body .direct-form-checkout-wrapper input[type="tel"]:focus,
body .direct-form-checkout-wrapper select:focus,
body .direct-form-checkout-wrapper textarea:focus,
body #dfc-fullname:focus,
body #dfc-phone:focus,
body #dfc-ville:focus,
body #dfc-address:focus {
    border-color: var(--dfc-primary) !important;
    outline: 2px solid rgba(44, 110, 203, 0.1) !important;
    outline-offset: 0 !important;
}

/* Override any theme styles that might hide inputs */
.direct-form-checkout-wrapper input[type="text"],
.direct-form-checkout-wrapper input[type="tel"],
.direct-form-checkout-wrapper input[type="number"],
.direct-form-checkout-wrapper select,
.direct-form-checkout-wrapper textarea,
#dfc-fullname,
#dfc-phone,
#dfc-ville,
#dfc-address {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    clip: auto !important;
    clip-path: none !important;
    height: auto !important;
    min-height: 40px !important;
    width: 100% !important;
    margin: 0 !important;
    border: 1px solid var(--dfc-border) !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #202223 !important;
    padding: 9px 12px !important;
    font-size: 15px !important;
    box-sizing: border-box !important;
    border-radius: 6px !important;
    font-family: 'Cairo', sans-serif !important;
    line-height: normal !important;
    vertical-align: middle !important;
    outline: none !important;
}

/* Specific overrides for each input type */
input#dfc-fullname,
input#dfc-phone {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

select#dfc-ville {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23202223' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    padding-right: 36px !important;
}

textarea#dfc-address {
    min-height: 65px !important;
    resize: vertical !important;
    line-height: 1.5 !important;
}

.dfc-helper-text {
    display: block !important;
    font-family: 'Cairo', sans-serif !important;
    font-size: 0.85rem !important;
    font-weight: 400 !important;
    color: var(--dfc-muted) !important;
    margin-top: 4px !important;
    line-height: 1.4 !important;
    text-align: right !important;
    direction: rtl !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#dfc-order-summary {
    background: var(--dfc-bg-section) !important;
    border-radius: var(--dfc-radius) !important;
    padding: 12px !important;
    border: 1px solid var(--dfc-border) !important;
    margin-bottom: 10px !important;
}

#dfc-order-summary h3 {
    margin: 0 0 8px 0 !important;
    font-family: 'Cairo', sans-serif !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: var(--dfc-text) !important;
    text-align: right !important;
    direction: rtl !important;
}

#dfc-cart-items {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

.dfc-cart-item {
    display: flex !important;
    justify-content: space-between !important;
    font-family: 'Cairo', sans-serif !important;
    font-size: 0.9rem !important;
    font-weight: 400 !important;
    color: var(--dfc-text) !important;
    padding: 6px 0 !important;
}

.dfc-cart-item .item-name {
    flex: 1 !important;
}

.dfc-cart-item .item-price {
    font-weight: 600 !important;
    white-space: nowrap !important;
    margin-left: 12px !important;
}

.dfc-pricing-details {
    margin-top: 12px !important;
    padding: 12px !important;
    background: #f5f5f5 !important;
    border-radius: 8px !important;
}

.dfc-original-price,
.dfc-discount,
.dfc-shipping {
    display: flex !important;
    justify-content: space-between !important;
    padding: 6px 0 !important;
    font-family: 'Cairo', sans-serif !important;
    font-size: 0.95rem !important;
    font-weight: 400 !important;
    color: #1a1a1a !important;
}

.dfc-original-price span:last-child {
    font-weight: 400 !important;
}

.dfc-shipping {
    color: #000 !important;
}

.dfc-discount {
    color: #000 !important;
}

.dfc-discount .discount-label {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.dfc-discount .discount-label::before {
    content: "🏷️" !important;
    font-size: 1rem !important;
}

.dfc-discount .discount-text {
    color: #d32f2f !important;
    font-family: 'Cairo', sans-serif !important;
    font-weight: 600 !important;
}

.dfc-pricing-details .dfc-total {
    border-top: 1px solid #ddd !important;
    margin: 8px 0 0 0 !important;
    padding-top: 12px !important;
}

.dfc-cart-item.dfc-placeholder {
    color: var(--dfc-muted) !important;
    font-style: italic !important;
    text-align: center !important;
    padding: 12px 0 !important;
}

.dfc-total {
    display: flex !important;
    justify-content: space-between !important;
    border-top: 1px solid #ddd !important;
    margin-top: 6px !important;
    padding-top: 10px !important;
    font-family: 'Cairo', sans-serif !important;
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
}

.dfc-submit-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    width: 100% !important;
    border: none !important;
    border-radius: var(--dfc-radius) !important;
    padding: 13px 20px !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    background: var(--dfc-primary) !important;
    color: #fff !important;
    cursor: pointer !important;
    text-align: center !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    font-family: 'Cairo', sans-serif !important;
    position: relative !important;
    overflow: hidden !important;
    min-height: 50px !important;
}

.dfc-submit-btn::before {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 0 !important;
    height: 0 !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.2) !important;
    transform: translate(-50%, -50%) !important;
    transition: width 0.6s ease, height 0.6s ease !important;
}

.dfc-submit-btn:hover::before {
    width: 300px !important;
    height: 300px !important;
}

.dfc-submit-btn .btn-icon {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
    transition: transform 0.3s ease !important;
    display: block !important;
}

.dfc-submit-btn .btn-text {
    position: relative !important;
    z-index: 1 !important;
}

.dfc-submit-btn .btn-loader {
    display: none !important;
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
    animation: spin 1s linear infinite !important;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.dfc-submit-btn:hover:not(.loading) {
    background: var(--dfc-primary-dark) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2) !important;
}

.dfc-submit-btn:hover:not(.loading) .btn-icon {
    transform: scale(1.1) !important;
}

.dfc-submit-btn:active:not(.loading) {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

.dfc-submit-btn:focus:not(.loading) {
    outline: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 3px rgba(44, 110, 203, 0.3) !important;
}

.dfc-submit-btn.loading {
    cursor: not-allowed !important;
    pointer-events: none !important;
    background: var(--dfc-primary) !important;
    opacity: 0.85 !important;
}

.dfc-submit-btn.loading .btn-icon {
    display: none !important;
}

.dfc-submit-btn.loading .btn-loader {
    display: block !important;
}

.dfc-submit-btn.success {
    background: #4caf50 !important;
    animation: successPulse 0.5s ease !important;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.dfc-phone-saved {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin-top: 6px !important;
    color: var(--dfc-success) !important;
    font-family: 'Cairo', sans-serif !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
}

.dfc-phone-saved::before {
    content: "✓" !important;
    display: inline-block !important;
    width: 16px !important;
    height: 16px !important;
    border-radius: 50% !important;
    background: var(--dfc-success) !important;
    color: white !important;
    text-align: center !important;
    line-height: 16px !important;
    font-size: 12px !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Sticky button mobile adjustments */
    .dfc-sticky-order-btn {
        padding: 10px 16px !important;
    }
    
    .dfc-sticky-order-btn-inner {
        font-size: 0.95rem !important;
        padding: 12px 16px !important;
    }
    
    .direct-form-checkout-wrapper {
        padding: 16px !important;
        margin: 0 !important;
        border-radius: var(--dfc-radius) !important;
    }

    .dfc-form {
        gap: 12px !important;
    }

    .dfc-title {
        font-size: 1.3rem !important;
        margin-bottom: 12px !important;
    }
    
    .dfc-order-info-text {
        font-size: 0.9rem !important;
        padding: 10px !important;
        margin-top: 10px !important;
    }

    /* Compact Your Order section */
    #dfc-order-summary {
        padding: 10px !important;
        margin-bottom: 12px !important;
    }

    #dfc-order-summary h3 {
        font-size: 0.9rem !important;
        margin: 0 0 8px 0 !important;
    }

    #dfc-cart-items {
        gap: 4px !important;
    }

    .dfc-cart-item {
        font-size: 0.85rem !important;
        padding: 4px 0 !important;
    }

    .dfc-total {
        font-size: 0.95rem !important;
        margin-top: 8px !important;
        padding-top: 8px !important;
    }

    /* Compact product section */
    .dfc-bundles-section,
    .dfc-product-section {
        padding: 10px !important;
        margin-bottom: 12px !important;
    }

    .dfc-product-section h3 {
        font-size: 0.9rem !important;
        margin: 0 0 8px 0 !important;
    }

    .dfc-product-info {
        grid-template-columns: 70px 1fr !important;
        gap: 10px !important;
    }

    .dfc-product-info .product-image {
        width: 70px !important;
        height: 70px !important;
    }

    .product-details {
        gap: 6px !important;
    }

    .product-title {
        font-size: 0.9rem !important;
        line-height: 1.3 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        max-width: 100% !important;
    }

    .product-price {
        font-size: 0.95rem !important;
    }

    .product-quantity {
        gap: 6px !important;
    }

    .product-quantity label {
        font-size: 0.85rem !important;
    }

    .dfc-qty-input {
        width: 60px !important;
        padding: 6px 8px !important;
        font-size: 0.9rem !important;
    }

    /* Compact bundle cards */
    .dfc-bundle-option {
        padding: 8px !important;
        margin-bottom: 10px !important;
        gap: 10px !important;
    }

    .dfc-bundle-option input[type="checkbox"] {
        display: none !important;
    }

    .bundle-image {
        width: 60px !important;
        height: 60px !important;
    }

    .dfc-bundle-content {
        gap: 8px !important;
    }
    
    .bundle-details {
        gap: 6px !important;
    }

    .bundle-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
        margin-bottom: 0 !important;
    }

    .bundle-title {
        font-size: 0.85rem !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .bundle-price {
        font-size: 0.85rem !important;
    }

    .bundle-description {
        font-size: 0.8rem !important;
    }

    .bundle-products {
        gap: 4px !important;
        font-size: 0.75rem !important;
        margin-top: 4px !important;
    }

    .bundle-product-item {
        padding: 3px 6px !important;
        font-size: 0.75rem !important;
        line-height: 1.3 !important;
    }

    /* Ensure mobile inputs are visible */
    input#dfc-fullname,
    input#dfc-phone,
    select#dfc-ville,
    textarea#dfc-address,
    .dfc-input,
    .dfc-select,
    .dfc-textarea {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        min-height: 44px !important;
        font-family: 'Cairo', sans-serif !important;
        font-weight: 400 !important;
        -webkit-font-smoothing: antialiased !important;
        -moz-osx-font-smoothing: grayscale !important;
    }
}

@media (max-width: 480px) {
    .direct-form-checkout-wrapper {
        padding: 12px !important;
        margin: 0 !important;
    }

    .dfc-form {
        gap: 10px !important;
    }

    .dfc-title {
        font-size: 1.15rem !important;
        margin-bottom: 10px !important;
    }

    /* Ultra-compact Your Order section */
    #dfc-order-summary {
        padding: 8px !important;
        margin-bottom: 10px !important;
    }

    #dfc-order-summary h3 {
        font-size: 0.85rem !important;
        margin: 0 0 6px 0 !important;
    }

    #dfc-cart-items {
        gap: 3px !important;
    }

    .dfc-cart-item {
        font-size: 0.8rem !important;
        padding: 3px 0 !important;
    }

    .dfc-cart-item .item-name {
        max-width: 70% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .dfc-total {
        font-size: 0.9rem !important;
        margin-top: 6px !important;
        padding-top: 6px !important;
    }

    /* Ultra-compact product section */
    .dfc-product-section,
    .dfc-bundles-section {
        padding: 8px !important;
        margin-bottom: 10px !important;
    }

    .dfc-product-section h3 {
        font-size: 0.85rem !important;
        margin: 0 0 6px 0 !important;
    }

    .dfc-form-group {
        margin-bottom: 12px !important;
    }

    .dfc-form-group label {
        font-size: 0.85rem !important;
        margin-bottom: 5px !important;
    }

    .dfc-input,
    .dfc-select,
    .dfc-textarea,
    input#dfc-fullname,
    input#dfc-phone,
    select#dfc-ville,
    textarea#dfc-address {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 10px 12px !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        min-height: 44px !important;
        background: #fff !important;
        border: 1px solid #d1d5db !important;
        font-family: 'Cairo', sans-serif !important;
        font-weight: 400 !important;
        -webkit-font-smoothing: antialiased !important;
        -moz-osx-font-smoothing: grayscale !important;
    }

    .dfc-product-info {
        grid-template-columns: 60px 1fr !important;
        gap: 8px !important;
    }

    .dfc-product-info .product-image {
        width: 60px !important;
        height: 60px !important;
    }

    .product-details {
        gap: 4px !important;
    }

    .product-title {
        font-size: 0.85rem !important;
        line-height: 1.25 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .product-price {
        font-size: 0.9rem !important;
    }

    .product-quantity {
        justify-content: flex-start !important;
        gap: 6px !important;
    }

    .product-quantity label {
        font-size: 0.8rem !important;
    }

    .dfc-qty-input {
        width: 55px !important;
        padding: 5px 6px !important;
        font-size: 0.85rem !important;
    }

    /* Ultra-compact bundle cards */
    .dfc-bundle-option {
        padding: 6px !important;
        margin-bottom: 6px !important;
        gap: 6px !important;
    }

    .dfc-bundle-option input[type="checkbox"] {
        display: none !important;
    }

    .dfc-bundle-content {
        gap: 4px !important;
    }

    .bundle-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 3px !important;
        margin-bottom: 0 !important;
    }

    .bundle-title {
        font-size: 0.8rem !important;
        max-width: 100% !important;
        width: 100% !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    .bundle-price {
        font-size: 0.8rem !important;
    }

    .bundle-description {
        font-size: 0.75rem !important;
        line-height: 1.3 !important;
    }

    .bundle-products {
        gap: 3px !important;
        font-size: 0.7rem !important;
        margin-top: 3px !important;
    }

    .bundle-product-item {
        padding: 2px 5px !important;
        font-size: 0.7rem !important;
        line-height: 1.25 !important;
    }
    

    .dfc-submit-btn {
        padding: 13px 18px !important;
        font-size: 0.95rem !important;
        min-height: 50px !important;
        gap: 8px !important;
    }
    
    .dfc-submit-btn .btn-icon,
    .dfc-submit-btn .btn-loader {
        width: 18px !important;
        height: 18px !important;
    }
    
    .dfc-sticky-order-btn-inner {
        padding: 14px 18px !important;
        font-size: 0.95rem !important;
        min-height: 50px !important;
    }

    .bundle-products {
        font-size: 0.75rem !important;
    }

    .bundle-product-item {
        padding: 2px 6px !important;
    }
}

/* Print Styles */
@media print {
    .direct-form-checkout-wrapper {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }

    .dfc-submit-btn,
    .dfc-clear-bundle {
        display: none !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .dfc-input,
    .dfc-select,
    .dfc-textarea {
        border-width: 2px !important;
    }

    .dfc-submit-btn {
        border: 2px solid transparent !important;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
