/* ===== Global style reset ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== Global fonts and background ===== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    height: 100vh;
    color: #1F2937;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
}

/* ===== 3D scene area - full-screen background ===== */
.output-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    z-index: 1;
    overflow: hidden;
}

/* ===== 3D scene container ===== */
#scene-container {
    position: absolute;
    top: 0;
    left: 0;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* ===== Right-side function panel - default expanded state on mobile ===== */
.panel {
    position: fixed;
    top: 0;
    right: 5px;
    width: calc(85% - 5px);
    min-width: 280px;
    max-width: 395px;
    height: 100%;
    padding: 16px;
    background: transparent;
    overflow-y: auto;
    font-size: 12px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease, width 0.3s ease;
    pointer-events: none;
}

.panel .info-label,
.panel #calculateBtn,
.panel .confirm-btn,
.panel .close-popup-btn {
    pointer-events: auto;
}

/* Only content outside of the popup area disables pointer-events */
.panel *:not(.info-label):not(#calculateBtn):not(.confirm-btn):not(.close-popup-btn):not(.content-toggle):not(.content-toggle *) {
    pointer-events: none;
}

/* Ensure all elements inside the popup can interact normally */
.content-toggle {
    pointer-events: auto !important;
}

.content-toggle * {
    pointer-events: auto !important;
}

/* Collapsed state - only takes effect on desktop */
@media (min-width: 640px) {
    .panel.collapsed {
        right: -100%;
        box-shadow: -6px 0 24px rgba(0, 0, 0, 0.3);
    }
}

/* Desktop styles */
@media (min-width: 640px) {
    .panel {
        right: 0;
        width: 20%;
        min-width: 200px;
        max-width: 400px;
        padding: 16px;
        font-size: 12px;
    }
}

/* Overlay layer - displayed when the popup is shown */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9;
    backdrop-filter: blur(4px);
}

.overlay.active {
    display: block;
}

/* ===== Commented out - legacy panel collapse functionality =====
/* Collapse toggle button */
/* .toggle-panel-btn {
    display: none;
    position: fixed;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    z-index: 11;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    padding: 0;
}

.toggle-panel-btn:hover {
    background: white;
    width: 50px;
}

.toggle-panel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.toggle-panel-btn svg {
    width: 20px;
    height: 20px;
    fill: #4F46E5;
    transition: transform 0.3s ease;
}

.toggle-panel-btn.expanded svg {
    transform: rotate(180deg);
} */ 

.panel .box-info,
.panel .product-info,
.panel input,
.panel .box-weight,
.panel .box-volume {
    background: rgba(255, 255, 255, 0.15) !important;
}

.panel .product-table th {
    background: rgba(79, 70, 229, 0.6) !important;
}

/* ===== Title styles ===== */
.panel h1 {
    text-align: right;
    margin-bottom: 10px;
    color: #374151;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: normal;
    line-height: 1.4;
}

.panel h2 {
    margin-bottom: 10px;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ===== Top-right info panel container ===== */
.info-panels {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 5;
}

/* ===== Info panel styles ===== */
.info-panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 240px;
    overflow: hidden;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.info-panel .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
    border-bottom: 1px solid #C7D2FE;
}

.info-panel .panel-header h3 {
    margin: 0;
    color: #4338CA;
    font-size: 14px;
    font-weight: 600;
}

.info-panel .panel-content {
    padding: 12px 16px;
}

.info-panel .panel-content p {
    margin: 6px 0;
    color: #4B5563;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

/* ===== Close button ===== */
.close-panel-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    color: #64748B;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-panel-btn:hover {
    background: rgba(148, 163, 184, 0.4);
    color: #334155;
}

/* ===== PDF button panel ===== */
.info-panel.pdf-panel {
    min-width: auto;
    padding: 8px;
    background: rgba(255, 255, 255, 0.98);
}

.info-panel.pdf-panel .export-pdf-btn {
    margin: 0;
}

