/**
 * Kraftinox Quote Request - Frontend Styles
 */

/* ==========================================================================
   Variables
   ========================================================================== */
:root {
    --kx-brand: #366d71;
    --kx-brand-light: #4a8a8f;
    --kx-brand-dark: #2a5558;
    --kx-black: #111111;
    --kx-grey-600: #555555;
    --kx-grey-500: #737373;
    --kx-grey-400: #999999;
    --kx-grey-200: #e5e5e5;
    --kx-grey-100: #f4f4f4;
    --kx-white: #ffffff;
    --kx-red: #dc3545;
    --kx-green: #28a745;
    --kx-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --kx-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.2);
    --kx-radius: 8px;
    --kx-radius-lg: 12px;
    --kx-transition: all 0.3s ease;
}

/* ==========================================================================
   Quote Button (Generic)
   ========================================================================== */
.kx-quote-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    background-color: var(--kx-btn-bg, var(--kx-brand));
    color: var(--kx-btn-color, var(--kx-white));
    border: none;
    border-radius: var(--kx-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--kx-transition);
    text-decoration: none;
    line-height: 1.4;
}

.kx-quote-btn:hover,
.kx-quote-btn:focus {
    background-color: var(--kx-btn-hover-bg, var(--kx-brand-dark));
    color: var(--kx-btn-color, var(--kx-white));
    transform: translateY(-2px);
    box-shadow: var(--kx-shadow);
}

.kx-quote-btn:active {
    transform: translateY(0);
}

.kx-quote-btn svg {
    flex-shrink: 0;
}

/* ==========================================================================
   Add to Quote Button (Single Product Page)
   ========================================================================== */
.kx-add-to-quote-wrapper {
    margin-top: 15px;
    clear: both;
}

.kx-add-to-quote-btn {
    width: 100%;
}

.kx-add-to-quote-btn.single_add_to_quote_button {
    margin-top: 10px;
}

.kx-add-to-quote-message {
    margin-top: 10px;
    padding: 12px 16px;
    border-radius: var(--kx-radius);
    font-size: 14px;
    line-height: 1.4;
}

.kx-add-to-quote-message.kx-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.kx-add-to-quote-message.kx-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ==========================================================================
   Add to Quote Button (Shop/Archive Loop)
   ========================================================================== */
.kx-add-to-quote-btn.kx-loop-btn {
    width: 100%;
    padding: 10px 16px;
    margin-top: 10px;
    font-size: 13px;
}

.kx-add-to-quote-btn.kx-loop-btn.kx-loading {
    opacity: 0.7;
    pointer-events: none;
}

.kx-add-to-quote-btn.kx-loop-btn.kx-added {
    background-color: var(--kx-green);
}

.kx-add-to-quote-btn.kx-select-options {
    background-color: var(--kx-grey-500);
}

.kx-add-to-quote-btn.kx-select-options:hover {
    background-color: var(--kx-grey-600);
}

/* ==========================================================================
   Floating Widget
   ========================================================================== */
.kx-quote-floating-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
    transition: var(--kx-transition);
}

.kx-quote-floating-widget.has-items {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.kx-quote-floating-widget .kx-floating-widget-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background-color: var(--kx-brand);
    color: var(--kx-white);
    border-radius: 50%;
    box-shadow: var(--kx-shadow-lg);
    transition: var(--kx-transition);
    text-decoration: none;
    position: relative;
}

.kx-quote-floating-widget .kx-floating-widget-link:hover {
    background-color: var(--kx-brand-dark);
    transform: scale(1.1);
}

.kx-quote-floating-widget .kx-quote-count {
    position: absolute;
    top: -5px;
    right: -5px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    background-color: var(--kx-red);
    color: var(--kx-white);
    font-size: 12px;
    font-weight: 700;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

/* Pulse animation */
.kx-quote-floating-widget.kx-pulse .kx-floating-widget-link {
    animation: kx-pulse 0.6s ease;
}

@keyframes kx-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* ==========================================================================
   Mini Widget (Shortcode)
   ========================================================================== */
.kx-mini-widget {
    display: inline-flex;
}

.kx-mini-widget .kx-mini-widget-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: var(--kx-brand);
    color: var(--kx-white);
    border-radius: var(--kx-radius);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--kx-transition);
}

.kx-mini-widget .kx-mini-widget-link:hover {
    background-color: var(--kx-brand-dark);
}

