:root {
    --primary: #27ae60;
    --primary-light: #ecfdf5;
    --bg-body: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --card-bg: #ffffff;
    --accent: #ef4444;
    --border: #e2e8f0;
}

* { box-sizing: border-box; transition: all 0.2s ease; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    line-height: 1.6;
}

header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 1rem 8%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.logo { font-weight: 800; color: var(--text-main); text-decoration: none; font-size: 1.5rem; }
.logo span { color: var(--primary); }
.back-link { text-decoration: none; color: var(--primary); font-weight: 600; font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }
.user-icon { text-decoration:none; color: var(--text-main); font-size: 1.2rem; display:flex; align-items:center; gap:6px; cursor: pointer; }
.user-icon i { font-size: 20px; }

.user-dropdown { position: relative; display: inline-block; }
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background: white;
    min-width: 150px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 8px;
    z-index: 1001;
    overflow: hidden;
}
.dropdown-content a {
    color: var(--text-main);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    margin: 0;
}
.dropdown-content a:hover { background: #f8fafc; }

.container {
    max-width: 1200px;
    margin: 0.5rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 2rem;
}

h1 { font-weight: 800; font-size: 1.8rem; margin: 0.2rem 0 1rem 0; grid-column: span 2; letter-spacing: -1px; }
h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 10px; }

.card {
    background: var(--card-bg);
    border-radius: 1.5rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    border: 1px solid var(--border);
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f1f5f9;
}
.cart-item:last-child { border-bottom: none; }
.product-img { width: 70px; height: 70px; object-fit: cover; border-radius: 1rem; }
.product-info { flex: 1; }
.product-name { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.product-price { color: var(--primary); font-weight: 700; font-size: 0.95rem; }
.qty-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 0.9rem;
}
.qty-controls button {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.qty-controls span {
    min-width: 18px;
    text-align: center;
    font-weight: 600;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.full-width { grid-column: span 2; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-size: 0.85rem; font-weight: 700; color: var(--text-main); }
.form-group input {
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    background: #fcfdfe;
}
.form-group input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px var(--primary-light); }

.payment-options { display: flex; flex-direction: column; gap: 10px; }
.payment-label {
    border: 1.5px solid var(--border);
    padding: 16px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 600;
}
.payment-label:hover { background: var(--bg-body); }
.payment-label input { width: 18px; height: 18px; accent-color: var(--primary); }
.payment-label.active { border-color: var(--primary); background: var(--primary-light); }

.summary-panel {
    background: #0f172a;
    color: white;
    border-radius: 2rem;
    padding: 2.5rem;
    height: fit-content;
    position: sticky;
    top: 6rem;
}
.summary-line { display: flex; justify-content: space-between; margin-bottom: 1.2rem; opacity: 0.8; font-size: 0.95rem; }
.total-line {
    margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.1);
    display: flex; justify-content: space-between; font-size: 1.5rem; font-weight: 800;
}
.btn-submit {
    width: 100%; background: var(--primary); color: white; border: none;
    padding: 1.2rem; border-radius: 1rem; font-weight: 700; font-size: 1.1rem;
    margin-top: 2rem; cursor: pointer; box-shadow: 0 10px 20px rgba(39, 174, 96, 0.2);
}
.btn-submit:hover { background: #2ecc71; transform: translateY(-2px); }

@media (max-width: 900px) {
    .container { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .full-width { grid-column: span 1; }
    .summary-panel { position: static; }
    h1 { grid-column: span 1; }
}