body {
    font-family: 'Finger Paint', cursive;
    margin: 0;
    padding: 0;
    background: url('bg-image.jpg') no-repeat center center fixed;
    background-size: cover;
    color: #333;
    transition: font-family 0.2s;
}

body.lang-bn {
    font-family: 'Atma', system-ui, sans-serif;
    font-weight: 500;
}

input, button, select, textarea {
    font-family: inherit;
}

h1, h2 {
    font-family: 'Mouse Memoirs', sans-serif;
    letter-spacing: 1px;
}

body.lang-bn h1, body.lang-bn h2 {
    font-family: 'Atma', system-ui;
    font-weight: 700;
}

h1 {
    text-align: center;
    padding: 20px 0 5px 0;
    margin-bottom: 0;
    font-size: 3rem;
    color: yellow;
    text-shadow: 2px 2px 4px #000;
}

h3#subTitle {
    text-align: center;
    margin-top: 5px;
    padding-bottom: 20px;
    font-size: 1.2rem;
    color: white;
    text-shadow: 1px 1px 3px #000;
}

#layout {
    display: flex;
    width: 100%;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: flex-start; 
}

#menu {
    flex: 2;
    padding: 20px;
}

.sticky-summary {
    flex: 1;
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    height: auto; 
    max-height: calc(100vh - 40px); 
    overflow: hidden; 
    background: #f9f9f9;
    margin: 20px;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    box-sizing: border-box;
    z-index: 100;
}

.sticky-summary h2 {
    margin-top: 0;
}

.category {
    margin-top: 25px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #e0e0e0; 
    overflow: hidden; 
}

.category:first-child {
    margin-top: 0;
}

.category-header {
    background: #000;
    color: #fff;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Mouse Memoirs', sans-serif;
    user-select: none;
    transition: background 0.2s;
}

body.lang-bn .category-header {
    font-family: 'Atma', system-ui;
    font-weight: 700;
}

.category-header:hover {
    background: #333;
}

.category-items-wrapper {
    max-height: 2000px; 
    transition: max-height 0.4s ease-in-out, opacity 0.4s ease-in-out;
    opacity: 1;
    overflow: hidden;
}

.category-items-wrapper.collapsed {
    max-height: 0;
    opacity: 0;
}

.category-items {
    padding: 10px 20px;
}

.item {
    display: flex;
    align-items: center;
    margin: 10px 0;
    padding: 10px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #ddd;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 15px;
}

.info {
    flex-grow: 1;
}

.old-price {
    text-decoration: line-through;
    color: #888;
    margin-right: 5px;
}

.new-price {
    color: green;
    font-weight: bold;
}

.controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 20px;
}

.controls button {
    padding: 5px 10px;
    cursor: pointer;
    background: #eee;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#cartList {
    flex-grow: 1;      
    overflow-y: auto;  
    margin-bottom: 0; 
    font-size: 0.9rem;
    padding-right: 5px;
    min-height: 0; 
}

#cartList::-webkit-scrollbar {
    width: 8px;
}
#cartList::-webkit-scrollbar-track {
    background: #eee; 
}
#cartList::-webkit-scrollbar-thumb {
    background: #bbb; 
    border-radius: 4px;
}
#cartList::-webkit-scrollbar-thumb:hover {
    background: #999; 
}

.summary-footer {
    flex-shrink: 0;
    background: #f9f9f9; 
    padding-top: 15px;
    border-top: 2px solid #ddd;
    z-index: 10; 
}

.cart-mini-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #ccc;
}

#cartList .cart-mini-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 5px;
}

.cart-mini-item img {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
    margin-right: 10px;
}

.cart-mini-details {
    flex-grow: 1;
    margin-right: 10px;
}

.cart-mini-price {
    font-weight: bold;
    color: maroon;
    display: block;
    margin-top: 2px;
}

.cart-mini-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 90px;
}

.cart-qty-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.mini-btn {
    width: 24px;
    height: 24px;
    line-height: 22px;
    text-align: center;
    padding: 0;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    background: #eee;
    color: #333;
}

.mini-btn:hover {
    background: #ddd;
}

