/* ========== CHECKOUT FORM (Popup) ========== */

/* Shipping Address Popup */
.popup-shipping-address .page-content {
    padding: 12px 10px 24px;
    background-color: #f5f7fa;
}
.popup-shipping-address .navbar-inner .center {
    color: #fff !important;
    font-weight: 600;
}

/* Card */
.checkout-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,.06);
    overflow: hidden;
}

/* Header */
.checkout-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #f0f0f0;
}
.checkout-back {
    font-size: 14px;
    color: #2ca652;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}
.checkout-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    flex: 1;
}

/* Form Body */
.checkout-body {
    padding: 20px;
    display: grid;
    gap: 16px;
}

.checkout-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.checkout-label {
    font-size: 13px;
    font-weight: 600;
    color: #444;
}

.checkout-required {
    color: #e74c3c;
}

.checkout-input,
.checkout-select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e0e4e8;
    border-radius: 12px;
    font-size: 15px;
    color: #1a1a1a;
    background: #fff;
    outline: none;
    transition: border-color .2s;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}
.checkout-input:focus,
.checkout-select:focus {
    border-color: #2ca652 !important;
    box-shadow: 0 0 0 3px rgba(44,166,82,.1) !important;
    background: #fff !important;
}
/* override Framework7 .theme-green select styling */
.checkout-select,
.checkout-input {
    background-color: #fff !important;
    color: #1a1a1a !important;
}
.checkout-input::placeholder {
    color: #b0b8c1;
}

.checkout-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%23999'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* 2-column row */
.checkout-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Submit Button — !important เพื่อ override .theme-green a { color: #4caf50 } ของ Framework7 */
.checkout-submit-btn {
    display: block;
    width: calc(100% - 40px);
    margin: 4px 20px 20px;
    padding: 14px;
    background: #2ca652 !important;
    color: #fff !important;
    text-align: center;
    border: none;
    border-radius: 28px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
}
.checkout-submit-btn:active {
    background: #249a47 !important;
    color: #fff !important;
}

/* ========== ORDER SUMMARY (Popup) ========== */

.popup-order-summary .page-content {
    padding: 12px 10px 24px;
    background-color: #f5f7fa;
}
.popup-order-summary .navbar-inner .center {
    color: #fff !important;
    font-weight: 600;
}

.order-summary-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,.06);
    overflow: hidden;
}

.order-summary-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}
.order-summary-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.order-summary-section {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}
.order-summary-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.order-summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}
.order-summary-item + .order-summary-item {
    border-top: 1px solid #f5f5f5;
}
.order-summary-item-img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
.order-summary-item-info {
    flex: 1;
    min-width: 0;
}
.order-summary-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.order-summary-item-detail {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}
.order-summary-item-price {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    white-space: nowrap;
}

.order-summary-address {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}

.order-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}
.order-summary-total-price {
    font-size: 20px;
    font-weight: 700;
    color: #2ca652;
}

/* ========== ORDERING GUIDE (Guest) ========== */

.guide-card {
    margin: 16px 12px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,.06);
    overflow: hidden;
}

.guide-header {
    text-align: center;
    padding: 28px 20px 20px;
    background: linear-gradient(135deg, #2ca652 0%, #1e8a3e 100%);
    color: #fff;
}
.guide-logo-wrap {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.guide-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}
.guide-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px;
}
.guide-subtitle {
    font-size: 13px;
    margin: 0;
    opacity: .85;
}

.guide-section-title {
    padding: 16px 20px 0;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
}

.guide-steps {
    padding: 12px 20px 4px;
}
.guide-step {
    display: flex;
    gap: 14px;
    padding: 12px 0;
}
.guide-step + .guide-step {
    border-top: 1px solid #f0f0f0;
}
.guide-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e8f5e9;
    color: #2ca652;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.guide-step-body {
    flex: 1;
    min-width: 0;
}
.guide-step-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
}
.guide-step-desc {
    font-size: 12.5px;
    color: #666;
    line-height: 1.5;
}

.guide-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 0 20px;
}

.guide-login-section {
    padding: 16px 20px 20px;
    text-align: center;
}
.guide-login-text {
    font-size: 13px;
    color: #888;
    margin: 0 0 12px;
}
.guide-login-btn {
    display: inline-block;
    padding: 12px 40px;
    background: #2ca652 !important;
    color: #fff !important;
    border-radius: 28px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
}
.guide-login-btn:active {
    background: #249a47 !important;
    color: #fff !important;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .checkout-field-row {
        grid-template-columns: 1fr;
    }
    .checkout-body {
        padding: 16px;
    }
    .checkout-submit-btn {
        width: calc(100% - 32px);
        margin: 4px 16px 16px;
    }
}
