.opc-page {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 24px;
    margin: 24px 0;
}

.opc-main {
    display: grid;
    gap: 18px;
}

.opc-card {
    border: 1px solid #d9e2ec;
    border-radius: 12px;
    background: #fff;
    padding: 20px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}

.opc-card h2 {
    margin: 0 0 16px;
    font-size: 28px;
    line-height: 1.1;
    font-weight: 700;
    color: #0f172a;
}

.opc-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
    margin-bottom: 14px;
    align-items: start;
}

.opc-fields label,
.opc-field {
    display: grid;
    gap: 6px;
}

.opc-field > span,
.opc-field label > span {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.opc-col-left { grid-column: 1; }
.opc-col-right { grid-column: 2; }

.opc-row-email { grid-row: 1; }
.opc-row-firstname { grid-row: 2; }
.opc-row-lastname { grid-row: 3; }
.opc-row-telephone { grid-row: 4; }

.opc-row-city,
.opc-row-np { grid-row: 1 / span 3; }

.opc-row-street { grid-row: 4; }

.opc-autocomplete-wrapper {
    position: relative;
}

.opc-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
    background: #ffffff;
    border: 1px solid #c4c4c4;
    border-radius: 4px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    max-height: 220px;
    overflow-y: auto;
}

.opc-autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    border-bottom: 1px solid #f3f3f3;
    transition: background 0.15s ease, color 0.15s ease;
}

.opc-autocomplete-item:last-child {
    border-bottom: none;
}

.opc-autocomplete-item:hover,
.opc-autocomplete-item.selected {
    background: #f0f4f8;
    color: #1e3a8a;
    font-weight: 500;
}

.opc-fields input[type="text"],
.opc-fields input[type="email"],
.opc-fields input[type="tel"],
.opc-fields select,
.opc-fields textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 42px;
    height: 42px;
    max-height: 42px;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.opc-fields textarea {
    resize: none;
}

.opc-fields input[type="text"]:focus,
.opc-fields input[type="email"]:focus,
.opc-fields input[type="tel"]:focus,
.opc-fields select:focus,
.opc-fields textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.opc-np-wrapper .opc-autocomplete-wrapper input {
    width: 100%;
}

.opc-np-wrapper {
    align-content: start;
}

.opc-np-wrapper [data-role="np-warehouse-field"] {
    display: grid;
    gap: 8px;
    align-content: start;
}

.opc-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 14px;
    color: #1f2937;
    font-size: 14px;
}

.opc-list {
    margin-bottom: 14px;
}

.opc-options {
    display: grid;
    gap: 8px;
}

.opc-option {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.opc-option:hover,
.opc-option.active {
    border-color: #2563eb;
    background-color: #f8faff;
}

.opc-option .price {
    font-weight: 600;
}

.opc-muted {
    color: #6f6f6f;
}

.opc-message {
    grid-column: 1 / -1;
    padding: 10px 12px;
    border-radius: 6px;
    display: none;
}

.opc-message.error,
.opc-message.success {
    display: block;
}

.opc-message.error {
    background: #ffe8e8;
    color: #9e2020;
}

.opc-message.success {
    background: #e9f9eb;
    color: #1b6f2a;
}

.opc-total-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
}

.opc-total-row.grand {
    border-top: 1px solid #ececec;
    margin-top: 8px;
    padding-top: 10px;
    font-weight: 700;
}

.sticky {
    position: sticky;
    top: 20px;
}

@media (max-width: 980px) {
    .opc-page {
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    .opc-main,
    .opc-sidebar {
        display: contents;
    }

    .opc-card-shipping-method {
        order: 1;
    }

    .opc-card-shipping-address {
        order: 2;
    }

    .opc-card-payment-method {
        order: 3;
    }

    .opc-card-summary {
        order: 4;
    }

    .opc-fields {
        grid-template-columns: 1fr;
    }

    .opc-col-left,
    .opc-col-right,
    .opc-row-email,
    .opc-row-firstname,
    .opc-row-lastname,
    .opc-row-telephone,
    .opc-row-city,
    .opc-row-np,
    .opc-row-street {
        grid-column: 1;
        grid-row: auto;
    }
}

.opc-empty-page {
    grid-template-columns: minmax(0, 1fr);
}

.opc-empty-card {
    max-width: 640px;
    margin: 26px auto;
    text-align: center;
    padding: 34px 28px;
    border: 1px solid #dbe7ff;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 45%),
        #ffffff;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.opc-empty-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.opc-empty-card .action.primary {
    margin-top: 18px;
    text-decoration: none;
    min-width: 210px;
}

.opc-empty-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    background: #eaf1ff;
    border: 1px solid #cfe0ff;
}

.opc-empty-card h2 {
    margin-bottom: 10px;
}

.opc-empty-text {
    max-width: 460px;
    margin: 0 auto;
    line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
    .opc-empty-card {
        transition: none;
    }

    .opc-empty-card:hover {
        transform: none;
    }
}

.opc-np-types{display:flex;gap:12px;margin:8px 0}
.opc-np-types label{
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding: 7px 10px;
    border: 1px solid #d1d9e6;
    border-radius: 999px;
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
}

.opc-np-types input[type="radio"] {
    margin: 0;
}

.opc-np-types input[type="radio"]:checked + span {
    color: #1d4ed8;
    font-weight: 700;
}

.opc-card .action.primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 16px;
    border: 1px solid #2563eb;
    border-radius: 6px;
    background: #2563eb;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.opc-card .action.primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.opc-card .action.primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

[data-role="place-order"] {
    margin-top: 4px;
    min-width: 130px;
}

.opc-loading-shimmer {
    background: linear-gradient(
        110deg,
        #f1f5f9 8%,
        #e2e8f0 18%,
        #f1f5f9 33%
    ) !important;
    background-size: 200% 100% !important;
    animation: opc-shimmer 1.15s linear infinite;
    color: #64748b !important;
    cursor: wait;
}

.opc-loading-shimmer::placeholder {
    color: #94a3b8;
}

@keyframes opc-shimmer {
    to {
        background-position-x: -200%;
    }
}
