/* Custom CSS for MyApp */

/* Import Noto Sans Thai font */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;500;600;700&display=swap');

/* Override primary color */
:root {
    --bs-primary: #1A5AFA;
    --bs-primary-rgb: 26, 90, 250;
    --bs-primary-text-emphasis: #0a2563;
    --bs-primary-bg-subtle: #e3ebff;
    --bs-primary-border-subtle: #b8d0ff;
    --bs-font-sans-serif: "Noto Sans Thai", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
}

/* Apply font to body */
body {
    font-family: var(--bs-font-sans-serif);
}

/* Common Layout */
.fullscreen-step {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.step-main {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    background: #1a4ed0;
}

.step-content {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: var(--bs-white);
    padding: 2rem;
}

.step-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    color: #000000;
}

.step-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: var(--bs-body-color);
    margin-bottom: 2rem;
}

/* Footer */
.step-footer {
    background: var(--bs-white);
    padding: 1.5rem;
    border-top: 1px solid var(--bs-border-color);
    position: sticky;
    bottom: 0;
    z-index: 10;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.footer-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 200px;
}

/* Step 1 - Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--bs-body-color);
}

.next-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Step 2 - Product Items */
.category-info {
    background: var(--bs-light);
    padding: 1rem;
    border-radius: var(--bs-border-radius);
    margin-bottom: 2rem;
    text-align: center;
}

.category-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--bs-primary);
    margin-bottom: 0.5rem;
}

.selected-product {
    font-size: 1rem;
    color: var(--bs-body-color);
}

.product-item {
    background: var(--bs-white);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--bs-box-shadow-sm);
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.product-info {
    flex: 1;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--bs-heading-color);
    margin-bottom: 0.5rem;
}

.product-sku {
    font-size: 0.9rem;
    color: #2c2f32ff;
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 1rem;
    font-weight: 600;
    color: var(--bs-success);
}

.product-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.quantity-btn:hover {
    background: var(--bs-primary);
    color: var(--bs-white);
    border-color: var(--bs-primary);
}

.quantity-input {
    width: 60px;
    text-align: center;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    padding: 0.5rem;
}

.add-btn {
    margin-left: 1rem;
}

/* Step 3 - Bonus Items */
.bonus-item {
    background: var(--bs-white);
    border: 2px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.bonus-item:hover {
    border-color: var(--bs-primary);
    box-shadow: var(--bs-box-shadow);
}

.bonus-item.selected {
    border-color: var(--bs-primary);
}

.bonus-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.bonus-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--bs-heading-color);
    margin: 0;
}

.bonus-toggle {
    font-size: 1.5rem;
    color: var(--bs-primary);
    transition: transform 0.3s ease;
}

.bonus-toggle.rotated {
    transform: rotate(90deg);
}

.bonus-description {
    color: var(--bs-body-color);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.bonus-items {
    border-top: 1px solid var(--bs-border-color);
    padding-top: 1rem;
    margin-top: 1rem;
    background-color: var(--bs-white);
    border-radius: 0 0 var(--bs-border-radius-lg) var(--bs-border-radius-lg);
    overflow: hidden;
}

.bonus-items.show {
    display: block;
}

/* For step3 bonus items - hide by default */
.bonus-item .bonus-items {
    display: none;
}

.bonus-item .bonus-items.show {
    display: block;
}

.item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    gap: 1rem;
    margin: 0 -1rem;
}

.item-row:last-child {
    border-bottom: none;
}

.item-info {
    flex: 1;
}

.item-code {
    font-weight: 600;
    color: var(--bs-heading-color);
}

.item-quantity {
    font-size: 0.9rem;
    color: var(--bs-secondary-color);
}

