/* Quick Order Form Styles */
.qof-quick-order-form {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    direction: rtl;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}

/* Full width container */
#qof-form-placeholder {
    width: 100%;
    display: block !important;
}

.qof-form-header {
    margin-bottom: 15px;
}

.qof-form-title {
    font-size: 14px;
    color: #333;
    margin: 0;
    text-align: center;
    line-height: 1.6;
}

/* Form Styles */
.qof-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.qof-form-row {
    display: flex;
    gap: 10px;
}

.qof-two-cols .qof-form-group {
    flex: 1;
}

.qof-form-group {
    position: relative;
}

.qof-form-group input,
.qof-form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--qof-input-border-color, #ccc);
    border-radius: var(--qof-input-border-radius, 8px);
    font-size: var(--qof-input-font-size, 14px);
    background: var(--qof-input-bg-color, #fff);
    transition: border-color 0.3s, box-shadow 0.3s, background-color 0.3s;
    direction: rtl;
    height: auto;
    min-height: 48px;
    line-height: 1.4;
    color: #333;
    cursor: text;
}

/* Select dropdown styling */
.qof-form-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    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='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 35px;
    cursor: pointer;
}

.qof-form-group input:focus,
.qof-form-group select:focus {
    outline: none;
    border-color: var(--qof-primary-color, #8B5CF6);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
    background: #fff;
}

.qof-form-group input::placeholder {
    color: var(--qof-placeholder-color, #888);
    opacity: 1;
}

.qof-form-group input:hover,
.qof-form-group select:hover {
    border-color: var(--qof-primary-color, #8B5CF6);
}

.qof-full-width {
    width: 100%;
}

/* Variation Styles */
.qof-variation-row {
    align-items: center;
    flex-wrap: wrap;
}

.qof-variation-label {
    font-size: 14px;
    color: #333;
    margin-left: 10px;
    white-space: nowrap;
}

/* Color Swatches */
.qof-color-swatches {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.qof-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #e0e0e0;
    transition: all 0.2s;
    position: relative;
}

.qof-color-swatch:hover {
    transform: scale(1.1);
}

.qof-color-swatch.selected {
    border-color: #333;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #333;
}

/* Image Swatches */
.qof-image-swatches {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.qof-image-swatch {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    font-size: 10px;
    text-align: center;
    padding: 2px;
}

.qof-image-swatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.qof-image-swatch:hover {
    transform: scale(1.05);
    border-color: #999;
}

.qof-image-swatch.selected {
    border-color: #333;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #333;
}

.qof-color-swatch[style*="background-color: #FFFFFF"],
.qof-color-swatch[style*="background-color: #ffffff"],
.qof-color-swatch[style*="background-color: white"] {
    border-color: #ccc;
}

/* Size Swatches */
.qof-size-swatches,
.qof-generic-swatches {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.qof-size-swatch,
.qof-generic-swatch {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    background: #fff;
    transition: all 0.2s;
}

.qof-size-swatch:hover,
.qof-generic-swatch:hover {
    border-color: #8B5CF6;
    background: #f5f3ff;
}

.qof-size-swatch.selected,
.qof-generic-swatch.selected {
    background: #8B5CF6;
    color: #fff;
    border-color: #8B5CF6;
}

/* Quantity Row */
.qof-quantity-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.qof-quantity-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: var(--qof-border-radius, 8px);
    padding: 8px 12px;
    height: 48px;
    box-sizing: border-box;
}

.qof-qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: #f0f0f0;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    color: #333;
    line-height: 1;
    font-weight: 400;
}

.qof-qty-btn:hover {
    background: #e0e0e0;
}

.qof-quantity-wrapper input {
    width: 35px;
    height: 28px;
    border: none !important;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    background: transparent !important;
    -moz-appearance: textfield;
    appearance: textfield;
    outline: none !important;
    box-shadow: none !important;
    padding: 0;
}

.qof-quantity-wrapper input::-webkit-outer-spin-button,
.qof-quantity-wrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

/* Submit Button */
.qof-submit-btn {
    flex: 1;
    padding: 0 30px;
    height: 48px;
    border: none;
    border-radius: var(--qof-border-radius, 8px);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.qof-submit-btn.qof-animate {
    animation: qof-gentle-shake 3s ease-in-out infinite;
}

.qof-submit-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.qof-submit-btn:active {
    transform: translateY(0);
}

@keyframes qof-gentle-shake {
    0%, 90%, 100% {
        transform: translateX(0);
    }
    92% {
        transform: translateX(-3px);
    }
    94% {
        transform: translateX(3px);
    }
    96% {
        transform: translateX(-2px);
    }
    98% {
        transform: translateX(2px);
    }
}

/* Order Summary */
.qof-order-summary {
    margin-top: 15px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.qof-summary-header {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    cursor: pointer;
    user-select: none;
}

.qof-summary-toggle {
    margin-left: 10px;
    transition: transform 0.3s;
    font-size: 12px;
}

.qof-summary-header.collapsed .qof-summary-toggle {
    transform: rotate(-90deg);
}

.qof-summary-icon {
    margin-left: 8px;
}

.qof-summary-title {
    font-weight: 600;
    font-size: 14px;
}

.qof-summary-content {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
}

.qof-summary-content.hidden {
    display: none;
}

.qof-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
}

.qof-summary-row:not(:last-child) {
    border-bottom: 1px dashed #e0e0e0;
}

.qof-summary-label {
    color: #666;
}

.qof-summary-value {
    font-weight: 600;
    color: #333;
}

.qof-summary-total {
    padding-top: 12px;
    margin-top: 5px;
}

.qof-summary-total .qof-summary-label,
.qof-summary-total .qof-summary-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--qof-primary-color, #8B5CF6);
}

/* Loading Overlay */
.qof-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 100;
}

.qof-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top-color: #8B5CF6;
    border-radius: 50%;
    animation: qof-spin 0.8s linear infinite;
    margin-bottom: 10px;
}

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

.qof-loading span {
    font-size: 14px;
    color: #666;
}

/* Container positioning */
#qof-form-container {
    position: relative;
}

