.ayala-rfq {
    --rfq-border: #9fbbe0;
    --rfq-text: #09265c;
    --rfq-muted: #526783;
    --rfq-accent: #1d75bb;
    --rfq-accent-dark: #082d69;
    --rfq-accent-soft: #e5f2ff;
    --rfq-yellow: #ffdc26;
    --rfq-yellow-dark: #e7b900;
    --rfq-soft: #f3f8ff;
    color: var(--rfq-text);
    direction: rtl;
    font-family: inherit;
    font-size: 14px;
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    padding: 12px;
    border: 1px solid rgba(29, 117, 187, 0.18);
    border-top: 5px solid var(--rfq-accent);
    border-radius: 10px;
    background: linear-gradient(180deg, #eef6ff 0%, #ffffff 42%);
    box-shadow: 0 16px 34px rgba(8, 45, 105, 0.13);
}

.ayala-rfq * {
    box-sizing: border-box;
}

.ayala-rfq__customer {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #0f4f99;
    border-top: 4px solid var(--rfq-yellow);
    border-radius: 8px;
    background: linear-gradient(135deg, #0d3474 0%, #1d75bb 100%);
    box-shadow: 0 10px 22px rgba(8, 45, 105, 0.18);
}

.ayala-rfq__customer label {
    color: #fff;
}

.ayala-rfq label {
    display: grid;
    gap: 5px;
    color: var(--rfq-muted);
    font-size: 13px;
    font-weight: 600;
}

.ayala-rfq input[type="text"],
.ayala-rfq input[type="tel"],
.ayala-rfq input[type="email"],
.ayala-rfq input[type="search"],
.ayala-rfq input[type="number"] {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--rfq-border);
    border-radius: 6px;
    background: #fff;
    color: var(--rfq-text);
    font: inherit;
    padding: 6px 9px;
}

.ayala-rfq input[type="text"],
.ayala-rfq input[type="tel"],
.ayala-rfq input[type="email"],
.ayala-rfq input[type="search"] {
    min-height: 38px;
}

.ayala-rfq input:focus {
    border-color: var(--rfq-accent);
    outline: 2px solid rgba(29, 117, 187, 0.18);
}

.ayala-rfq__tools {
    display: flex;
    justify-content: flex-start;
    margin: 4px 0 8px;
}

.ayala-rfq__tools label {
    width: min(100%, 300px);
}

.ayala-rfq__search {
    border-color: #b8d1ed !important;
    box-shadow: 0 5px 14px rgba(29, 117, 187, 0.14);
}

.ayala-rfq__table-wrap {
    border: 1px solid #8fb0d9;
    border-radius: 8px;
    overflow-x: auto;
    background: #fff;
    max-height: 540px;
    box-shadow: 0 14px 26px rgba(8, 45, 105, 0.16);
}

.ayala-rfq__table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    table-layout: fixed;
    text-align: right;
    font-size: 13px;
}

.ayala-rfq__col-sku {
    width: 58px;
}

.ayala-rfq__col-name {
    width: auto;
}

.ayala-rfq__col-image {
    width: 72px;
}

.ayala-rfq__col-pack {
    width: 82px;
}

.ayala-rfq__col-order {
    width: 146px;
}

.ayala-rfq__table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(135deg, #1d75bb 0%, #1766ad 54%, #102f6b 100%);
    color: #fff;
    font-weight: 700;
    border-bottom: 1px solid #102f6b;
    box-shadow: inset 0 -3px 0 var(--rfq-yellow);
}

.ayala-rfq__table th,
.ayala-rfq__table td {
    border-bottom: 1px solid var(--rfq-border);
    padding: 4px 6px;
    line-height: 1.25;
    vertical-align: middle;
}

.ayala-rfq__table tbody tr:nth-child(even) {
    background: #edf6ff;
}

.ayala-rfq__table tbody tr:hover {
    background: #fff1a8;
}

.ayala-rfq__table tr:last-child td {
    border-bottom: 0;
}

.ayala-rfq__table td:nth-child(2),
.ayala-rfq__table td:nth-child(4) {
    white-space: nowrap;
}

.ayala-rfq__table td:nth-child(3) {
    overflow-wrap: anywhere;
}

.ayala-rfq__table input[type="number"] {
    min-height: 30px;
    padding: 3px 6px;
    border-color: #b8d1ed;
    background: #fcfeff;
}

.ayala-rfq__product-image-cell {
    text-align: center;
}

