body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f6f9;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

.form-group:has(:required)>label::after {
    content: " *";
    color: red;
    font-weight: bold;
    margin-left: 2px;
}

.balance-container {
    display: none;
    margin-bottom: 20px;
    padding: 15px;
    background: #f4f6f9;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.balance-container h3 {
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
}

.balance-container p {
    margin: 5px 0;
}

.balance-container .remainHead {
    margin: 5px 0;
    font-size: 1.1em;
    font-weight: bold;
}

/* Form Container */
.form-container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 700px;
    box-sizing: border-box;
}

h1 {
    color: #333;
    text-align: center;
    margin-top: 0;
    margin-bottom: 25px;
}

/* Form Groups and Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
form-group textarea:focus {
    border-color: #007bff;
    outline: none;
}

.form-group input[readonly] {
    background-color: #e9ecef;
    cursor: not-allowed;
}

/* Currency Input Styling */
.currency-input {
    display: flex;
}

.currency-input input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    flex-grow: 1;
}

.currency-input select {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    width: 85px;
    border-left: 0;
}

/* Product Lists */
#dealProductsList,
#catalogProductsContainer {
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 4px;
    margin-top: 10px;
    min-height: 40px;
}

.product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.product-item:last-child {
    border-bottom: none;
}

/* Buttons */
#add-product-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    transition: background-color 0.2s;
}

#add-product-btn:hover {
    background-color: #0056b3;
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.2s;
}

.submit-btn:hover {
    background-color: #218838;
}

.submit-btn:disabled {
    background-color: #aaa;
    cursor: not-allowed;
}


/* Loader */
.loader {
    text-align: center;
    padding: 50px;
    font-size: 18px;
    color: #777;
}

.product-header,
.product-row {
    display: grid;
    /* Name | Qty | Price | Total | Curr | Action */
    grid-template-columns: 1fr 60px 80px 80px 40px 40px !important;
    gap: 10px;
    align-items: center;
    /* Dikeyde ortalar */
}

.product-header,
.product-row {
    display: grid;
    /* Name | Qty | Price | Total | Curr | Action */
    grid-template-columns: 1fr 60px 80px 80px 40px 40px !important;
    gap: 10px;
    align-items: center;
    /* Dikeyde ortalar */
}

.product-header span,
.product-row .input-wrapper input,
.product-row .p-curr,
.product-row .delete-btn {
    text-align: center !important;
    justify-content: center;
}

.product-row input {
    width: 100%;
    padding: 8px 4px;
    box-sizing: border-box;
}

.mobile-label {
    display: none;
}

.product-row .delete-btn {
    background-color: #ff4d4d;
    color: white;
    border: none;
    padding: 0;
    cursor: pointer;
    border-radius: 4px;
    width: 100%;
    height: 34px;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
}

.product-row .delete-btn:hover {
    background-color: #d63030;
}

.deal-currency-info {
    font-weight: bold;
    margin-bottom: 15px;
    background-color: #f2f2f2;
    padding: 10px;
    border-radius: 5px;
}

.total-amount-large {
    font-size: 1.2em !important;
    font-weight: 700 !important;
    color: #333;
}

/* Yeni eklenen ürünler satırı için mavi ton */
.new-items-row {
    color: #003267;
    font-weight: 600;
    margin: 5px 0;
}

/* Borç/Alacak renkleri */
.balance-positive {
    /* Fazla ödeme veya 0 (Yeşil) */
    color: #28a745 !important;
    font-weight: bold;
}

.balance-negative {
    /* Borç var (Kırmızı) */
    color: #dc3545 !important;
    font-weight: bold;
}

.refund-switch-container {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 15px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #dc3545;
    /* İade için kırmızı renk */
}

input:checked+.slider:before {
    transform: translateX(26px);
}

.switch-label {
    font-weight: bold;
    font-size: 14px;
    color: #555;
}

/* İade modunda arka planı hafif kırmızı yapalım ki belli olsun */
body.refund-active {
    background-color: #fff0f0;
}

body.refund-active .submit-btn {
    background-color: #dc3545;
}

body.refund-active .submit-btn:hover {
    background-color: #c82333;
}

