:root {
    /* Color Palette */
    --primary: #8C5A35;       /* Coffee */
    --primary-light: #B87C53; /* Lighter Coffee */
    --primary-dark: #5C3A21;  /* Mocha */
    --accent: #E58B42;        /* Subtle Orange/Caramel */
    --bg-main: #FDFBF7;       /* Cream/Off-white */
    --bg-card: #FFFFFF;
    --text-main: #33261D;
    --text-muted: #7A695B;
    --border: #E8DECC;
    --error: #D34C4C;
    --success: #4CAF50;
    
    /* Variables */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 2px 8px rgba(140, 90, 53, 0.08);
    --shadow-md: 0 8px 24px rgba(140, 90, 53, 0.12);
    --shadow-lg: 0 16px 40px rgba(140, 90, 53, 0.16);
    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Prompt', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 600;
    color: var(--text-main);
}

.hidden {
    display: none !important;
}

/* Header & Hero */
.hero {
    position: relative;
    background: linear-gradient(135deg, #F3EAE0 0%, #FDFBF7 100%);
    padding: 2rem 1.5rem 3rem;
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: -1.5rem;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(229,139,66,0.1) 0%, rgba(229,139,66,0) 70%);
    border-radius: 50%;
    z-index: 0;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
    margin-bottom: 2rem;
}

.header-top h1 {
    font-size: 1.5rem;
    color: var(--primary-dark);
    letter-spacing: -0.5px;
}

.settings-icon {
    color: var(--text-muted);
    transition: var(--transition);
}

.settings-icon:hover {
    color: var(--primary);
    transform: rotate(45deg);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-image-placeholder {
    width: 140px;
    height: 140px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transform: rotate(-3deg);
    transition: var(--transition);
}

.hero-image-placeholder:hover {
    transform: rotate(0) scale(1.05);
}

.hero-content h2 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.price {
    font-size: 1.25rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 1rem;
}

.hero-badges {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.badge {
    background: rgba(140, 90, 53, 0.1);
    color: var(--primary);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.storage-note {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

/* Forms */
.order-form {
    position: relative;
    z-index: 2;
}

.form-section {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: transform var(--transition);
}

.form-section:hover {
    transform: translateY(-2px);
}

.form-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    color: var(--primary-dark);
}

.input-group {
    margin-bottom: 1.25rem;
}

.input-group:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.required {
    color: var(--error);
}

input[type="text"],
input[type="tel"],
input[type="password"],
textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: #FAFAFA;
    transition: var(--transition);
    outline: none;
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
textarea:focus {
    border-color: var(--primary);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(140, 90, 53, 0.1);
}

/* Product Selection */
.product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px dashed var(--border);
}

.product-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.product-info h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.product-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.quantity-control {
    display: flex;
    align-items: center;
    background: #F5EBE1;
    border-radius: 20px;
    padding: 0.25rem;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #FFFFFF;
    color: var(--primary);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.qty-btn:active {
    transform: scale(0.9);
}

.qty-input {
    width: 40px;
    text-align: center;
    border: none;
    background: transparent;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    padding: 0;
    -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Radio Cards */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-option {
    position: relative;
    display: block;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.radio-content {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: 
        "title fee"
        "time fee";
    padding: 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #FFFFFF;
    transition: var(--transition);
}

.delivery-title {
    grid-area: title;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.delivery-time {
    grid-area: time;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.delivery-fee {
    grid-area: fee;
    align-self: center;
    font-weight: 600;
    color: var(--primary);
}

.radio-option input[type="radio"]:checked + .radio-content {
    border-color: var(--primary);
    background: rgba(140, 90, 53, 0.05);
}

/* Payment Section */
.total-summary {
    background: #F9F4EE;
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.summary-row.grand-total {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed #DCCAB8;
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 0;
}

/* QR Code Display */
.qr-container {
    text-align: center;
    background: #FFFFFF;
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    animation: fadeIn 0.4s ease-out;
}

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

.qr-instruction {
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 1rem;
    font-weight: 500;
}

#qrcode {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
    padding: 10px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

#qrcode img {
    border-radius: 5px;
}

.account-name {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* File Upload */
.file-upload-wrapper {
    position: relative;
    width: 100%;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-upload-ui {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border: 1.5px dashed var(--primary-light);
    border-radius: var(--radius-sm);
    background: rgba(140, 90, 53, 0.02);
    color: var(--primary);
    transition: var(--transition);
}

.file-upload-wrapper:hover .file-upload-ui {
    background: rgba(140, 90, 53, 0.05);
}

.file-upload-ui svg {
    margin-bottom: 0.5rem;
}

.slip-preview {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    margin-top: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

/* Button */
.submit-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(140, 90, 53, 0.3);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.submit-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    transition: transform 0.5s;
}

.submit-btn:active::after {
    transform: translate(-50%, -50%) scale(1);
    transition: 0s;
}

.submit-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(140, 90, 53, 0.4);
}

.submit-btn:disabled {
    background: #CCC;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* Modals & Loaders */
.loader-overlay,
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(51, 38, 29, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s;
}

.loader-overlay.hidden,
.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #FFFFFF;
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 1rem;
}

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

.loader-overlay p {
    color: #FFFFFF;
    font-weight: 500;
}

.modal-content {
    background: var(--bg-main);
    padding: 2rem;
    border-radius: var(--radius-lg);
    max-width: 90%;
    width: 400px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.hidden .modal-content {
    transform: scale(0.9);
}

.success-icon {
    color: var(--success);
    margin-bottom: 1rem;
}

.modal-content h3 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}