/* ===== Export PDF button ===== */
.export-pdf-container {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #E5E7EB;
    display: flex;
    justify-content: center;
}

.export-pdf-btn {
    width: 100%;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.export-pdf-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.export-pdf-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.pdf-icon {
    font-size: 14px;
}

.total-info span {
    font-weight: 600;
    color: #4338CA;
}

/* ===== Info display area styles ===== */
.info-display {
    margin-bottom: 12px;
    padding: 10px 12px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 8px;
    border-left: 3px solid #6366F1;
}

.info-display:last-of-type {
    margin-bottom: 12px;
}

.info-display h3 {
    margin: 0 0 8px 0;
    font-size: 11px;
    font-weight: 600;
    color: #6366F1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-display p {
    margin: 4px 0;
    font-size: 11px;
    color: #4B5563;
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.info-display span {
    font-weight: 600;
    color: #4338CA;
}

/* ===== Product list styles ===== */
.product-list {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #D1D5DB;
    max-height: 120px;
    overflow-y: auto;
}

.product-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    font-size: 10px;
}

.product-item:last-child {
    margin-bottom: 0;
}

.product-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.product-name {
    font-weight: 600;
    color: #374151;
    min-width: 20px;
}

.product-spec {
    color: #6B7280;
    flex: 1;
}

.product-qty {
    font-weight: 600;
    color: #6366F1;
}

.panel h2::before {
    content: '';
    width: 3px;
    height: 13px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    border-radius: 2px;
}

/* ===== Card styles ===== */
.box-info, .product-info {
    margin-bottom: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

/* ===== Input group layout ===== */
.input-group {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.input-group .row {
    display: flex;
    gap: 6px;
    width: 100%;
    margin-bottom: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.input-group label {
    width: auto;
    min-width: 60px;
    font-weight: 500;
    margin-right: 3px;
    color: #4B5563;
    font-size: 11px;
}

/* ===== Form row styles - each row displays one piece of info ===== */
.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #F3F4F6;
}

.form-row.sub-row {
    padding-top: 4px;
    padding-bottom: 4px;
    border-bottom: none;
}

.form-row label {
    font-size: 12px;
    font-weight: 500;
    color: #4B5563;
    min-width: 100px;
}

.form-row input {
    padding: 6px 10px;
    border: 1.5px solid #E5E7EB;
    border-radius: 6px;
    width: 120px;
    text-align: right;
    font-size: 12px;
    font-weight: 500;
    background: white;
    color: #1F2937;
    transition: all 0.2s ease;
}

.form-row input:focus {
    outline: none;
    border-color: #6366F1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-row span {
    font-size: 12px;
    font-weight: 600;
    color: #6366F1;
    min-width: 120px;
    text-align: right;
}

/* ===== Unit input group ===== */
.unit-input-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.unit-input-group input {
    width: 90px;
    padding: 6px 8px;
}

.unit-input-group .unit {
    font-size: 11px;
    font-weight: 500;
    color: #6B7280;
    min-width: auto;
    text-align: left;
}

/* ===== Form action area ===== */
.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #E5E7EB;
}

/* ===== Confirm button styles ===== */
.confirm-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white !important;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-right: 10px;
}

/* ===== Reset button styles ===== */
.reset-btn {
    padding: 10px 20px;
    background: #F3F4F6;
    color: #6B7280;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-btn:hover {
    background: #E5E7EB;
    color: #374151;
}

/* ===== Reset all button styles - commented out ===== */
/* .reset-all-btn {
    padding: 12px 24px;
    background: #EF4444;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.reset-all-btn:hover {
    background: #DC2626;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
} */

/* ===== Input field styles ===== */
.input-group input {
    padding: 5px 6px;
    border: 1.5px solid #E5E7EB;
    border-radius: 5px;
    width: 75px;
    display: inline-block;
    text-align: right;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: rgba(250, 250, 250, 0.9);
    color: #1F2937;
}

.input-group input:focus {
    outline: none;
    border-color: #6366F1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: white;
}

/* ===== Calculated field styles (no border) ===== */
.box-weight, .box-volume {
    padding: 5px 6px;
    border: none;
    border-radius: 5px;
    width: 70px;
    display: inline-block;
    text-align: right;
    font-size: 11px;
    font-weight: 600;
    background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
    color: #4338CA;
}

/* ===== Product table styles ===== */
.product-info {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.product-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.product-table th, .product-table td {
    padding: 6px 4px;
    text-align: center;
    font-size: 10px;
    vertical-align: top;
}

.product-table th {
    background: linear-gradient(135deg, #4F46E5, #6366F1);
    color: white;
    font-weight: 600;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.product-table td {
    border-bottom: 1px solid #F3F4F6;
    background: white;
}

.product-table tbody tr:hover td {
    background: #F9FAFB;
}

.product-table tbody tr:last-child td {
    border-bottom: none;
}

.product-table input[type="number"] {
    width: 42px;
    padding: 4px 3px;
    border: 1.5px solid #E5E7EB;
    border-radius: 4px;
    font-size: 10px;
    text-align: center;
    transition: all 0.2s ease;
    background: rgba(250, 250, 250, 0.9);
}

.product-table input[type="number"]:focus {
    outline: none;
    border-color: #6366F1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: white;
}

/* Unit rows in the product table */
.product-table .unit-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    margin-bottom: 2px;
}

.product-table .unit-row:last-child {
    margin-bottom: 0;
}

.product-table .unit-row .unit {
    font-size: 8px;
    font-weight: 500;
    color: #6B7280;
    min-width: 25px;
}

/* ===== Statistics info card ===== */
.total-info {
    margin-top: auto;
    padding: 12px;
    background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
    border-radius: 8px;
    border: 1px solid #C7D2FE;
    flex-shrink: 0;
}

.total-info h2 {
    color: #4338CA;
    font-size: 12px;
}

.total-info p {
    margin-bottom: 6px;
    font-weight: 600;
    color: #4338CA;
    font-size: 11px;
}

.total-info p:last-child {
    margin-bottom: 0;
}

/* ===== Calculate button styles ===== */
#calculateBtn {
    padding: 10px 24px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 12px;
    box-shadow: 0 3px 14px rgba(99, 102, 241, 0.35);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: fixed;
    right: 20px;
    bottom: 15%;
    z-index: 101;
}

#calculateBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(99, 102, 241, 0.45);
}

#calculateBtn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

#calculateBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ===== Volume hint styles ===== */
.volume-hint {
    display: none;
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    animation: fadeIn 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    min-width: 200px;
    text-align: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.volume-hint.consistent {
    background: rgba(16, 185, 129, 0.9);
    color: white;
}

.volume-hint.insufficient {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

/* ===== Remaining space info ===== */
#remaining-space {
    position: fixed !important;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%) !important;
    padding: 16px 20px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 9999 !important;
    min-width: 200px;
    max-width: calc(100% - 40px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    height: auto;
    display: none;
}

#remaining-space h3 {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #1F2937;
    padding-bottom: 6px;
    border-bottom: 1px solid #E5E7EB;
}

#remaining-space p {
    font-size: 10px;
    margin-bottom: 4px;
    color: #6B7280;
}

