.package-calc {
    background-color: #050505;
    min-height: 100vh;
    padding: 130px 20px 80px 20px;
    font-family: 'Poppins', sans-serif;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.calc-bg-elements {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 0;
}
.calc-glow-top {
    position: absolute; top: -10%; right: -5%; width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(230, 0, 0, 0.15) 0%, transparent 60%);
    filter: blur(80px);
}
.calc-glow-bottom {
    position: absolute; bottom: 10%; left: -10%; width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.08) 0%, transparent 60%);
    filter: blur(80px);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

.calc-header { text-align: center; max-width: 800px; margin: 0 auto 50px auto; position: relative; z-index: 2;}
.calc-badges { display: flex; justify-content: center; gap: 15px; margin-bottom: 25px; flex-wrap: wrap;}
.header-badge, .rate-badge { display: inline-flex; align-items: center; gap: 8px; background: #1E1E1E; color: #888; border: 1px solid #333; padding: 6px 18px; border-radius: 20px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px;}
.rate-badge { color: #ccc; background: rgba(46, 204, 113, 0.05); border-color: rgba(46, 204, 113, 0.3);}
.rate-badge i { color: #2ecc71; font-size: 1rem;}
.header-title { font-size: clamp(2.5rem, 5vw, 3.5rem); font-weight: 900; margin-bottom: 15px; line-height: 1.1;}
.text-red { color: #E60000; }
.header-subtitle { color: #808080; font-size: 1.1rem; line-height: 1.6;}

.calc-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 40px; 
    max-width: 1300px; 
    margin: 0 auto; 
    position: relative; 
    z-index: 2;
}

.calc-panel {
    background: #121212; border: 1px solid #2C2C2C; border-radius: 24px; padding: 35px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
}

.panel-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; border-bottom: 1px solid #1E1E1E; padding-bottom: 15px;}
.panel-top h2 { font-size: 1.3rem; margin: 0; display: flex; align-items: center; gap: 10px;}
.panel-top h2 i { color: #E60000; }
.ai-status { font-size: 0.75rem; color: #aaa; background: #1a1a1a; padding: 4px 10px; border-radius: 12px; border: 1px solid #333;}
.text-green { color: #2ecc71; animation: pulseG 2s infinite;}
@keyframes pulseG { 0%, 100% {opacity:1;} 50% {opacity:0.4;}}

.input-wrapper label { display: block; font-size: 0.85rem; color: #888; margin-bottom: 10px; text-transform: uppercase; font-weight: 600;}
.multi-input-box { display: flex; gap: 15px; margin-bottom: 20px;}
.search-input-box { position: relative; margin-bottom: 0 !important; }
.search-input-box i { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: #666; font-size: 1.2rem;}
.search-input-box input { width: 100%; background: #0a0a0a; border: 2px solid #222; color: #fff; padding: 20px 20px 20px 50px; border-radius: 16px; font-family: 'Poppins'; font-size: 1.05rem; transition: 0.3s; box-sizing: border-box;}
.search-input-box input:focus { border-color: #E60000; outline: none; box-shadow: 0 0 20px rgba(230,0,0,0.15);}

.item-name-box { flex: 5; }
.item-size-box { flex: 2; }
.item-weight-box { flex: 2; }
.item-weight-box input { border-color: rgba(230,0,0,0.3); background: rgba(230,0,0,0.02); }

@media (max-width: 768px) {
    .multi-input-box { flex-direction: column; gap: 15px; }
}

.qty-and-add { display: flex; gap: 20px; margin-bottom: 25px; margin-top: 15px; }
.qty-selector { display: flex; align-items: center; background: #0a0a0a; border: 1px solid #333; border-radius: 16px; overflow: hidden;}
.qty-selector button { background: transparent; border: none; color: #888; width: 50px; height: 55px; cursor: pointer; transition: 0.2s; font-size: 1.1rem;}
.qty-selector button:hover { background: #1E1E1E; color: #fff;}
.qty-selector input { width: 50px; text-align: center; background: transparent; border: none; color: #fff; font-size: 1.2rem; font-weight: 700; outline: none; font-family: 'Poppins'; pointer-events: none;}

.btn-add-glow { flex: 1; background: #E60000; color: #fff; border: none; border-radius: 16px; font-family: 'Poppins'; font-size: 1.1rem; font-weight: 700; text-transform: uppercase; cursor: pointer; transition: 0.3s; display: flex; justify-content: center; align-items: center; gap: 10px; box-shadow: 0 10px 20px rgba(230,0,0,0.2);}
.btn-add-glow:hover { background: #FF1A1A; transform: translateY(-3px); box-shadow: 0 15px 30px rgba(230,0,0,0.4);}
.btn-add-glow:disabled { background: #555; box-shadow: none; transform: none; cursor: not-allowed;}

.quick-tags { display: flex; flex-wrap: wrap; gap: 10px;}
.q-tag { background: #1E1E1E; border: 1px solid #333; color: #aaa; padding: 6px 14px; border-radius: 8px; font-size: 0.8rem; cursor: pointer; transition: 0.2s;}
.q-tag:hover { background: #E60000; color: #fff; border-color: #E60000;}

.receipt-panel { display: flex; flex-direction: column; background: linear-gradient(180deg, #121212 0%, #0a0a0a 100%);}
.receipt-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 2px dashed #2C2C2C; padding-bottom: 20px;}
.receipt-header h2 { font-size: 1.2rem; margin: 0; color: #ddd; display: flex; align-items: center; gap: 10px;}
.agent-brand { height: 28px; opacity: 0.8;}

.cart-container { flex: 1; min-height: 200px; max-height: 350px; overflow-y: auto; padding-right: 5px; display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px;}
.cart-container::-webkit-scrollbar { width: 5px; }
.cart-container::-webkit-scrollbar-track { background: transparent; }
.cart-container::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; }

.empty-state { text-align: center; color: #555; padding: 50px 0; display: flex; flex-direction: column; align-items: center; gap: 15px;}
.empty-state i { font-size: 3rem; opacity: 0.5;}

.cart-item { background: #1a1a1a; border: 1px solid #222; border-left: 3px solid #E60000; border-radius: 12px; padding: 15px; display: flex; justify-content: space-between; align-items: center; animation: slideIn 0.3s ease;}
@keyframes slideIn { from {opacity:0; transform:translateX(-20px);} to {opacity:1; transform:translateX(0);}}

.ci-left { display: flex; flex-direction: column; gap: 5px; flex: 1;}
.ci-name { font-weight: 600; font-size: 1rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px;}
.ci-meta-tags { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ci-source { font-size: 0.7rem; color: #888; display: flex; align-items: center; gap: 5px;}
.ci-source.ai { color: #FFD700; }

.ci-box-btn { 
    background: transparent; border: 1px solid #3498db; color: #3498db; 
    padding: 2px 8px; border-radius: 6px; font-size: 0.7rem; cursor: pointer; 
    transition: 0.2s; display: flex; align-items: center; gap: 4px; font-family: 'Poppins';
}
.ci-box-btn:hover { background: rgba(52, 152, 219, 0.1); }
.ci-box-btn.inactive { border-color: #555; color: #555; text-decoration: line-through; }
.ci-box-btn.inactive:hover { background: rgba(255,255,255,0.05); color: #888; text-decoration: none;}

.ci-box-input {
    background: transparent;
    border: none;
    color: inherit;
    font-family: monospace;
    font-size: 0.75rem;
    font-weight: bold;
    width: 32px;
    text-align: right;
    outline: none;
    cursor: text;
    transition: 0.3s;
}
.ci-box-input:focus {
    color: #fff;
    border-bottom: 1px solid #3498db;
}
.ci-box-btn.inactive .ci-box-input {
    pointer-events: none;
}

.ci-mid { display: flex; align-items: center; background: #050505; border: 1px solid #333; border-radius: 8px; overflow: hidden; margin: 0 15px;}
.ci-mid button { background: transparent; border: none; color: #888; width: 28px; height: 28px; cursor: pointer;}
.ci-mid button:hover { color: #fff; background: #222;}
.ci-mid span { width: 30px; text-align: center; font-size: 0.9rem; font-family: monospace; font-weight: bold;}

.ci-right { display: flex; align-items: center; gap: 10px; justify-content: flex-end;}
.ci-trash { background: transparent; border: none; color: #666; font-size: 1.1rem; cursor: pointer; transition: 0.2s;}
.ci-trash:hover { color: #E60000; transform: scale(1.1);}

.ci-weight-editor {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed transparent;
    border-radius: 6px;
    padding: 4px 8px;
    transition: all 0.3s ease;
    cursor: text;
}
.ci-weight-editor:hover, .ci-weight-editor:focus-within {
    border-color: #E60000;
    background: rgba(230, 0, 0, 0.08);
}
.inline-weight-input {
    background: transparent;
    border: none;
    color: #FFF;
    font-size: 1.1rem;
    font-weight: 800;
    font-family: 'Poppins', sans-serif;
    width: 65px;
    text-align: right;
    outline: none;
    padding: 0;
    margin-right: 5px;
    transition: 0.3s;
}
.inline-weight-input:focus { color: #E60000; }
.weight-unit { color: #888; font-size: 0.9rem; font-weight: 600; }

.receipt-summary { background: #050505; border-radius: 16px; padding: 20px; border: 1px solid #222; margin-bottom: 20px;}
.summary-line { display: flex; justify-content: space-between; align-items: center; font-size: 0.95rem; color: #888; margin-bottom: 8px;}
.weight-highlight { color: #fff; font-family: monospace; font-size: 1.1rem; background: #1E1E1E; padding: 4px 10px; border-radius: 6px;}

.price-base { font-family: monospace; font-size: 1.05rem; color: #aaa; text-decoration: line-through;}
.discount-line { color: #2ecc71; font-weight: 500; background: rgba(46, 204, 113, 0.05); padding: 5px 10px; border-radius: 6px; margin: 5px -10px;}
.price-discount { font-family: monospace; font-weight: 700; font-size: 1.1rem;}

.total-line { margin-top: 15px; padding-top: 15px; border-top: 1px solid #2C2C2C; align-items: flex-end;}
.price-stack { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2;}
.price-usd { font-size: 2rem; font-weight: 900; color: #E60000; font-family: 'Poppins';}
.price-pln { font-size: 0.9rem; color: #666; font-weight: 500;}

.referral-banner {
    display: flex; align-items: center; gap: 15px;
    background: linear-gradient(135deg, rgba(230,0,0,0.15) 0%, rgba(255,215,0,0.05) 100%);
    border: 1px solid rgba(230,0,0,0.3); border-radius: 16px;
    padding: 15px 20px; text-decoration: none; color: #fff;
    margin-bottom: 20px; transition: 0.3s;
}
.referral-banner:hover { border-color: #E60000; transform: translateY(-3px); box-shadow: 0 10px 25px rgba(230,0,0,0.2);}
.ref-icon-bg { width: 45px; height: 45px; background: rgba(230,0,0,0.2); border-radius: 12px; display: flex; justify-content: center; align-items: center; color: #E60000; font-size: 1.2rem; flex-shrink: 0;}
.ref-text { display: flex; flex-direction: column; flex: 1;}
.ref-text strong { font-size: 0.95rem; font-weight: 700;}
.ref-text span { font-size: 0.8rem; color: #aaa; margin-top: 3px;}
.referral-banner > i { color: #888; font-size: 1.1rem; transition: 0.2s;}
.referral-banner:hover > i { color: #E60000; transform: translateX(3px) translateY(-3px);}

.receipt-actions { display: flex; gap: 15px;}
.btn-icon { width: 55px; height: 55px; background: #1a1a1a; border: 1px solid #333; border-radius: 14px; color: #888; cursor: pointer; transition: 0.2s; font-size: 1.2rem;}
.btn-icon:hover { background: rgba(230,0,0,0.1); border-color: #E60000; color: #E60000;}
.btn-primary { flex: 1; background: #fff; color: #000; border: none; border-radius: 14px; font-family: 'Poppins'; font-weight: 800; font-size: 1.05rem; text-transform: uppercase; cursor: pointer; transition: 0.3s; display: flex; justify-content: center; align-items: center; gap: 10px;}
.btn-primary:hover { background: #e0e0e0; transform: translateY(-2px);}

.saved-packages-section {
    width: 100%;
    max-width: 1300px;
    margin: 40px auto 0 auto;
    position: relative;
    z-index: 2;
}

.saved-packages-container {
    background: #121212;
    border: 1px solid #2C2C2C;
    border-radius: 24px;
    padding: 35px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.saved-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2C2C2C;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.saved-header h2 { font-size: 1.5rem; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 12px; color: #fff;}
.saved-header h2 i { color: #E60000; }
.btn-text-danger { background: transparent; border: none; color: #888; font-family: 'Poppins'; text-decoration: underline; cursor: pointer; transition: 0.2s; font-size: 0.95rem; font-weight: 500;}
.btn-text-danger:hover { color: #E60000;}

.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.pkg-card { background: #0a0a0a; border: 1px solid #222; border-radius: 16px; padding: 25px; transition: 0.3s; position: relative; display: flex; flex-direction: column;}
.pkg-card:hover { border-color: #E60000; transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.5);}

.pkg-del { position: absolute; top: 15px; right: 15px; background: transparent; border: none; color: #666; font-size: 1.2rem; cursor: pointer; transition: 0.3s;}
.pkg-del:hover { color: #E60000; transform: scale(1.1);}

.pkg-date { font-size: 0.8rem; color: #666; margin-bottom: 15px; display: block;}
.pkg-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px dashed #222;}
.pkg-weight { font-family: monospace; font-size: 1.2rem; color: #fff; font-weight: bold; background: #1a1a1a; padding: 4px 10px; border-radius: 8px;}
.pkg-price { color: #E60000; font-size: 1.4rem; font-weight: 900;}

.pkg-items { font-size: 0.85rem; color: #aaa; margin-bottom: 20px; flex-grow: 1;}
.pkg-items div { margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
.pkg-items i { color: #666;}

.pkg-actions { margin-top: auto;}
.pkg-load { width: 100%; background: #1E1E1E; border: 1px solid #333; color: #fff; padding: 12px; border-radius: 8px; cursor: pointer; font-family: 'Poppins'; transition: 0.2s; font-weight: 600;}
.pkg-load:hover { background: #fff; color: #000;}

.scroll-anim { opacity: 0; transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.scroll-up { transform: translateY(40px); }
.scroll-left { transform: translateX(-40px); }
.scroll-right { transform: translateX(40px); }
.scroll-fade { transform: scale(0.95); }
.scroll-anim.is-in-view { opacity: 1; transform: translate(0) scale(1); }
.delay-1 { transition-delay: 0.2s; }

@media (max-width: 1024px) {
    .calc-grid { grid-template-columns: 1fr; }
    .package-calc { padding-top: 100px; }
}
/* --- NEW COMPACT CARRIERS UI & TOGGLE --- */
.toggle-line {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px dashed #222;
    color: #ccc;
    font-size: 0.9rem;
}

/* The Switch - Toggle */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #333; transition: .3s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; }
input:checked + .slider { background-color: #E60000; }
input:checked + .slider:before { transform: translateX(20px); }

.carriers-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.carrier-card {
    background: #0a0a0a;
    border: 1px solid #222;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: 0.3s;
}
.carrier-card:hover { background: #111; border-color: #333; }
.carrier-card.dhl-card { border-left: 3px solid #D40511; } 
.carrier-card.ems-card { border-left: 3px solid #FF8C00; } 

.carrier-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1a1a1a;
    padding-bottom: 8px;
}

.carrier-logo { height: 20px; object-fit: contain; }

.trust-badge {
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}
.trust-badge.safe { background: rgba(46, 204, 113, 0.08); color: #2ecc71; }
.trust-badge.warning { background: rgba(230, 0, 0, 0.08); color: #E60000; }

.carrier-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 4px;
}

.c-details { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: #888; }
.c-row { display: flex; justify-content: space-between; gap: 10px;}
.c-row span:last-child { font-family: monospace; font-weight: 600;}
.text-green { color: #2ecc71; }
.price-base { color: #888; text-decoration: line-through; }

.c-final { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.price-usd { font-size: 1.6rem; font-weight: 900; color: #E60000; font-family: 'Poppins'; }
.price-pln { font-size: 0.8rem; color: #666; font-weight: 500; }