.qty-input {
    width: 40px;
    height: 24px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 12px;
    background: #fff;
    font-size: 12px;
    padding: 0;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.qty-input {
  -moz-appearance: textfield;
}

.btn-del-text {
    background: transparent;
    border: none;
    color: #cc0000;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 5px;
    font-family: inherit; 
}

.btn-del-text:hover {
    text-decoration: underline;
    color: #aa0000;
}

#checkout {
    margin-top: 10px;
    width: 100%;
    padding: 15px;
    font-size: 24px;
    font-family: 'Mouse Memoirs', sans-serif;
    border: none;
    border-radius: 4px;
    transition: background 0.3s;
}

body.lang-bn #checkout {
    font-family: 'Atma', system-ui;
    font-weight: 700;
}

#checkout:disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
}

#checkout:enabled {
    background-color: maroon;
    color: white;
    cursor: pointer;
}

.lang-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: maroon;
    color: white;
    border: 2px solid #fff;
    padding: 8px 15px;
    cursor: pointer;
    font-family: 'Mouse Memoirs', sans-serif;
    font-size: 1.2rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    transition: transform 0.2s, background 0.2s;
    z-index: 1000;
}

body.lang-bn .lang-btn {
    font-family: 'Atma', system-ui;
    font-weight: 700;
}

.lang-btn:hover {
    background: #ffcc00; 
    color: maroon;
    transform: scale(1.05);
}

body {
    position: relative; 
}

.modal {
    display: none; 
    position: fixed;
    z-index: 2000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    align-items: center; 
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border: 2px solid maroon;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    position: relative;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close-btn:hover {
    color: maroon;
}

.form-group {
    margin-bottom: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    font-weight: bold;
    color: #555;
}

input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: maroon;
    box-shadow: 0 0 5px rgba(128, 0, 0, 0.2);
}

input.input-error {
    border-color: #d32f2f;
    background-color: #fff8f8;
}

.error-msg {
    display: none; 
    color: #d32f2f;
    font-size: 0.85rem;
    margin-top: 4px;
    font-family: Arial, sans-serif;
}

gmp-place-autocomplete {
    width: 100%;
    color-scheme: light; 
    --gmp-filled-surface-color: #ffffff;
    --gmp-text-color: #333333;
    background-color: #ffffff !important;
    color: #333 !important;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    display: block;
}

.section-header {
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    color: maroon;
}

.card-box {
    background: #f4f4f4;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.modal-footer {
    margin-top: 25px;
    text-align: center;
}

#payBtn {
    background-color: green;
    color: white;
    padding: 12px 30px;
    font-family: 'Mouse Memoirs', sans-serif;
    font-size: 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s;
}

body.lang-bn #payBtn {
    font-family: 'Atma', system-ui;
    font-weight: 700;
}

#payBtn:hover {
    background-color: darkgreen;
}

#payBtn:disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
}

.success-content {
    text-align: center;
    max-width: 400px;
}

#successTitle {
    color: green;
    font-size: 2.5rem;
    margin: 10px 0;
}

#closeSuccess {
    background: maroon;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 15px;
    font-family: 'Mouse Memoirs', sans-serif;
}

body.lang-bn #closeSuccess {
    font-family: 'Atma', system-ui;
    font-weight: 700;
}

/* NEW: Savings Message Style */
.savings-text {
    color: green;
    font-weight: bold;
    font-size: 1.1rem;
    margin-top: 10px;
}

.checkmark-circle {
    width: 80px;
    height: 80px;
    position: relative;
    display: inline-block;
    vertical-align: top;
    border-radius: 50%;
    background-color: #ffffff;
    border: 3px solid green;
    margin-bottom: 15px;
}
.checkmark-circle .checkmark:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 40px;
    border: solid green;
    border-width: 0 4px 4px 0;
    transform: translate(-50%, -65%) rotate(45deg);
}

@media (max-width: 768px) {
    #layout {
        flex-direction: column;
    }
    .sticky-summary {
        position: relative; 
        top: 0;
        max-height: none;
        width: 100%;
        box-sizing: border-box;
    }
    .modal-content {
        width: 85%;
        margin: 15% auto;
    }
}