/* Bakery Order Manager - Frontend Styles */

.bom-order-form-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.bom-form-title {
    margin-top: 0;
    margin-bottom: 30px;
    color: #222;
    font-size: 28px;
    text-align: center;
    font-weight: 600;
}

.bom-order-form {
    width: 100%;
}

.bom-form-row {
    margin-bottom: 24px;
}

.bom-form-row-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.bom-form-field {
    display: flex;
    flex-direction: column;
}

.bom-form-field label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #222;
    font-size: 14px;
}

.bom-form-field .required {
    color: #e74c3c;
    margin-left: 3px;
}

.bom-form-field .optional {
    color: #95a5a6;
    font-weight: 400;
    font-size: 12px;
    margin-left: 5px;
}

.bom-form-field input[type="text"],
.bom-form-field input[type="email"],
.bom-form-field input[type="tel"],
.bom-form-field input[type="number"],
.bom-form-field select,
.bom-form-field textarea {
    padding: 12px 16px;
    border: 1px solid #b0b0b0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.bom-form-field input:focus,
.bom-form-field select:focus,
.bom-form-field textarea:focus {
    outline: none;
    border-color: #222;
    box-shadow: 0 0 0 1px #222;
}

.bom-form-field textarea {
    resize: vertical;
    min-height: 120px;
}

/* Customer Type Selector (Radio Buttons) */
.bom-customer-type-selector {
    display: flex;
    gap: 12px;
}

.bom-radio-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bom-radio-option input[type="radio"] {
    display: none;
}

.bom-radio-option .bom-radio-label {
    font-weight: 500;
    font-size: 15px;
    color: #222;
}

.bom-radio-option:hover {
    border-color: #222;
}

.bom-radio-option.active {
    border-color: #222;
    background: #f7f7f7;
}

/* Business Fields */
#bom-business-fields {
    animation: slideDown 0.3s ease;
}

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

/* Airbnb-Style Date/Time Picker */
.bom-datetime-wrapper {
    position: relative;
}

.bom-datetime-display {
    display: flex;
    border: 1px solid #b0b0b0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bom-datetime-display:hover {
    border-color: #222;
}

.bom-datetime-display.active {
    border-color: #222;
    box-shadow: 0 0 0 1px #222;
}

.bom-datetime-section {
    flex: 1;
    padding: 12px 16px;
}

.bom-datetime-section label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #222;
    margin-bottom: 4px;
}

.bom-datetime-value {
    font-size: 15px;
    color: #717171;
}

.bom-datetime-value.selected {
    color: #222;
}

.bom-datetime-divider {
    width: 1px;
    background: #ddd;
}

/* Calendar Popup */
.bom-calendar-popup {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    padding: 24px;
    z-index: 1000;
}

.bom-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.bom-calendar-title {
    font-size: 16px;
    font-weight: 600;
    color: #222;
}

.bom-calendar-nav {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.bom-calendar-nav:hover {
    background: #f7f7f7;
}

.bom-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 20px;
}

.bom-calendar-day-header {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #717171;
    padding: 8px;
}

.bom-calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.bom-calendar-day:not(.disabled):not(.outside-month):hover {
    background: #f7f7f7;
}

.bom-calendar-day.disabled {
    color: #ddd;
    cursor: not-allowed;
}

.bom-calendar-day.outside-month {
    color: #ddd;
}

.bom-calendar-day.selected {
    background: #222;
    color: #fff;
    font-weight: 600;
}

.bom-calendar-day.today {
    border: 1px solid #222;
}

/* Time Selector */
.bom-time-selector {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.bom-time-selector h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #222;
}

.bom-time-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.bom-time-slot {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.bom-time-slot:hover:not(.disabled) {
    border-color: #222;
    background: #f7f7f7;
}

.bom-time-slot.selected {
    border-color: #222;
    background: #222;
    color: #fff;
    font-weight: 600;
}

.bom-time-slot.disabled {
    color: #ddd;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* Calendar Actions */
.bom-calendar-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
}

.bom-btn-primary,
.bom-btn-secondary {
    flex: 1;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.bom-btn-primary {
    background: #222;
    color: #fff;
}

.bom-btn-primary:hover {
    background: #000;
}

.bom-btn-secondary {
    background: #fff;
    color: #222;
    border: 1px solid #222;
}

.bom-btn-secondary:hover {
    background: #f7f7f7;
}

/* Submit Button */
.bom-submit-button {
    width: 100%;
    padding: 16px 30px;
    background: linear-gradient(to right, #e61e4d 0%, #e31c5f 50%, #d70466 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.bom-submit-button:hover {
    transform: scale(1.02);
}

.bom-submit-button:active {
    transform: scale(0.98);
}

.bom-submit-button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

.bom-notice {
    text-align: center;
    margin-top: 12px;
    font-size: 14px;
    color: #717171;
}

/* Messages */
.bom-form-messages {
    margin-bottom: 20px;
}

.bom-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 14px;
}

.bom-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.bom-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.bom-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Loading state */
.bom-order-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

.bom-order-form.loading .bom-submit-button::after {
    content: "...";
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60%, 100% { content: "..."; }
}

/* Responsive */
@media (max-width: 768px) {
    .bom-order-form-wrapper {
        padding: 16px;
        border-radius: 8px;
    }
    
    .bom-form-row-two-col {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .bom-form-title {
        font-size: 24px;
    }
    
    .bom-calendar-popup {
        padding: 16px;
    }
    
    .bom-time-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .bom-datetime-display {
        flex-direction: column;
    }
    
    .bom-datetime-divider {
        width: 100%;
        height: 1px;
    }
}
