:root {
    --primary-blue: #4285f4;
    --primary-blue-dark: #1a73e8;
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --text-primary: #333;
    --text-secondary: #666;
    --border-color: #e8eaed;
    --shadow-color: rgba(0, 0, 0, 0.06);
    --shadow-color-hover: rgba(0, 0, 0, 0.12);
    --shadow-color-btn: rgba(66, 133, 244, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.process-icon {
    width: 21px;
    height: 21px;
    margin-right: 6px;
    vertical-align: middle;
}

.cart-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: var(--card-background);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.cart-header h1 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 8px;
}

.cart-header p {
    font-size: 16px;
    color: var(--text-secondary);
}

.btn {
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
    color: white;
    box-shadow: 0 2px 8px var(--shadow-color-btn);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-blue-dark), #1557b0);
    transform: translateY(-1px);
}

.cart-main {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.cart-items-section {
    flex: 1;
    min-width: 0; 
}

.order-summary-section {
    flex-basis: 350px; 
    position: sticky;
    top: 20px;
}

.cart-items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.cart-items-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.clear-cart-btn {
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.cart-item, .order-summary-card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.cart-item:not(:last-child) {
    margin-bottom: 24px;
}

.cart-item:hover, .order-summary-card:hover {
    box-shadow: 0 4px 20px var(--shadow-color-hover);
    transform: translateY(-2px);
}

.item-main-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.item-description h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.item-title-row { display: flex; align-items: center; gap: 10px; }
.item-select-checkbox { width: 18px; height: 18px; }

.item-description p {
    font-size: 14px;
    color: var(--text-secondary);
}

.item-controls {
    display: flex;
    align-items: center;
    gap: 24px;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}
.quantity-btn {
    background: none; border: none; padding: 6px 12px; font-size: 18px; cursor: pointer; color: var(--text-primary);
}
.quantity-input {
    width: 40px; text-align: center; border: none; border-left: 1px solid var(--border-color); border-right: 1px solid var(--border-color);
    font-size: 14px; padding: 6px 0; background-color: var(--background-color);
}
.quantity-input:focus { outline: none; }


.item-price { text-align: right; }
.item-price .price-total { font-size: 18px; font-weight: 600; }
.item-price .price-per-unit { font-size: 14px; color: var(--text-secondary); }

.delete-btn { background: none; border: none; cursor: pointer; color: var(--text-secondary); font-size: 24px; transition: color 0.2s ease; }
.delete-btn:hover { color: #c62828; }

.item-details-toggle {
    background: none; border: none; color: var(--primary-blue); cursor: pointer; font-size: 14px; padding: 8px 0 0;
    font-weight: 500; display: flex; align-items: center; margin-top: 16px;
}
.item-details-toggle .arrow { transition: transform 0.3s ease; display: inline-block; margin-left: 8px; }
.item-details-toggle.collapsed .arrow { transform: rotate(-180deg); }

.item-details-content {
    display: none; 
    border-top: 1px solid var(--border-color);
    margin-top: 16px;
    padding-top: 16px;
}
.item-details-content.open {
    display: block; 
}

.detail-row {
    display: grid;
    grid-template-columns: minmax(140px, 3fr) 20px 100px 80px minmax(220px, 3fr);
    align-items: center;
    column-gap: 16px;
    padding: 8px 6px;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}
.detail-row:last-child { border-bottom: none; }
.detail-row span:first-child { color: var(--text-primary); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-row span:nth-child(2) { justify-self: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.detail-row span:nth-child(3) { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 640px) {
    .detail-row {
        grid-template-columns: 1fr 70px;
        row-gap: 4px;
        padding: 8px 0;
    }
    .detail-row span:nth-child(3) {
        grid-column: 1 / -1;
        white-space: normal;
    }
}

.order-summary-card h2 {
    font-size: 24px; font-weight: 600; margin-bottom: 24px;
}
.summary-row {
    display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 16px;
}
.summary-row.total {
    font-size: 20px; font-weight: 600; border-top: 1px solid var(--border-color);
    padding-top: 16px; margin-top: 16px;
}
.order-summary-card .btn {
    width: 100%; margin-top: 16px; justify-content: center;
}

.order-summary-card .btn:disabled {
    background: #cbd5e0;
    color: #64748b;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.order-phone-warning {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #fdba74;
    background: #fff7ed;
    color: #b45309;
    font-size: 13px;
    margin-top: 12px;
}

.order-phone-warning span:not(.order-phone-warning-icon) {
    font-size: smaller;
}

.order-phone-warning a {
    color: #c2410c;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    min-width: 75px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.order-phone-warning a:hover {
    text-decoration: underline;
}

.order-phone-warning-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fdba74;
    color: #7c2d12;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

@media (max-width: 992px) {
    .cart-main {
        flex-direction: column;
    }
    .order-summary-section {
        width: 100%;
        position: static;
    }
}
@media (max-width: 768px) {
    .cart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    .item-main-info {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
    .item-controls {
        margin-top: 16px;
        justify-content: space-between;
        width: 100%;
    }
}

.cart-message {
    margin-top: 8px;
    min-height: 18px;
    font-size: 14px;
    color: var(--text-secondary);
}
.cart-message.error { color: #c62828; }
.cart-message.success { color: #2e7d32; }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-overlay[hidden] { display: none; }

.modal-window {
    background: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    padding: 24px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    text-align: center;
}

.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border-color); }
.modal-header h3 { margin: 0; font-size: 18px; font-weight: 600; }
.modal-body { color: var(--text-primary); }
.modal-actions { display: flex; gap: 12px; justify-content: center; padding: 12px 20px 16px; }

.modal-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.modal-btn.danger {
    background-color: #999999;
    color: white;
}