.kx-mini-widget .kx-mini-count {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 11px;
    font-size: 12px;
    font-weight: 700;
}

.kx-mini-widget.has-items .kx-mini-count {
    background-color: var(--kx-white);
    color: var(--kx-brand);
}

/* ==========================================================================
   Quote List Page
   ========================================================================== */
.kx-quote-list-page {
    margin: 0 auto;
    padding: 20px 0;
} 

/* Empty State */
.kx-empty-list {
    text-align: center;
    padding: 60px 20px;
}

.kx-empty-icon {
    margin-bottom: 20px;
    color: var(--kx-grey-400);
}

.kx-empty-title {
    margin: 0 0 10px;
    font-size: 24px;
    font-weight: 600;
    color: var(--kx-black);
}

.kx-empty-text {
    margin: 0 0 24px;
    font-size: 16px;
    color: var(--kx-grey-500);
}

/* List Container */
.kx-quote-list-container {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    align-items: start;
}

/* Items List */
.kx-quote-list-items {
    background: var(--kx-white);
    border-radius: var(--kx-radius-lg);
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.kx-list-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 600;
    color: var(--kx-black);
}

.kx-list-count {
    font-weight: 400;
    color: var(--kx-grey-500);
}

/* List Item */
.kx-list-item {
    display: grid;
    grid-template-columns: 80px 1fr auto auto;
    gap: 16px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--kx-grey-200);
    transition: var(--kx-transition);
}

.kx-list-item:last-child {
    border-bottom: none;
}

.kx-list-item.kx-removing {
    opacity: 0.5;
}

.kx-item-image {
    width: 80px;
    height: 80px;
    border-radius: var(--kx-radius);
    overflow: hidden;
    background: var(--kx-grey-100);
}

.kx-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kx-item-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--kx-grey-200);
}

.kx-item-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kx-item-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--kx-black);
    text-decoration: none;
    line-height: 1.4;
}

.kx-item-name:hover {
    color: var(--kx-brand);
}

.kx-item-variation {
    font-size: 13px;
    color: var(--kx-grey-500);
}

.kx-item-sku {
    font-size: 12px;
    color: var(--kx-grey-400);
}

/* Quantity Controls */
.kx-item-quantity {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kx-qty-label {
    font-size: 12px;
    color: var(--kx-grey-500);
    text-align: center;
}

.kx-qty-controls {
    display: flex;
    align-items: center;
    background: var(--kx-grey-100);
    border: 1px solid var(--kx-grey-200);
    border-radius: var(--kx-radius);
    overflow: hidden;
}

.kx-qty-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--kx-grey-600);
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--kx-transition);
    flex-shrink: 0;
}

.kx-qty-btn:hover {
    background: var(--kx-grey-200);
    color: var(--kx-black);
}

.kx-qty-input {
    flex: 1;
    min-width: 40px;
    height: 36px;
    border: none;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--kx-black);
    background: var(--kx-white);
    -moz-appearance: textfield;
}

.kx-qty-input::-webkit-inner-spin-button,
.kx-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Remove Button */
.kx-item-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: var(--kx-grey-400);
    cursor: pointer;
    border-radius: 50%;
    transition: var(--kx-transition);
}

.kx-item-remove:hover {
    background: #fee2e2;
    color: var(--kx-red);
}

/* List Actions */
.kx-list-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--kx-grey-200);
}

.kx-continue-shopping {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--kx-brand);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--kx-transition);
}

.kx-continue-shopping:hover {
    color: var(--kx-brand-dark);
}

/* Sidebar */
.kx-quote-list-sidebar {
    position: sticky;
    top: 100px;
}

.kx-sidebar-box {
    background: var(--kx-white);
    border-radius: var(--kx-radius-lg);
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.kx-sidebar-title {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--kx-black);
}

.kx-sidebar-text {
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--kx-grey-500);
    line-height: 1.5;
}

.kx-submit-quote-btn {
    width: 100%;
}

/* ==========================================================================
   Modal Overlay
   ========================================================================== */
.kx-quote-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.kx-quote-modal[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

.kx-quote-modal .kx-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* ==========================================================================
   Modal Container
   ========================================================================== */
.kx-quote-modal .kx-modal-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    margin: 20px;
    background: var(--kx-white);
    border-radius: var(--kx-radius-lg);
    box-shadow: var(--kx-shadow-lg);
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s ease;
}

