/* SAMECOM checkout, order-received page and landing order forms. */

.samecom-checkout-page, .samecom-received-page { padding-bottom: 48px; }
.samecom-checkout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: clamp(20px, 3vw, 40px); align-items: start; }
@media (max-width: 900px) { .samecom-checkout { grid-template-columns: 1fr; } }
.samecom-checkout__form h2, .samecom-checkout__summary h2 { font-size: 1.2rem; margin: 0 0 14px; }
.samecom-checkout__summary { position: sticky; top: 24px; background: var(--samecom-soft); border-radius: var(--samecom-radius); padding: 22px; }
.samecom-checkout__summary .samecom-btn { margin-top: 16px; }
.samecom-checkout.is-calculating .samecom-totals { opacity: .5; }

/* Fields */
.samecom-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.samecom-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.samecom-field--address, .samecom-field--notes { grid-column: 1 / -1; }
@media (max-width: 560px) { .samecom-fields { grid-template-columns: 1fr; } }
.samecom-field label { font-weight: 600; font-size: .95rem; }
.samecom-required { color: var(--samecom-danger); }
.samecom-optional { color: var(--samecom-muted); font-weight: 400; font-size: .85rem; }
.samecom-field input, .samecom-field select, .samecom-field textarea {
	width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid #d1d5db; border-radius: var(--samecom-radius-sm);
	font: inherit; font-size: 16px; /* no iOS zoom */ background: #fff; color: var(--samecom-text);
}
.samecom-field textarea { min-height: 80px; resize: vertical; }
.samecom-field input:focus, .samecom-field select:focus, .samecom-field textarea:focus { outline: none; border-color: var(--samecom-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--samecom-primary) 20%, transparent); }
.samecom-field [aria-invalid="true"] { border-color: var(--samecom-danger); background: #fffafa; }
.samecom-field__error { margin: 0; color: var(--samecom-danger); font-size: .88rem; font-weight: 600; }
.samecom-field__error[hidden] { display: none; }
/* Theme honeypot stays invisible even if the theme CSS is not loaded here. */
.samecom-fields .samra-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Mode choice (mixed carts) */
.samecom-mode-choice { border: 2px solid var(--samecom-border); border-radius: var(--samecom-radius); padding: 16px; margin: 0 0 24px; }
.samecom-mode-choice legend { font-weight: 700; padding: 0 6px; }
.samecom-mode { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--samecom-border); border-radius: var(--samecom-radius-sm); margin-top: 10px; cursor: pointer; background: #fff; }
.samecom-mode:has(input:checked) { border-color: var(--samecom-primary); background: color-mix(in srgb, var(--samecom-primary) 5%, #fff); }
.samecom-mode input { margin-top: 4px; accent-color: var(--samecom-primary); }
.samecom-mode span { display: flex; flex-direction: column; }
.samecom-mode small { color: var(--samecom-muted); }

/* Mini lines */
.samecom-mini-lines { list-style: none; margin: 0 0 12px; padding: 0; }
.samecom-mini-lines li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--samecom-border); font-size: .92rem; }
.samecom-mini-lines li.has-error { color: var(--samecom-danger); }
.samecom-mini-lines img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; background: #fff; }
.samecom-mini-lines small { color: var(--samecom-muted); }

/* Order received */
.samecom-received { text-align: center; padding: 24px 0; }
.samecom-received__icon { display: inline-flex; align-items: center; justify-content: center; width: 80px; height: 80px; border-radius: 50%; background: #ecfdf5; color: var(--samecom-success); margin-bottom: 12px; }
.samecom-received h1 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0 0 10px; }
.samecom-order-table { background: var(--samecom-soft); border-radius: var(--samecom-radius); padding: 20px; margin: 20px 0; }
.samecom-order-table table { width: 100%; border-collapse: collapse; }
.samecom-order-table th, .samecom-order-table td { padding: 10px 6px; border-bottom: 1px solid var(--samecom-border); text-align: start; }
.samecom-order-table td:last-child, .samecom-order-table th:last-child { text-align: end; white-space: nowrap; }
.samecom-order-table tfoot th { font-weight: 500; color: var(--samecom-muted); }
.samecom-order-table__total th, .samecom-order-table__total td { font-weight: 800 !important; color: var(--samecom-text) !important; font-size: 1.1rem; border-bottom: 0; }
.samecom-order-table h2 { font-size: 1.1rem; margin: 20px 0 6px; }

/* Landing inline form */
.samecom-checkout--inline { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }

/* Delivery method (home / stop desk): each has its own price. */
.samecom-field--delivery-method { border: 0; margin: 0; padding: 0; min-width: 0; }
.samecom-field--delivery-method legend { font-weight: 600; font-size: .95rem; padding: 0; margin-bottom: 6px; }
.samecom-delivery-methods { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.samecom-delivery-method { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 2px solid var(--samecom-border); border-radius: var(--samecom-radius-sm); background: #fff; cursor: pointer; }
.samecom-delivery-method:has(input:checked) { border-color: var(--samecom-primary); background: color-mix(in srgb, var(--samecom-primary) 5%, #fff); }
.samecom-delivery-method input { accent-color: var(--samecom-primary); width: 18px; height: 18px; flex: none; }
.samecom-delivery-method__text { font-weight: 600; }
.samecom-delivery-methods__note { margin: 6px 0 0; }

.samecom-delivery-method__price { margin-inline-start: auto; font-weight: 700; color: var(--samecom-primary); white-space: nowrap; }
.samecom-delivery-method.is-unavailable { opacity: .55; cursor: not-allowed; }
[data-samecom-rates-error][hidden] { display: none; }
.samecom-checkout.has-no-delivery-price [data-samecom-total] { color: var(--samecom-danger); }

.samecom-field select[data-samecom-commune]:disabled { background: var(--samecom-soft); color: var(--samecom-muted); cursor: not-allowed; }

.samecom-field input[data-samecom-phone].is-invalid { border-color: var(--samecom-danger, #d63638); }
.samecom-field input[data-samecom-phone].is-valid { border-color: var(--samecom-success, #15803d); }