.calculator-box {
    background-color: #e3f2fd;
    /* Açık mavi arka plan */
    border: 2px dashed #2196f3;
    /* Kesikli mavi çerçeve */
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    /* Altındaki elemanla mesafe */
    display: none;
    /* Varsayılan olarak gizli */
}

.calculator-box label {
    color: #0d47a1;
    font-weight: bold;
}

.calc-btn {
    background-color: #2196f3;
    color: white;
    border: none;
    padding: 0 20px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
    /* Sadece sağ tarafları yuvarla */
    transition: background-color 0.2s;
}

.calc-btn:hover {
    background-color: #1976d2;
}

/* Currency input içindeki input'u buton var diye biraz daraltalım */
.calculator-box .currency-input input {
    border-radius: 4px 0 0 4px;
    /* Sol tarafları yuvarla */
}

.calculator-box .currency-input select {
    border-radius: 0;
    /* Köşeleri dik olsun, arada kalacak */
    border-left: 0;
    border-right: 0;
}

.booking-notes {
    margin-top: 15px !important;
    padding: 10px;
    background-color: #fcfcfc;
    /* Çok açık gri arka plan */
    border: 1px solid #e0e0e0;
    /* İnce çerçeve */
    border-radius: 6px;
    font-size: 0.85rem;
    /* Daha küçük yazı boyutu (Minimal) */
    color: #666;
    /* Göz yormayan gri ton */
    line-height: 1.4;
}

.booking-notes strong {
    display: block;
    /* Başlığı üst satıra alır */
    margin-bottom: 6px;
    color: #333;
    font-weight: 600;
    font-size: 0.9rem;
}

#bookingNotesDisplay {
    white-space: pre-wrap;
    /* Satır boşluklarını ve formatı korur */
    display: block;
    word-break: break-word;
    /* Çok uzun kelimelerde taşmayı önler */
}

/* style.css içine ekleyin */

/* İsim alanı artık input olacağı için genişliği ve hizayı ayarlayalım */
.product-row .p-name-input {
    width: 100%;
    text-align: left !important; /* İsim sola dayalı olsun */
    font-weight: 500;
    border: 1px solid #ccc;
    background-color: #fff;
    padding: 8px;
    border-radius: 4px;
}

/* Readonly moddayken (Add-on payment gibi) gri görünsün */
.product-row .p-name-input:disabled {
    background-color: #e9ecef;
    border-color: transparent;
    color: #555;
}

/* Mobile Responsive Design */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .form-container {
        padding: 20px;
    }

    h1 {
        font-size: 24px;
    }

    .form-group input,
    .form-group select {
        padding: 10px;
        font-size: 14px;
    }

    .submit-btn {
        padding: 12px;
        font-size: 16px;
    }

    .product-header {
        display: none !important;
    }

    .product-row {
        display: grid;
        grid-template-columns: 1fr 1fr 1.2fr !important;
        grid-template-rows: auto auto;
        gap: 10px;
        padding: 12px;
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        margin-bottom: 15px;
        position: relative;
    }

    .product-row .p-name {
        grid-column: 1 / -1;
        grid-row: 1;
        font-weight: 600;
        color: #333;
        font-size: 14px;
        border-bottom: 1px solid #eee;
        padding-bottom: 8px;
        margin-bottom: 5px;
        padding-right: 30px;
    }

    .product-row .delete-btn {
        position: absolute;
        top: 10px;
        right: 10px;
        width: 25px;
        height: 25px;
        background: transparent;
        color: #999;
        font-size: 24px;
    }

    .product-row .delete-btn:hover {
        color: red;
        background: transparent;
    }

    .product-row .input-wrapper:nth-child(2) {
        grid-column: 1;
        grid-row: 2;
    }

    .product-row .input-wrapper:nth-child(3) {
        grid-column: 2;
        grid-row: 2;
    }

    .product-row .input-wrapper:nth-child(4) {
        grid-column: 3;
        grid-row: 2;
    }

    .mobile-label {
        display: block;
        font-size: 10px;
        color: #888;
        font-weight: bold;
        margin-bottom: 2px;
        text-transform: uppercase;
    }

    .product-row input {
        text-align: center !important;
        padding: 8px;
        font-size: 14px;
    }

    .product-row .p-curr {
        display: none;
    }
}