#remaining-space p:last-child {
    margin-bottom: 0;
}

#remaining-space p span {
    font-weight: 600;
    color: #4F46E5;
}

/* ===== Calculating indicator ===== */
#calculating-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6366F1;
    font-weight: 600;
    font-size: 11px;
    position: relative;
    z-index: 101;
}

#calculating-indicator::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid #6366F1;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Conversion row ===== */
.conversion-row {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.conversion-item {
    font-size: 10px;
    color: #6B7280;
    white-space: nowrap;
}

.conversion-item input {
    width: 50px;
    padding: 3px 4px;
    border: 1px solid #E5E7EB;
    border-radius: 4px;
    font-size: 10px;
    text-align: right;
    background: rgba(250, 250, 250, 0.9);
}

.conversion-item input:focus {
    outline: none;
    border-color: #6366F1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
    background: white;
}

/* ===== Scrollbar styling ===== */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: rgba(241, 245, 249, 0.5);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* ===== Container type selector ===== */
.container-type-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.container-type-btn {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    background: white;
    font-size: 12px;
    font-weight: 500;
    color: #4B5563;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.container-type-btn:hover {
    border-color: #6366F1;
    color: #6366F1;
}

.container-type-btn.active {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    border-color: #6366F1;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.container-type-btn:active {
    transform: scale(0.98);
}

/* ===== Bottom tab bar styles ===== */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #FFFFFF;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    z-index: 100;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
}

