/* ==========================================================
   FILE: static/css/cart/processing.css
   PURPOSE:
   - Base styles only
   - Desktop-first layout
   - Core component styling
   - No breakpoint-specific layout changes here

   TRACEBACK GUIDE
   [01] Variables
   [02] Page layout
   [03] Section headings
   [04] Items table
   [05] Buttons
   [06] Form controls
   [07] Delivery type cards
   [08] Payment / delivery radio groups
   [09] Search dropdown
   [10] Summary box
   [11] Utility rows
   ========================================================== */

/* ==========================================================
   [01] Variables
   Change here first when adjusting spacing, colors, radius
   ========================================================== */
:root {
    --checkout-bg: #ffffff;
    --checkout-muted-bg: #fafafa;
    --checkout-border: #e3e3e3;
    --checkout-border-strong: #d5d5d5;
    --checkout-text: #333333;
    --checkout-text-soft: #666666;
    --checkout-accent: #d84602;
    --checkout-accent-dark: #c54f00;
    --checkout-danger: #d9534f;
    --checkout-danger-dark: #a94442;

    --checkout-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --checkout-shadow-soft: inset 0 2px 8px rgba(0, 0, 0, 0.05);

    --checkout-radius: 12px;
    --checkout-radius-sm: 8px;

    --checkout-page-width: 90%;
    --checkout-gap: 24px;
    --checkout-card-padding: 24px;

    --checkout-font: "Segoe UI", Arial, sans-serif;
}

/* ==========================================================
   [02] Page layout
   Main desktop layout only
   ========================================================== */
.checkout-page {
    display: flex;
    align-items: flex-start;
    gap: var(--checkout-gap);
    width: var(--checkout-page-width);
    margin: 20px auto;
    color: var(--checkout-text);
    font-family: var(--checkout-font);
}

.checkout-left,
.checkout-right {
    background: var(--checkout-bg);
    padding: var(--checkout-card-padding);
    border-radius: var(--checkout-radius);
    box-shadow: var(--checkout-shadow);
}

.checkout-left {
    flex: 1 1 auto;
    min-width: 0;
}

.checkout-right {
    flex: 0 0 340px;
    background: var(--checkout-muted-bg);
}

/* ==========================================================
   [03] Section headings
   ========================================================== */
.checkout-left h1 {
    margin: 0 0 20px;
    color: #222;
    line-height: 1.2;
}

.checkout-left h2 {
    margin: 26px 0 14px;
    color: #2f2f2f;
    line-height: 1.3;
}

.checkout-left h3 {
    margin: 18px 0 12px;
    color: #444;
    line-height: 1.3;
}

/* ==========================================================
   [04] Items table
   Base desktop table
   ========================================================== */
.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    font-size: 0.95rem;
    table-layout: fixed;
}

.items-table th,
.items-table td {
    border: 1px solid var(--checkout-border);
    padding: 10px 10px;
    vertical-align: middle;
}

.items-table th {
    background: #f9f9f9;
    color: #444;
    font-weight: 600;
    text-align: center;
}

.items-table td {
    background: #fff;
}

.items-table td:nth-child(3),
.items-table td.item-name {
    text-align: left;
}

.items-table td.item-qty,
.items-table td.item-unit,
.items-table td:first-child,
.items-table td:nth-child(2) {
    text-align: center;
}

.items-table td.unit-price,
.items-table td.sub-total {
    text-align: right;
}

.items-table .col-no {
    width: 42px;
}

.items-table .col-sku {
    width: 98px;
}

.items-table .col-name {
    width: auto;
}

.items-table .col-qty {
    width: 92px;
}


.items-table .col-unit,
.items-table th.col-unit,
.items-table td.item-unit {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
}

.items-table .col-price {
    width: 140px;
}

.items-table .col-subtotal {
    width: 150px;
}

.items-table .col-remove {
    width: 46px;
}

.items-table td.item-unit {
    white-space: nowrap;
    padding-left: 4px;
    padding-right: 4px;
}

.items-table td.item-name {
    word-break: break-word;
}

.qty-input {
    width: 72px;
    min-width: 72px;
    margin: 0 auto;
    text-align: center;
    height: 36px;
    padding: 6px 8px;
}


.items-table td.item-qty {
    text-align: center;
}