.kx-quote-modal[aria-hidden="false"] .kx-modal-container {
    transform: scale(1) translateY(0);
}

.kx-quote-modal .kx-modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

/* ==========================================================================
   Modal Header
   ========================================================================== */
.kx-quote-modal .kx-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 24px 20px;
    background: linear-gradient(135deg, var(--kx-brand), var(--kx-brand-light));
    color: var(--kx-white);
}

.kx-quote-modal .kx-modal-title {
    font-family: 'Libre Baskerville', sans-serif;
    color: #fff;
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
}

.kx-quote-modal .kx-modal-subtitle {
    margin: 6px 0 0;
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.4;
}

.kx-quote-modal .kx-modal-close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: var(--kx-white);
    cursor: pointer;
    transition: var(--kx-transition);
}

.kx-quote-modal .kx-modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

/* ==========================================================================
   Modal Body
   ========================================================================== */
.kx-quote-modal .kx-modal-body {
    padding: 24px;
}

/* Modal Empty State */
.kx-modal-empty {
    text-align: center;
    padding: 30px 20px;
}

.kx-modal-empty p {
    margin: 0 0 20px;
    color: var(--kx-grey-500);
    font-size: 15px;
}

/* ==========================================================================
   Products Preview (Modal) - Collapsible
   ========================================================================== */
.kx-form-products {
    margin-bottom: 24px;
    padding: 0;
    background: var(--kx-grey-100);
    border-radius: var(--kx-radius);
    overflow: hidden;
}

.kx-products-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    transition: var(--kx-transition);
}

.kx-products-header:hover {
    background: rgba(0, 0, 0, 0.03);
}

.kx-products-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--kx-black);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kx-products-count {
    font-weight: 400;
    color: var(--kx-grey-500);
}

.kx-products-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--kx-grey-500);
    transition: transform 0.3s ease;
}

.kx-form-products.is-collapsed .kx-products-toggle {
    transform: rotate(-180deg);
}

.kx-products-content {
    max-height: 300px;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 16px 16px;
}

.kx-form-products.is-collapsed .kx-products-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.kx-products-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kx-product-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--kx-white);
    border-radius: var(--kx-radius);
    font-size: 13px;
}

.kx-product-image {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--kx-grey-200);
    flex-shrink: 0;
}

.kx-product-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.kx-product-placeholder::before {
    content: '';
    width: 16px;
    height: 16px;
    background: var(--kx-grey-400);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Cpath d='m9 9 6 6m0-6-6 6'/%3E%3C/svg%3E") center/contain no-repeat;
}

.kx-product-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.kx-product-name {
    font-weight: 500;
    color: var(--kx-black);
    line-height: 1.3;
    word-break: normal;
    overflow-wrap: break-word;
}

.kx-product-variation {
    font-size: 11px;
    color: var(--kx-grey-500);
    word-break: normal;
    overflow-wrap: break-word;
}

.kx-product-qty {
    flex-shrink: 0;
    padding: 4px 10px;
    background: var(--kx-grey-100);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--kx-grey-600);
}

/* ==========================================================================
   Form Fields
   ========================================================================== */
.kx-form-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.kx-form-group-full {
    grid-column: 1 / -1;
}

.kx-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kx-form-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--kx-black);
}

.kx-required {
    color: var(--kx-red);
}

.kx-form-input,
.kx-form-textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--kx-grey-100);
    border: 2px solid transparent;
    border-radius: var(--kx-radius);
    font-family: inherit;
    font-size: 15px;
    color: var(--kx-black);
    transition: var(--kx-transition);
}

.kx-form-input:focus,
.kx-form-textarea:focus {
    outline: none;
    background: var(--kx-white);
    border-color: var(--kx-brand);
}

.kx-form-input::placeholder,
.kx-form-textarea::placeholder {
    color: var(--kx-grey-400);
}

.kx-form-textarea {
    resize: vertical;
    min-height: 80px;
}

.kx-form-input.kx-error,
.kx-form-textarea.kx-error {
    border-color: var(--kx-red);
    background: #fff5f5;
}

.kx-form-error {
    font-size: 12px;
    color: var(--kx-red);
    min-height: 16px;
}

/* ==========================================================================
   Checkbox / GDPR
   ========================================================================== */
.kx-form-checkbox {
    margin-top: 8px;
}