.tab-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    align-items: center;
    position: relative;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 56px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 4px 0;
}

.tab-item:hover {
    background: rgba(99, 102, 241, 0.05);
}

.tab-item.active {
    background: rgba(99, 102, 241, 0.08);
}

.tab-icon {
    font-size: 20px;
    margin-bottom: 2px;
    transition: transform 0.3s ease;
}

.tab-item.active .tab-icon {
    transform: scale(1.1);
}

.tab-text {
    font-size: 11px;
    font-weight: 500;
    color: #6B7280;
    transition: color 0.3s ease;
}

.tab-item.active .tab-text {
    color: #6366F1;
    font-weight: 600;
}

.tab-sub-item {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 34px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 2px 8px;
    background: rgba(239, 68, 68, 0.08);
    border-top: 1px solid rgba(239, 68, 68, 0.15);
}

.tab-sub-item:hover {
    background: rgba(239, 68, 68, 0.15);
}

.tab-icon-small {
    font-size: 14px;
    margin-right: 4px;
}

.tab-text-small {
    font-size: 10px;
    font-weight: 500;
    color: #EF4444;
}

/* ===== Bottom tab status styles ===== */
/* Default white */
.tab-item {
    background: #FFFFFF;
}

/* Confirmed green - text turns green */
.tab-item.confirmed .tab-text {
    color: #10B981;
}

/* Calculate plan ochre color */
.tab-item.calculate-ready {
    background: #D97706;
}

/* ===== Popup styles ===== */
.content-toggle {
    display: none;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    padding: 20px;
    padding-top: 50px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    overflow-y: auto;
    animation: fadeInScale 0.3s ease;
    flex: none !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    margin: 0 !important;
    will-change: transform, opacity;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Close button */
.close-popup-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: #F3F4F6;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    color: #6B7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-popup-btn:hover {
    background: #E5E7EB;
    color: #374151;
}

/* Display the popup when the corresponding radio is selected */
#box-toggle:checked ~ .box-info .content-toggle,
#product-toggle:checked ~ .product-info .content-toggle {
    display: block;
}

/* Display the overlay when the popup is shown */
#box-toggle:checked ~ .overlay,
#product-toggle:checked ~ .overlay {
    display: block;
}

/* ===== Custom confirmation dialog styles ===== */
.confirm-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.confirm-modal-overlay.show {
    display: flex;
}

.confirm-modal {
    background: white;
    border-radius: 16px;
    padding: 24px;
    min-width: 280px;
    max-width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeInScale 0.3s ease;
    text-align: center;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.confirm-modal .modal-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F59E0B, #D97706);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.confirm-modal h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 8px;
}

.confirm-modal p {
    font-size: 13px;
    color: #6B7280;
    margin-bottom: 20px;
}

.confirm-modal .modal-actions {
    display: flex;
    gap: 12px;
}

.confirm-modal .modal-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.confirm-modal .modal-btn.cancel {
    background: #F3F4F6;
    color: #6B7280;
}

.confirm-modal .modal-btn.cancel:hover {
    background: #E5E7EB;
}

.confirm-modal .modal-btn.confirm {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.confirm-modal .modal-btn.confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}