.items-table td.item-qty > span {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.items-table td.item-qty input.qty-input {
    margin: 0;
}


.unit-price .current-price,
.sub-total span {
    display: inline-block;
}

.unit-price del.original-price {
    display: inline-block;
    margin-left: 6px;
    color: #888;
    font-size: 0.92em;
}

/* ==========================================================
   [05] Buttons
   ========================================================== */
.remove-btn {
    background: none;
    border: none;
    color: var(--checkout-danger);
    font-size: 1.15rem;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0;
}
.items-table td[data-label="Xóa sản phẩm"] {
  text-align: center;
}
.remove-btn:hover {
    color: var(--checkout-danger-dark);
}

.complete-order {
    display: block;
    width: 100%;
    padding: 14px;
    margin-top: 24px;
    border: none;
    border-radius: var(--checkout-radius-sm);
    background: linear-gradient(135deg, var(--checkout-accent-dark), var(--checkout-accent));
    color: #fff;
    font-size: 1.05rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.complete-order:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    filter: brightness(1.03);
}

/* ==========================================================
   [06] Form controls
   Important:
   - Do NOT let the global input rule affect radios / checkboxes
   ========================================================== */
input:not([type="radio"]):not([type="checkbox"]),
textarea,
select {
    display: block;
    width: 100%;
    padding: 12px;
    margin-bottom: 14px;
    border: 1px solid #ccc;
    border-radius: var(--checkout-radius-sm);
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
}

input:not([type="radio"]):not([type="checkbox"]):focus,
textarea:focus,
select:focus {
    border-color: var(--checkout-accent);
    box-shadow: 0 0 6px rgba(216, 70, 2, 0.25);
    outline: none;
}

input[type="radio"],
input[type="checkbox"] {
    width: auto;
    display: inline-block;
    margin: 0;
    padding: 0;
}

input::placeholder,
textarea::placeholder {
    color: #888;
    font-style: italic;
}

/* ==========================================================
   [07] Delivery type cards
   Used for domestic / international switch
   ========================================================== */
.delivery-type {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 12px 0 20px;
}

.delivery-type > label,
.delivery-type-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--checkout-border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.delivery-type > label:hover,
.delivery-type-option:hover {
    border-color: var(--checkout-accent);
    box-shadow: 0 3px 10px rgba(216, 70, 2, 0.10);
}

.delivery-type input[type="radio"] {
    flex: 0 0 auto;
    margin-top: 2px;
    transform: scale(1.08);
    accent-color: var(--checkout-accent);
}

.delivery-type span {
    display: block;
    line-height: 1.4;
    white-space: normal;
}

/* ==========================================================
   [08] Payment / delivery radio groups
   Used in the dynamic blocks rendered by JS
   ========================================================== */
.payment-methods-group,
.delivery-service-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 18px 0;
    max-width: 100%;
}

.radio-option {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    column-gap: 10px;
    align-items: start;
    padding: 8px 10px;
    border-radius: 6px;
    transition: background 0.2s ease;
    cursor: pointer;
}

.radio-option:hover {
    background: #f9f9f9;
}

.radio-option input[type="radio"] {
    width: 16px;
    height: 16px;
    margin: 2px 0 0 0;
    padding: 0;
    transform: none;
    accent-color: var(--checkout-accent);
    justify-self: start;
    align-self: start;
    flex: 0 0 auto;
}

.radio-option label {
    display: block;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.35;
    cursor: pointer;
    word-break: break-word;
    white-space: normal;
}

/* Keep old selectors harmless if reused elsewhere */
.payment-methods-group label,
.delivery-service-group label {
    word-break: break-word;
    white-space: normal;
}

/* ==========================================================
   [09] Search dropdown
   Country / province / district suggestions
   ========================================================== */
.search-wrapper {
    position: relative;
    width: 100%;
}

#country-results,
#province-results,
#district-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    margin-top: 4px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.10);
    z-index: 1000;
}

.search-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s ease;
}

.search-item:hover,
.search-item.highlighted {
    background: #f0f8ff;
    color: #333;
}

.no-results {
    padding: 10px 14px;
    color: #888;
    font-style: italic;
}

/* ==========================================================
   [10] Summary box
   ========================================================== */
.summary-box {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--checkout-shadow-soft);
}

.summary-box p {
    margin: 12px 0;
    font-size: 1rem;
}

.summary-box strong {
    font-size: 1.15rem;
    color: var(--checkout-accent);
}

/* ==========================================================
   [11] Utility rows
   ========================================================== */
.weight-row {
    color: var(--checkout-text-soft);
}

.weight-row span {
    font-weight: 600;
    color: var(--checkout-accent);
}