/* Error State */
.qof-form-group.error input,
.qof-form-group.error select {
    border-color: #ef4444;
}

.qof-variation-row.error .qof-color-swatches,
.qof-variation-row.error .qof-size-swatches,
.qof-variation-row.error .qof-generic-swatches {
    padding: 5px;
    border: 1px solid #ef4444;
    border-radius: 8px;
}

/* Success Message */
.qof-success-message {
    text-align: center;
    padding: 30px;
}

.qof-success-message .qof-success-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.qof-success-message h3 {
    color: #10b981;
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 600px) {
    .qof-quick-order-form {
        padding: 15px;
    }
    
    .qof-two-cols {
        flex-direction: column;
    }
    
    .qof-quantity-row {
        flex-direction: column;
    }
    
    .qof-quantity-wrapper {
        width: 100%;
        justify-content: center;
    }
    
    .qof-submit-btn {
        width: 100%;
    }
    
    .qof-variation-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .qof-variation-label {
        margin-left: 0;
    }
}

/* RTL Adjustments */
[dir="rtl"] .qof-summary-toggle {
    margin-left: 0;
    margin-right: 10px;
}

[dir="rtl"] .qof-summary-icon {
    margin-left: 0;
    margin-right: 8px;
}

[dir="rtl"] .qof-variation-label {
    margin-left: 0;
    margin-right: 10px;
}

/* Price display in summary */
.qof-summary-value .woocommerce-Price-amount {
    font-weight: inherit;
}

/* Out of stock variation */
.qof-size-swatch.out-of-stock,
.qof-color-swatch.out-of-stock,
.qof-generic-swatch.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
    position: relative;
}

.qof-size-swatch.out-of-stock::after,
.qof-generic-swatch.out-of-stock::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #999;
    transform: rotate(-45deg);
}