.ayala-rfq__product-image {
    display: inline-block;
    width: 48px;
    height: 48px;
    border: 1px solid #99bade;
    border-radius: 6px;
    background: #fff;
    object-fit: contain;
    padding: 3px;
    vertical-align: middle;
}

.ayala-rfq__product-image-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    color: var(--rfq-muted);
    font-weight: 700;
}

.ayala-rfq__image-preview {
    position: fixed;
    z-index: 999999;
    width: 220px;
    min-height: 220px;
    padding: 8px;
    border: 1px solid var(--rfq-border, #d9dee7);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(18, 32, 51, 0.2);
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 120ms ease, transform 120ms ease;
}

.ayala-rfq__image-preview[hidden] {
    display: none;
}

.ayala-rfq__image-preview.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.ayala-rfq__image-preview img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    background: #fff;
    object-fit: contain;
}

.ayala-rfq__submit {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-start;
    margin-top: 10px;
    padding: 8px 0;
    background: linear-gradient(to top, #fff 70%, rgba(255, 255, 255, 0));
}

.ayala-rfq__submit button {
    min-height: 40px;
    border: 1px solid #141414;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--rfq-yellow) 0%, #ffe867 58%, var(--rfq-yellow-dark) 100%);
    color: #102c61;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    box-shadow: 0 9px 18px rgba(16, 47, 107, 0.25);
    padding: 8px 22px;
}

.ayala-rfq__submit button:hover,
.ayala-rfq__submit button:focus {
    background: linear-gradient(135deg, #ffe867 0%, var(--rfq-yellow) 100%);
}

.ayala-rfq-alert {
    border-radius: 6px;
    margin-bottom: 16px;
    padding: 12px 14px;
    font-weight: 600;
}

.ayala-rfq-alert-success {
    background: #e8f7ef;
    color: #12643f;
}

.ayala-rfq-alert-error {
    background: #fff0f0;
    color: #9f1d1d;
}

.ayala-rfq__trap {
    position: absolute;
    right: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

@media (max-width: 760px) {
    .ayala-rfq {
        font-size: 14px;
        max-width: 100%;
    }

    .ayala-rfq__customer {
        grid-template-columns: 1fr;
        padding: 12px;
        margin-bottom: 12px;
    }

    .ayala-rfq__tools,
    .ayala-rfq__tools label {
        width: 100%;
    }

    .ayala-rfq__table-wrap {
        max-height: none;
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .ayala-rfq__table {
        display: block;
        min-width: 0;
        font-size: 14px;
    }

    .ayala-rfq__table thead {
        display: none;
    }

    .ayala-rfq__table tbody {
        display: grid;
        gap: 10px;
    }

    .ayala-rfq__table tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px 10px;
        padding: 12px;
        border: 1px solid var(--rfq-border);
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 6px 16px rgba(18, 32, 51, 0.06);
    }

    .ayala-rfq__table tbody tr:nth-child(even),
    .ayala-rfq__table tbody tr:hover {
        background: #fff;
    }

    .ayala-rfq__table td {
        display: grid;
        gap: 3px;
        width: auto;
        border-bottom: 0;
        padding: 0;
        min-width: 0;
    }

    .ayala-rfq__table td::before {
        content: attr(data-label);
        color: var(--rfq-muted);
        font-size: 12px;
        font-weight: 700;
    }

    .ayala-rfq__table td:nth-child(2),
    .ayala-rfq__table td:nth-child(4),
    .ayala-rfq__table td:last-child {
        width: auto;
        white-space: normal;
    }

    .ayala-rfq__table td:nth-child(3),
    .ayala-rfq__table td:last-child {
        grid-column: 1 / -1;
    }

    .ayala-rfq__table td:nth-child(3) {
        color: #111827;
        font-size: 15px;
        font-weight: 700;
        line-height: 1.35;
    }

    .ayala-rfq__table td:nth-child(3)::before {
        display: none;
    }

    .ayala-rfq__table td:first-child {
        align-items: start;
    }

    .ayala-rfq__product-image,
    .ayala-rfq__product-image-placeholder {
        width: 64px;
        height: 64px;
    }

    .ayala-rfq__table input[type="number"] {
        min-height: 44px;
        font-size: 16px;
        padding: 8px 10px;
    }

    .ayala-rfq__image-preview {
        width: min(72vw, 220px);
        min-height: min(72vw, 220px);
    }

    .ayala-rfq__submit {
        justify-content: stretch;
        position: sticky;
        bottom: 0;
        padding: 10px 0 0;
        background: linear-gradient(to top, #fff 82%, rgba(255, 255, 255, 0));
    }

    .ayala-rfq__submit button {
        width: 100%;
        min-height: 48px;
    }
}

@media (max-width: 760px) {
    .ayala-rfq {
        width: 100%;
        max-width: 100%;
        padding: 8px;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
        background: linear-gradient(180deg, #eaf4ff 0%, #ffffff 34%);
        box-shadow: none;
    }

    .ayala-rfq__customer {
        gap: 8px;
        padding: 10px;
        border-radius: 8px;
    }

    .ayala-rfq__tools {
        margin: 6px 0 10px;
    }

    .ayala-rfq__search {
        min-height: 44px !important;
        border-width: 2px !important;
    }

    .ayala-rfq__table-wrap {
        margin: 0;
    }

    .ayala-rfq__table tbody {
        display: grid;
        gap: 12px;
    }

    .ayala-rfq__table tr {
        display: grid;
        grid-template-columns: 78px minmax(0, 1fr);
        grid-template-areas:
            "image name"
            "image sku"
            "image pack"
            "order order";
        gap: 7px 10px;
        padding: 10px;
        border: 1px solid #8fb0d9;
        border-right: 5px solid var(--rfq-accent);
        border-radius: 10px;
        background: linear-gradient(135deg, #ffffff 0%, #edf6ff 100%);
        box-shadow: 0 10px 22px rgba(8, 45, 105, 0.14);
    }

    .ayala-rfq__table tbody tr:nth-child(even),
    .ayala-rfq__table tbody tr:hover {
        background: linear-gradient(135deg, #ffffff 0%, #edf6ff 100%);
    }

    .ayala-rfq__table td {
        display: block;
        padding: 0;
        min-width: 0;
        border-bottom: 0;
    }

    .ayala-rfq__table td::before {
        display: inline;
        margin-left: 5px;
        color: var(--rfq-accent-dark);
        font-size: 11px;
        font-weight: 800;
    }

    .ayala-rfq__table td:first-child {
        grid-area: image;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 78px;
        border: 1px solid #c7d9ee;
        border-radius: 8px;
        background: #fff;
    }

    .ayala-rfq__table td:first-child::before,
    .ayala-rfq__table td:nth-child(3)::before {
        display: none;
    }

    .ayala-rfq__table td:nth-child(2) {
        grid-area: sku;
        color: #35547a;
        font-size: 12px;
        font-weight: 700;
        white-space: normal;
    }

    .ayala-rfq__table td:nth-child(3) {
        grid-area: name;
        color: var(--rfq-accent-dark);
        font-size: 16px;
        font-weight: 800;
        line-height: 1.35;
    }

    .ayala-rfq__table td:nth-child(4) {
        grid-area: pack;
        color: #263b57;
        font-size: 12px;
        font-weight: 700;
        white-space: normal;
    }

    .ayala-rfq__table td:last-child {
        grid-area: order;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 130px;
        align-items: center;
        gap: 8px;
        margin-top: 3px;
        padding: 9px;
        border-radius: 8px;
        background: linear-gradient(135deg, var(--rfq-accent-dark) 0%, var(--rfq-accent) 100%);
        color: #fff;
    }

    .ayala-rfq__table td:last-child::before {
        color: #fff;
        font-size: 12px;
        margin-left: 0;
    }

    .ayala-rfq__table input[type="number"] {
        min-height: 44px;
        border: 2px solid var(--rfq-yellow);
        border-radius: 7px;
        background: #fff;
        color: var(--rfq-text);
        font-size: 16px;
        font-weight: 700;
        padding: 7px 9px;
    }

    .ayala-rfq__product-image,
    .ayala-rfq__product-image-placeholder {
        width: 66px;
        height: 66px;
    }
}

@media (max-width: 420px) {
    .ayala-rfq {
        padding: 6px;
    }

    .ayala-rfq__customer {
        padding: 9px;
    }

    .ayala-rfq__table tr {
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 6px 8px;
        padding: 8px;
        border-right-width: 4px;
    }

    .ayala-rfq__table td:first-child {
        min-height: 66px;
    }

    .ayala-rfq__table td:nth-child(3) {
        font-size: 15px;
    }

    .ayala-rfq__table td:last-child {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 8px;
    }

    .ayala-rfq__product-image,
    .ayala-rfq__product-image-placeholder {
        width: 56px;
        height: 56px;
    }
}