.kx-checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.kx-checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.kx-checkbox-custom {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    background: var(--kx-grey-100);
    border: 2px solid var(--kx-grey-200);
    border-radius: 4px;
    transition: var(--kx-transition);
}

.kx-checkbox-custom::after {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--kx-white);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='4'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
    opacity: 0;
    transform: scale(0.5);
    transition: var(--kx-transition);
}

.kx-checkbox-label input:checked + .kx-checkbox-custom {
    background: var(--kx-brand);
    border-color: var(--kx-brand);
}

.kx-checkbox-label input:checked + .kx-checkbox-custom::after {
    opacity: 1;
    transform: scale(1);
}

.kx-checkbox-label input:focus + .kx-checkbox-custom {
    box-shadow: 0 0 0 3px rgba(54, 109, 113, 0.2);
}

.kx-checkbox-text {
    font-size: 13px;
    color: var(--kx-grey-600);
    line-height: 1.5;
}

.kx-checkbox-text a {
    color: var(--kx-brand);
    text-decoration: underline;
}

.kx-checkbox-text a:hover {
    color: var(--kx-brand-dark);
}

/* ==========================================================================
   Form Footer / Submit
   ========================================================================== */
.kx-form-footer {
    margin-top: 24px;
}

.kx-modal-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    background: var(--kx-brand);
    color: var(--kx-white);
    border: none;
    border-radius: var(--kx-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--kx-transition);
}

.kx-modal-submit:hover:not(:disabled) {
    background: var(--kx-brand-dark);
    transform: translateY(-2px);
    box-shadow: var(--kx-shadow);
}

.kx-modal-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Spinner animation */
.kx-spinner {
    animation: kx-spin 1s linear infinite;
}

@keyframes kx-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Form Messages
   ========================================================================== */
.kx-form-message {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: var(--kx-radius);
    font-size: 14px;
    line-height: 1.5;
}