/* Quantity Badge in Summary */
.qof-qty-badge {
    display: inline-block;
    background: var(--qof-primary-color, #8B5CF6);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    margin-right: 6px;
}

/* Notification Styles */
.qof-notification {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 15px;
    animation: qof-slideDown 0.3s ease;
    direction: rtl;
}

@keyframes qof-slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.qof-notif-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 1px solid #f87171;
    color: #b91c1c;
}

.qof-notif-success {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border: 1px solid #4ade80;
    color: #15803d;
}

.qof-notif-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.qof-notif-message {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}

.qof-notif-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 0;
    line-height: 1;
    color: inherit;
}

.qof-notif-close:hover {
    opacity: 1;
}

/* Enhanced Error State for inputs */
.qof-form-group.error input,
.qof-form-group.error select {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.qof-form-group.error input::placeholder {
    color: #ef4444;
}

/* Shake animation for error */
.qof-form-group.error {
    animation: qof-shake 0.4s ease;
}

@keyframes qof-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

/* Select wrapper for better styling - removed duplicate, using .qof-form-group select instead */
.qof-select-wrapper {
    position: relative;
}

/* Placeholder color for inputs */
.qof-form-group input::placeholder,
.qof-form-group textarea::placeholder,
.qof-notes-row textarea::placeholder {
    color: var(--qof-placeholder-color, #888);
    opacity: 1;
}

/* Select first option as placeholder style */
.qof-form-group select option:first-child,
.qof-form-group select option[value=""] {
    color: var(--qof-placeholder-color, #888);
}

/* Notes toggle */
.qof-notes-toggle-row {
    margin: 5px 0;
}

.qof-notes-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    transition: color 0.2s;
}

.qof-notes-toggle:hover {
    color: #333;
}

.qof-notes-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--qof-primary-color, #8B5CF6);
}

.qof-notes-toggle-text {
    user-select: none;
}

/* Notes textarea */
.qof-notes-row textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--qof-input-border-color, #ccc);
    border-radius: var(--qof-input-border-radius, 8px);
    font-size: var(--qof-input-font-size, 14px);
    background: var(--qof-input-bg-color, #fff);
    transition: border-color 0.3s, box-shadow 0.3s, background-color 0.3s;
    direction: rtl;
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
    color: #333;
}

.qof-notes-row textarea:hover {
    border-color: var(--qof-primary-color, #8B5CF6);
}

.qof-notes-row textarea:focus {
    outline: none;
    border-color: var(--qof-primary-color, #8B5CF6);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
    background: #fff;
}

.qof-notes-row textarea::placeholder {
    color: var(--qof-placeholder-color, #888);
    opacity: 1;
}

/* Add to cart button */
.qof-cart-btn {
    padding: 0 25px;
    height: 48px;
    border: none;
    border-radius: var(--qof-border-radius, 8px);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.qof-cart-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* View cart link in notification */
.qof-view-cart-link {
    display: inline-block;
    margin-right: 10px;
    padding: 4px 12px;
    background: #fff;
    color: #333 !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
}

.qof-view-cart-link:hover {
    background: #f0f0f0;
    color: #000 !important;
}

/* Tiered Pricing Table Styles */
.qof-tiered-pricing {
    margin: 15px 0;
    padding: 12px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 10px;
    border: 1px solid #bae6fd;
}

.qof-tiered-pricing-title {
    font-size: 14px;
    font-weight: 600;
    color: #0369a1;
    margin-bottom: 10px;
    text-align: center;
}

.qof-tiered-pricing-table {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.qof-tier-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fff;
    border-radius: 8px;
    border: 2px solid #e0e7ff;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
    justify-content: center;
}

.qof-tier-row:hover {
    border-color: #818cf8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.qof-tier-row.active {
    border-color: #4f46e5;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.qof-tier-qty {
    font-size: 13px;
    font-weight: 700;
    color: #4f46e5;
    background: #eef2ff;
    padding: 2px 8px;
    border-radius: 4px;
}

.qof-tier-price {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.qof-tier-save {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: #10b981;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Responsive tiered pricing */
@media (max-width: 480px) {
    .qof-tiered-pricing-table {
        flex-direction: column;
    }
    
    .qof-tier-row {
        width: 100%;
        justify-content: space-between;
    }
}
