/**
 * Request Swatch Button & Modal styles
 */

.request-swatch-button-wrapper {
    display: inline-block;
}

.request-swatch-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    border: 1px solid currentColor;
    background: transparent;
    color: inherit;
    transition: opacity 0.2s ease;
}

.request-swatch-button:hover {
    opacity: 0.85;
}

.request-swatch-modal-inner {
    position: relative;
    padding: 24px;
    min-height: 80px;
}

.request-swatch-modal-close {
    position: absolute;
    top: 0;
    right: 2px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #333;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s ease;
}

.request-swatch-modal-close:hover {
    color: #000;
}

.request-swatch-modal-body {
    padding-top: 8px;
}

.request-swatch-modal-section {
    margin-bottom: 24px;
}

.request-swatch-modal-section:last-child {
    margin-bottom: 0;
}

.request-swatch-modal-section-title {
    margin: 0 0 10px 0 !important;
    padding: 0 0 8px 0;
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 1.3;
    color: inherit;
}

.request-swatch-modal-section .form-builder-with-rule:first-of-type {
    margin-top: 0;
}

.request-swatch-modal-body .form-builder-with-rule {
    margin-bottom: 18px;
}

.request-swatch-modal-body .form-builder-with-rule:last-child {
    margin-bottom: 0;
}

.request-swatch-modal-form-fields {
    max-height: 500px;
    padding: 6px 0 30px 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    margin-right: -2px;
    scrollbar-width: none;
}

.request-swatch-modal-form-fields-cols-1,
.request-swatch-modal-form-fields-cols-2,
.request-swatch-modal-form-fields-cols-3 {
    display: block;
}

.request-swatch-modal-form-fields-cols-1 .request-swatch-modal-section {
    display: block;
}

.request-swatch-modal-form-fields-cols-2 .request-swatch-modal-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
}

.request-swatch-modal-form-fields-cols-2 .request-swatch-modal-section-title {
    grid-column: 1 / -1;
}

.request-swatch-modal-form-fields-cols-2 .request-swatch-modal-section .form-builder-with-rule {
    margin-bottom: 0;
}

.request-swatch-modal-form-fields-cols-3 .request-swatch-modal-section {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px 20px;
}

.request-swatch-modal-form-fields-cols-3 .request-swatch-modal-section-title {
    grid-column: 1 / -1;
}

.request-swatch-modal-form-fields-cols-3 .request-swatch-modal-section .form-builder-with-rule {
    margin-bottom: 0;
}

.request-swatch-modal-form-fields::-webkit-scrollbar {
    width: 6px;
}

.request-swatch-modal-form-fields::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.request-swatch-modal-form-fields::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.request-swatch-modal-more-indicator {
    display: none;
    height: 36px;
    margin-top: -36px;
    position: relative;
    flex-shrink: 0;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.97) 60%);
    pointer-events: none;
    align-items: flex-end;
    justify-content: center;
    margin-bottom: -9px;
    gap: 6px;
}

.request-swatch-modal-more-indicator-text {
    font-size: 12px;
    font-weight: 500;
    color: #555555bb;
}

.request-swatch-modal-more-indicator-chevron {
    width: 14px;
    height: 8px;
    flex-shrink: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='%23666'%3E%3Cpath d='M12 8l-6-6 1.41-1.41L12 5.17l4.59-4.58L18 2l-6 6z'/%3E%3C/svg%3E") no-repeat center;
    background-size: 14px 8px;
}

.request-swatch-modal-form.has-scrollable-fields:not(.at-end-of-form) .request-swatch-modal-more-indicator {
    display: flex;
}

.request-swatch-modal-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.request-swatch-modal-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    border-radius: 0;
    border: 1px solid var(--primary);
    background: transparent;
    color: var(--primary);
    transition: opacity 0.2s ease;
}

.request-swatch-modal-cancel:hover {
    opacity: 0.9;
}

.request-swatch-modal-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    border-radius: 0;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: var(--primary-text);
    transition: opacity 0.2s ease;
}

.request-swatch-modal-submit:hover {
    opacity: 0.9;
}

.request-swatch-modal-submit.request-swatch-modal-submit-loading {
    pointer-events: none;
}

.request-swatch-modal-submit-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}

.request-swatch-modal-submit-spinner svg {
    animation: request-swatch-spin 0.8s linear infinite;
}

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

.request-swatch-modal-cancel:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.request-swatch-modal-inner .tooltip-overlay {
    z-index: 100002 !important;
}

.request-swatch-modal-inner .form-builder-new-select-tooltip.active,
.request-swatch-modal-inner .form-builder-new-multi-select-tooltip.active,
.request-swatch-modal-inner .location-search-tooltip.active {
    z-index: 100003 !important;
}

/* intl-tel-input country dropdown is appended to body – show above modal when request swatch modal is open */
body.request-swatch-modal-open .iti__country-list {
    z-index: 100010 !important;
}