.kx-form-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.kx-form-error-msg {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ==========================================================================
   Inline Form (Shortcode)
   ========================================================================== */
.kx-quote-form-inline {
    max-width: 600px;
    padding: 30px;
    background: var(--kx-white);
    border-radius: var(--kx-radius-lg);
    box-shadow: var(--kx-shadow);
}

.kx-quote-form-inline .kx-form-products {
    padding: 20px;
    background: var(--kx-grey-100);
    border-radius: var(--kx-radius);
    margin-bottom: 24px;
    border-bottom: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
    .kx-quote-list-container {
        grid-template-columns: 1fr;
    }

    .kx-quote-list-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    /* Modal adjustments for tablet */
    .kx-quote-modal .kx-modal-container {
        max-width: 95%;
    }

    .kx-products-list {
        gap: 8px;
    }

    .kx-product-item {
        flex-wrap: wrap;
    }

    .kx-product-info {
        flex: 1;
        min-width: 0;
    }

    /* Quote List Page */
    .kx-quote-list-items {
        padding: 20px;
    }

    .kx-list-item {
        grid-template-columns: 70px 1fr auto auto;
        gap: 14px;
    }

    .kx-item-image {
        width: 70px;
        height: 70px;
    }

    .kx-item-name {
        font-size: 15px;
    }
}

@media (max-width: 600px) {
    .kx-quote-modal .kx-modal-container {
        margin: 10px;
        max-height: 95vh;
    }

    .kx-quote-modal .kx-modal-header {
        padding: 16px 20px;
    }

    .kx-quote-modal .kx-modal-title {
        font-size: 18px;
    }

    .kx-quote-modal .kx-modal-subtitle {
        font-size: 13px;
    }

    .kx-quote-modal .kx-modal-body {
        padding: 16px;
    }

    .kx-form-fields {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Products Preview - Mobile (Collapsible) */
    .kx-form-products {
        margin-bottom: 16px;
    }

    .kx-products-header {
        padding: 10px 14px;
    }

    .kx-products-title {
        font-size: 12px;
    }

    .kx-products-content {
        padding: 0 14px 14px;
    }

    .kx-products-list {
        flex-direction: column;
        gap: 8px;
    }

    .kx-product-item {
        width: 100%;
        padding: 10px;
        gap: 10px;
    }

    .kx-product-image {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
    }

    .kx-product-info {
        flex: 1;
        min-width: 0; /* Allow text truncation */
        gap: 3px;
    }

    .kx-product-name {
        font-size: 13px;
        font-weight: 600;
        line-height: 1.3;
        /* Allow text to wrap naturally but not break words */
        word-break: normal;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    .kx-product-variation {
        font-size: 11px;
        line-height: 1.3;
        word-break: normal;
        overflow-wrap: break-word;
    }

    .kx-product-qty {
        font-size: 11px;
        padding: 3px 8px;
    }

    /* Quote List Page - Mobile */
    .kx-quote-list-items {
        padding: 16px;
    }

    .kx-list-title {
        font-size: 16px;
        margin-bottom: 16px;
    }

    .kx-list-item {
        grid-template-columns: 60px 1fr auto;
        gap: 12px;
        padding: 12px 0;
    }

    .kx-item-image {
        width: 60px;
        height: 60px;
        grid-row: span 2;
    }

    .kx-item-details {
        grid-column: 2;
    }

    .kx-item-name {
        font-size: 14px;
        line-height: 1.3;
        word-break: normal;
        overflow-wrap: break-word;
    }

    .kx-item-variation {
        font-size: 12px;
        line-height: 1.3;
        word-break: normal;
    }

    .kx-item-sku {
        font-size: 11px;
    }

    .kx-item-quantity {
        grid-column: 2;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 0;
        margin-top: 8px;
    }

    .kx-qty-label {
        display: none;
    }

    .kx-qty-controls {
        flex-shrink: 0;
        max-width: 110px;
    }

    .kx-qty-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .kx-qty-input {
        width: 36px;
        height: 32px;
        font-size: 13px;
    }

    .kx-item-remove {
        grid-row: 1;
        grid-column: 3;
        justify-self: end;
        width: 32px;
        height: 32px;
    }

    /* Sidebar */
    .kx-sidebar-box {
        padding: 20px;
    }

    .kx-sidebar-title {
        font-size: 16px;
    }

    .kx-sidebar-text {
        font-size: 13px;
    }

    /* Form Footer */
    .kx-form-footer {
        margin-top: 20px;
    }

    .kx-modal-submit {
        padding: 14px 20px;
        font-size: 15px;
    }

    /* Floating Widget */
    .kx-quote-floating-widget {
        bottom: 20px;
        right: 20px;
    }

    .kx-quote-floating-widget .kx-floating-widget-link {
        width: 50px;
        height: 50px;
    }

    .kx-quote-floating-widget .kx-floating-widget-link svg {
        width: 20px;
        height: 20px;
    }
}

/* Extra small screens */
@media (max-width: 400px) {
    .kx-quote-modal .kx-modal-container {
        margin: 5px;
    }

    .kx-quote-modal .kx-modal-header {
        padding: 14px 16px;
    }

    .kx-quote-modal .kx-modal-title {
        font-size: 16px;
    }

    .kx-quote-modal .kx-modal-body {
        padding: 14px;
    }

    .kx-product-item {
        padding: 8px;
    }

    .kx-product-image {
        width: 40px;
        height: 40px;
    }

    .kx-product-name {
        font-size: 12px;
    }

    .kx-list-item {
        grid-template-columns: 50px 1fr auto;
        gap: 8px;
    }

    .kx-item-image {
        width: 50px;
        height: 50px;
    }

    .kx-item-name {
        font-size: 13px;
    }

    .kx-qty-controls {
        max-width: 100px;
    }

    .kx-qty-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .kx-qty-input {
        width: 32px;
        height: 28px;
        font-size: 12px;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .kx-quote-modal,
    .kx-quote-modal .kx-modal-container,
    .kx-quote-btn,
    .kx-add-to-quote-btn,
    .kx-modal-submit,
    .kx-modal-close,
    .kx-quote-floating-widget {
        transition: none;
    }

    .kx-spinner {
        animation: none;
    }

    .kx-quote-floating-widget.kx-pulse .kx-floating-widget-link {
        animation: none;
    }
}

/* Focus styles for keyboard navigation */
.kx-quote-btn:focus-visible,
.kx-add-to-quote-btn:focus-visible,
.kx-modal-submit:focus-visible,
.kx-modal-close:focus-visible,
.kx-form-input:focus-visible,
.kx-form-textarea:focus-visible,
.kx-qty-btn:focus-visible,
.kx-item-remove:focus-visible {
    outline: 2px solid var(--kx-brand);
    outline-offset: 2px;
}

/* Body scroll lock when modal is open */
body.kx-modal-open {
    overflow: hidden;
}