/* Use Bootstrap form-check styles for checkboxes */
.item-row.form-check {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.item-row.form-check:hover {
    background-color: rgba(26, 90, 250, 0.05);
    border-radius: var(--bs-border-radius);
}

.item-row.form-check.selected {
    background-color: rgba(26, 90, 250, 0.1);
    border-radius: var(--bs-border-radius);
}

.item-row.form-check .form-check-input {
    float: inline-start;
    margin-inline-start: 0;
    margin-top: 0;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.item-row.form-check .form-check-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    cursor: pointer;
    padding-left: 0;
    margin-bottom: 0;
}

.item-price {
    font-weight: 600;
    color: var(--bs-success);
    margin-left: 1rem;
}

/* Landing Page */
.fullscreen-landing {
    min-height: 100vh;
    background: url('assets/img/backgrounds/5.jpg') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.landing-content {
    text-align: center;
    position: relative;
    padding: 2rem;
    max-width: 400px;
    width: 100%;
}

.landing-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .step-content {
        padding: 1.5rem;
    }
    
    .step-title {
        font-size: 1.5rem;
    }
    
    .product-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .product-controls {
        justify-content: center;
    }
    
    .bonus-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .item-row {
        flex-direction: row;
        align-items: start;
        gap: 0.5rem;
    }
    
    .item-price {
        margin-left: 0;
    }
    
    .footer-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
        min-width: auto;
        flex: 1;
    }
    
    .next-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .step-content {
        padding: 1rem;
    }
    
    .step-title {
        font-size: 1.25rem;
    }
    
    .step-footer {
        padding: 0.75rem;
    }
    
    .landing-content {
        padding: 1rem;
    }
}

/* Purchase Order Page */
.order-summary {
    background: var(--bs-white);
}

.order-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.order-section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--bs-heading-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--bs-primary);
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: var(--bs-border-radius);
    gap: 1rem;
}

.item-details {
    flex: 1;
}

.item-name {
    font-weight: 600;
    color: var(--bs-heading-color);
    margin-bottom: 0.25rem;
}

.item-sku {
    font-size: 0.9rem;
    color: var(--bs-secondary-color);
}

.item-quantity {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.quantity {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.bonus-category {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: var(--bs-border-radius);
    /*border-left: 4px solid var(--bs-success);*/
}

.bonus-category-name {
    font-weight: 600;
    color: var(--bs-primary);
    margin-bottom: 0.5rem;
}

.bonus-item-detail {
    color: var(--bs-body-color);
    margin-bottom: 0.25rem;
}

.no-bonus {
    text-align: center;
    color: var(--bs-secondary-color);
    font-style: italic;
    padding: 2rem;
}

.price-summary {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bs-primary-bg-subtle);
    border-radius: var(--bs-border-radius-lg);
    border: 1px solid var(--bs-primary-border-subtle);
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.price-row:last-child {
    margin-bottom: 0;
}

.price-label {
    font-weight: 500;
    color: var(--bs-body-color);
}

.price-value {
    font-weight: 600;
    color: var(--bs-heading-color);
}

.total-row {
    padding-top: 0.75rem;
    border-top: 2px solid var(--bs-primary);
    margin-top: 0.75rem;
}

.total-row .price-label,
.total-row .price-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--bs-primary);
}

/* Payment Method Page */
.payment-methods {
    margin-bottom: 2rem;
}

.payment-method {
    background: var(--bs-white);
    border: 2px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-lg);
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.payment-method:hover {
    border-color: var(--bs-primary);
    box-shadow: var(--bs-box-shadow-sm);
}

.payment-method.selected {
    border-color: var(--bs-primary);
}

.payment-header {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    gap: 1rem;
}

.payment-radio {
    display: flex;
    align-items: center;
}

.payment-radio input[type="radio"] {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--bs-primary);
    cursor: pointer;
}

.payment-info {
    flex: 1;
}

.payment-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--bs-heading-color);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.payment-title i {
    color: var(--bs-primary);
}

.payment-description {
    color: var(--bs-body-color);
    font-size: 0.9rem;
}

.payment-details {
    padding: 0 1.5rem 1.5rem;
    border-top: 1px solid var(--bs-border-color);
    margin-top: 1rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row:last-child {
    margin-bottom: 0;
}

.col-6 {
    flex: 1;
}

.payment-total {
    background: var(--bs-primary);
    color: var(--bs-white);
    padding: 1.5rem;
    border-radius: var(--bs-border-radius-lg);
    text-align: center;
    margin-top: 2rem;
}

.total-label {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.total-amount {
    font-size: 2rem;
    font-weight: 700;
}

/* Step 3 specific responsive */
@media (max-width: 900px) {
    .step-content {
        max-width: 900px;
    }
    
    .footer-content {
        max-width: 900px;
    }
}

/* Purchase Order & Payment responsive */
@media (max-width: 768px) {
    .order-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
    }
    
    .item-quantity {
        align-items:flex-start;
        text-align: center;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .payment-header {
        padding: 1rem;
    }
    
    .total-amount {
        font-size: 1.5rem;
    }
}
