/* Kalkulators un pašreizējais rezultātu skats. Ielādē pēc style.css. */
[hidden] { display: none !important; }
#main, #home-calculator { --sg-blue: #1765ad; --sg-ink: #213c54; --sg-line: #dce5ec; --sg-muted: #627385; font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5; color: var(--sg-ink); }
#main *, #home-calculator * { box-sizing: border-box; }
#main.site-container { width: calc(100% - 48px); max-width: 1420px; margin: 24px auto 56px; }
#main .back-to-home { border: 0; background: #eef4f9; color: #1765ad; padding: 9px 14px; border-radius: 7px; font-size: 14px; cursor: pointer; }
#main .order-steps { display: grid; grid-template-columns: repeat(4, 1fr); padding: 0; margin: 22px 0 28px; list-style: none; gap: 0; }
#main .order-steps li { padding: 12px 8px; text-align: center; color: #748292; border-bottom: 4px solid #e8edf1; font-size: 14px; }
#main .order-steps li.current { color: #1765ad; border-color: #8fb737; font-weight: 700; }
#main .quote-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 26px; align-items: start; }
#main .results-column, #main .calculator-column { min-width: 0; }
#main h1 { margin: 0 0 8px; font-size: 30px; line-height: 1.2; font-weight: 700; color: #213c54; }
#main h2 { font-size: 23px; margin: 0 0 10px; line-height: 1.3; color: #213c54; }
#main .results-intro { font-size: 15px; color: #627385; margin: 0 0 20px; }
#main #statuses { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
#main #statuses > p { margin: 0; padding: 8px 10px; border-radius: 7px; background: #f0f5f9; color: #425b70; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
#main #statuses > p.error { background: #fff0f1; color: #a32935; border: 1px solid #f0ccd1; }
#main .offer-title { padding: 13px 16px; margin: 0; border-radius: 9px 9px 0 0; background: #edf4fa; border: 1px solid #dce5ec; font-size: 16px; font-weight: 700; color: #213c54; }
#main .table { width: 100%; overflow-x: auto; border: 1px solid #dce5ec; border-top: 0; border-radius: 0 0 9px 9px; background: #fff; }
#main .offer-table { width: 100%; border-collapse: collapse; font-size: 15px; color: #213c54; margin: 0; }
#main .offer-table th { background: #f7f9fb; color: #627385; font-size: 12px; text-align: left; font-weight: 600; padding: 13px 12px; border-bottom: 1px solid #dce5ec; white-space: normal; }
#main .offer-table td { padding: 18px 12px; border-bottom: 1px solid #e7edf2; vertical-align: middle; background: #fff; font-size: 14px; }
#main .offer-table tr:last-child td { border-bottom: 0; }
#main .offer-table tbody tr:hover td { background: #f7fbf7; }
#main .offer-table td[colspan] { background: #f7f9fb; padding: 20px 16px; color: #627385; }
#main .offer-provider { display: flex; align-items: center; gap: 12px; min-width: 190px; }
#main .offer-provider > span { font-weight: 700; font-size: 15px; }
#main .offer-provider .brand { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; padding: 8px; border-radius: 7px; background: #edf4fa; color: #1765ad; font-size: 16px; font-weight: 800; }
#main .offer-provider .brand.ups { background: #fff0c4; color: #5b390b; }
#main .offer-provider .brand.fedex { background: #f4edfa; color: #50288b; }
#main .offer-provider .brand.dhl { background: #ffdf00; color: #d40511; }
#main .offer-provider .brand.novapost { background: #ffeded; color: #b82a30; }
#main .service-description { display: block; margin-top: 5px; max-width: 240px; color: #627385; font-size: 12px; font-weight: 400; line-height: 1.5; }
#main .offer-table .offer-price { font-size: 19px; font-weight: 700; white-space: nowrap; color: #213c54; }
#main .offer-price small { font-size: 11px; font-weight: 400; color: #627385; }
#main .offer-table details summary { color: #1765ad; cursor: pointer; font-size: 13px; }
#main .offer-table details small { display: block; margin-top: 8px; font-size: 12px; min-width: 120px; }
#main .offer-note { margin: 14px 0 24px; font-size: 12px; line-height: 1.6; color: #627385; }
#main .sg-alternatives { margin: 28px 0; }
#main .sg-alternatives > p { color: #627385; font-size: 14px; margin: 0 0 16px; }
#main #alternative-offers { display: grid; gap: 14px; }
#main .sg-alternative-card { position: relative; background: #f7f8fa; border: 1px solid #dfe4e9; border-radius: 11px; padding: 20px; box-shadow: 0 2px 6px #213c5405; }
#main .sg-alternative-card h3 { margin: 0 0 13px; padding-right: 128px; color: #5c6673; font-size: 20px; line-height: 1.35; font-weight: 700; }
#main .sg-alternative-card::after { content: 'Nav pieejams'; position: absolute; top: 20px; right: 20px; background: #e6e9ed; color: #77818e; font-size: 12px; font-weight: 700; padding: 8px 11px; border-radius: 6px; }
#main .sg-alternative-card ul { margin: 0 0 12px; list-style: none; padding: 12px 15px; border-radius: 7px; background: #fff0f1; border-left: 3px solid #d55560; }
#main .sg-alternative-card li { margin: 4px 0; font-size: 14px; font-weight: 600; color: #a62d38; overflow-wrap: anywhere; }
#main .sg-alternative-card p { color: #627385; font-size: 13px; margin: 10px 0 14px; line-height: 1.6; }
#main .sg-add-data { display: inline-block; padding: 9px 13px; border: 1px solid #abc5dd; background: #fff; color: #1765ad; font-size: 13px; font-weight: 600; border-radius: 6px; cursor: pointer; }
#main .sg-add-data:hover { background: #eaf3fb; }
#main .calculation-details { margin-top: 26px; border: 1px solid #dce5ec; border-radius: 9px; padding: 15px 18px; background: #fafcfe; }
#main .calculation-details summary { color: #1765ad; font-size: 14px; cursor: pointer; }
#main .calculation-details p { color: #627385; font-size: 13px; line-height: 1.7; }
#main #debug { min-width: 0; font-size: 13px; }
#main #debug > details { margin-top: 10px; padding: 10px; background: #fff; border: 1px solid #dce5ec; border-radius: 6px; }
#main #debug pre { max-height: 420px; max-width: 100%; overflow: auto; padding: 12px; background: #f3f6f9; font: 12px/1.5 monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
#main .help-card { margin-top: 16px; padding: 20px; border-radius: 10px; background: #edf5fc; border: 1px solid #dce9f4; color: #425b70; }
#main .help-card h3 { margin: 0 0 10px; color: #1765ad; font-size: 20px; font-weight: 700; }
#main .help-card p { font-size: 14px; line-height: 1.6; margin: 8px 0; }
#quote-form { padding: 22px; border: 1px solid #dce5ec; border-radius: 12px; background: #f0f5fa; color: #213c54; margin: 0; box-shadow: 0 5px 22px #213c5408; }
#quote-form h2 { font-size: 22px; line-height: 1.3; margin: 0 0 10px; color: #213c54; font-weight: 700; }
#quote-form .calculator-intro { font-size: 14px; line-height: 1.5; color: #627385; margin: 0 0 18px; }
#quote-form .grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 14px; margin-bottom: 20px; }
#quote-form label { display: block; color: #213c54; font-size: 13px; font-weight: 600; line-height: 1.4; margin: 0; }
#quote-form input:not([type='hidden']):not([type='checkbox']), #quote-form select { display: block; width: 100%; min-width: 0; height: 42px; margin: 6px 0 0; padding: 9px 11px; background: #fff; color: #213c54; border: 1px solid #cbd6df; border-radius: 6px; font-family: inherit; font-size: 14px; font-weight: 400; box-shadow: none; }
#quote-form input:focus, #quote-form select:focus { outline: 2px solid #98c3e8; outline-offset: 1px; border-color: #1765ad; }
#quote-form input[type='checkbox'] { width: 17px; height: 17px; flex: 0 0 auto; margin: 2px 0 0; accent-color: #1765ad; }
#quote-form label.check { display: flex; align-items: flex-start; gap: 9px; margin: 15px 0; font-size: 13px; font-weight: 400; }
#quote-form .calculator-options { margin: 8px 0 18px; border-top: 1px solid #d3dfe9; padding-top: 14px; }
#quote-form .calculator-options summary { cursor: pointer; color: #1765ad; font-size: 13px; font-weight: 700; line-height: 1.5; }
#quote-form .calculator-options[open] summary { margin-bottom: 16px; }
#quote-form .calculator-options small { color: #627385; font-size: 12px; line-height: 1.6; }
#quote-form .sg-form-note { color: #627385; font-size: 12px; font-weight: 400; line-height: 1.6; margin: 16px 0; }
#quote-form > button[type='submit'] { display: block; width: 100%; min-height: 46px; padding: 12px 16px; margin: 0; background: #1765ad; color: #fff; border: 0; border-radius: 7px; font-size: 15px; font-weight: 700; cursor: pointer; }
#quote-form > button[type='submit']:hover { background: #104e89; }
#quote-form .country-picker { position: relative; }
#quote-form .country-results { position: absolute; z-index: 100; top: 100%; left: 0; right: 0; max-height: 250px; overflow-y: auto; background: #fff; color: #213c54; border: 1px solid #cbd6df; border-radius: 7px; box-shadow: 0 10px 25px #213c5426; font-weight: 400; }
#quote-form .country-results button { display: block; width: 100%; height: auto; padding: 11px 12px; margin: 0; border: 0; border-radius: 0; background: #fff; color: #213c54; text-align: left; font-size: 14px; font-weight: 400; cursor: pointer; }
#quote-form .country-results button.active, #quote-form .country-results button:hover { background: #eaf3fb; }
#quote-form .country-results > div { padding: 12px; font-size: 13px; }
#main button:focus-visible, #main summary:focus-visible, #home-calculator button:focus-visible { outline: 3px solid #8ab7e0; outline-offset: 3px; }
@media (max-width: 1100px) {
  #main .quote-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; }
  #main .offer-table th, #main .offer-table td { padding: 12px 8px; }
  #main .offer-provider { min-width: 155px; gap: 8px; }
  #main .offer-provider .brand { min-width: 54px; font-size: 14px; }
  #quote-form { padding: 18px; }
}
@media (max-width: 850px) {
  #main.site-container { width: calc(100% - 28px); margin-top: 18px; }
  #main .quote-layout { grid-template-columns: minmax(0, 1fr); }
  #main .calculator-column { grid-row: 1; }
  #main h1 { font-size: 26px; }
  #main .order-steps { margin: 16px 0 22px; }
  #main .offer-table { min-width: 620px; }
}
@media (max-width: 480px) {
  #quote-form { padding: 16px; }
  #quote-form .grid { gap: 12px 10px; }
  #quote-form input:not([type='hidden']):not([type='checkbox']), #quote-form select { font-size: 16px; }
  #main .order-steps li { font-size: 12px; padding: 10px 3px; }
  #main .sg-alternative-card { padding: 16px; }
  #main .sg-alternative-card h3 { padding-right: 0; padding-top: 36px; font-size: 18px; }
  #main .sg-alternative-card::after { top: 14px; right: auto; left: 16px; }
}

/* Papildu paku pievienošana */
#quote-form .sg-add-package-row {
    margin: 5px 0 8px;
}

#quote-form button.sg-add-package {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 3px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #3c63a4;
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    text-transform: none;
    cursor: pointer;
}

#quote-form .sg-add-package > span:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border: 1px solid #cbd7ed;
    border-radius: 50%;
    background: #edf2fc;
    color: #3c63a4;
    font-size: 19px;
    line-height: 1;
}

#quote-form button.sg-add-package:hover:not(:disabled) {
    background: transparent;
    color: #24487f;
    box-shadow: none;
}

#quote-form .sg-add-package:hover:not(:disabled) > span:first-child {
    border-color: #3c63a4;
    background: #e1eafb;
}

#quote-form button.sg-add-package:disabled {
    background: transparent;
    color: #8792a5;
    opacity: 0.6;
    cursor: default;
}

#quote-form button.sg-add-package:focus-visible,
#quote-form button.sg-remove-package:focus-visible {
    outline: 2px solid #6487c5;
    outline-offset: 3px;
}

#quote-form .sg-package-hint:not([hidden]) {
    display: block;
    margin-top: 5px;
    color: #788397;
    font-size: 11px;
    line-height: 1.4;
}

/* Papildu pakas */
#quote-form .sg-extra-package {
    margin: 6px 0;
    padding-bottom: 0px;
    border-bottom: 1px solid #dce2ef;
}

#quote-form .sg-extra-package-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 3px;
}

#quote-form .sg-extra-package-title {
    color: #243d64;
    font-size: 13px;
}

#quote-form button.sg-remove-package {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    color: #7b879b;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

#quote-form button.sg-remove-package:hover {
    background: #fcecec;
    color: #bd4242;
}

#quote-form .sg-extra-package-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
}

#quote-form .sg-extra-package-fields label {
    min-width: 0;
}

#quote-form .sg-extra-package-fields input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

@media (max-width: 480px) {
    #quote-form .sg-extra-package-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
