

/* Form Styling */
form {
    display: flex;
    flex-direction: column;
}

form input, form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    font-family: Arial, sans-serif;
}

form input:focus, form textarea:focus {
    border-color: #333;
}

.form-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.form-buttons .btn {
    flex: 1;
    margin: 0 10px; 
    padding: 10px 20px;
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.form-buttons .btn:hover {
    background-color: #555;
}

.payment-form {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px;
    padding-bottom: 20px; /* Ensure bottom padding */
    border-radius: 10px;
}

.donate-form {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px;
    padding-bottom: 20px; /* Ensure bottom padding */
    border-radius: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th, td {
    padding: 5px;
    text-align: left;
}

th {
    background-color: #f4f4f4;
}

input[type="text"], input[type="number"], select {
    width: 100%;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.total-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.sum-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.total-label {
    margin-right: 10px;
    align-self: flex-end;
}

.sum-label {
    margin-right: 10px;
    align-self: flex-end;
}

.payment-method {
    margin-bottom: 20px;
}

.payment-options {
    margin-top: 5px;
}

.card-payment-form, .paypal-payment-form {
    display: none;
}

.card-names input {
    width: calc(50% - 5px);
    margin-right: 10px;
}

.card-details input {
    width: calc(33.33% - 5px);
    margin-right: 10px;
}

.submit-container {
    text-align: center;
    margin-top: 20px;
}

.paypal-payment-form input {
    display: block;
    width: 100%; 
    margin-bottom: 10px; 
}

/* Donation Form Styles */
.donation-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.donor-info, .donor-contact, .donation-details, .card-names, .card-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.donor-info input, .donor-contact input, .donation-details select, .donation-details input,
.card-names input, .card-details input {
    width: 48%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.payment-method, .submit-container {
    text-align: center;
    margin-top: 20px;
}

.payment-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
}

.card-payment-form, .paypal-payment-form {
    margin-top: 20px;
}

.submit-container button {
    padding: 10px 20px;
    background-color: #28a745;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.submit-container button:hover {
    background-color: #218838;
}

/* Bank Details Section */
.bank-details {
    margin-top: 20px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    text-align: justify;
}

/* Bank Details Table */
.bank-accounts {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.bank-accounts td {
    padding: 10px;
    border: 1px solid #ccc;
    vertical-align: top;
}

.bank-accounts td strong {
    font-size: 16px;
}

/* Payment Buttons */
.payment-method {
    margin-top: 20px;
}

.payment-method form {
    display: inline-block;
    margin-right: 20px;
}

.payment-method {
    padding: 10px 20px;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

/* Donation Buttons */
.donBtn1, .donBtn2, .donBtn3, .payBtn1, .payBtn2, .payBtn3 {
    color: white;
    padding: 10px 20px;
    margin: 10px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.donate-button:hover {
    background-color: #005ea6;
}

/* Error Message */
.error-message {
    color: red;
    margin-top: 10px;
}

/* Common style for "Ongeraho" and "Kuraho" buttons */
.add-remove-btn {
    background-color: #f0ad4e; 
    color: white;
    padding: 5px 2px; 
    font-size: 14px; 
    border-radius: 3px;
    border: none;
    cursor: pointer;
}

/* Hover effect to give feedback when hovering over buttons */
.add-remove-btn:hover {
    background-color: #ec971f; 
    opacity: 0.9;
}

.donBtn1, .payBtn1 {
    background-color: blue;
}

.donBtn2, .payBtn2{
    background-color: green; 
}

.donBtn3, .payBtn3 {
    background-color: magenta;
}

#centered {
    text-align: center;
}


dl dd {
	text-indent: 5%;
}


.button-container {
    display: flex;
    justify-content: center;
    gap: 10px; /* Optional: Adds space between the buttons */
}

/* Add padding-bottom to prevent footer from hiding content */
main.purchase, main.donate {
    padding-bottom: 180px; /* Space for fixed footer (reduced height) */
    min-height: calc(100vh - 200px); /* Ensure minimum height for proper scrolling */
}

/* Ensure body and html allow proper scrolling on purchase/donate pages */
body:has(main.purchase),
body:has(main.donate) {
    height: auto;
    overflow-y: auto;
}

html:has(body:has(main.purchase)),
html:has(body:has(main.donate)) {
    height: auto;
    overflow-y: auto;
}

.payment h2, .donate h2 {
	text-align: center;
	color: green;
}


/* Small screens view (max-width: 768px) */
@media (max-width: 768px) {
	
    .payment p, .donate p {
        text-align: left;
    }

    .pay-container, .donate-container {
        flex-direction: column;
    }

    .pay-about, .donate-about, .payment-form, .donate-form, .bank-details {
        width: 100%;
    }

}


@media (min-width: 768px) {

	.product-card {
		column-count: 3;
	}
}


@media (max-width: 768px) {

	.product-card {
		column-count: 1;
	}
}


/* === Cart Bar === */
.cart-bar {
  text-align: right;
  padding: 10px 20px;
}

/* Ensure checkout-section is always hidden (use modal instead) */
#checkout-section {
  display: none !important;
}

.checkout-btn {
  background-color: #28a745;
  color: white;
  padding: 10px 18px;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.checkout-btn:hover {
  background-color: #218838;
}

#cart-count {
  background: red;
  color: white;
  padding: 2px 6px;
  border-radius: 50%;
  font-size: 0.9em;
  margin-left: 5px;
}


/* Modal Overlay - Display on top of page */
.modal {
  display: none;
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999 !important;
  overflow-y: auto;
}

/* When modal is shown via JavaScript - ensure it's displayed on top */
.modal[style*="display: block"],
.modal[style*="display:block"] {
  display: block !important;
}

.modal-content {
  position: relative;
  background-color: #ffffff;
  margin: 50px auto;
  padding: 20px;
  border: 1px solid #cccccc;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  z-index: 10000;
}

.modal .close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
  color: #000000;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s ease;
}

.modal .close:hover {
  color: #666666;
}

.modal-buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
}

.modal-buttons button {
  flex: 1;
  padding: 10px 20px;
  font-size: 1em;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  background-color: #28a745;
  color: white;
  transition: background-color 0.3s ease;
}

.modal-buttons button:hover {
  background-color: #218838;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #eee;
}

.cart-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.cart-controls button {
  padding: 5px 10px;
  font-size: 0.9em;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  color: white;
}

/* Minus and Plus buttons - softer blue */
.cart-controls button:not(:last-child) {
  background-color: #6c9bd8;
}

.cart-controls button:not(:last-child):hover {
  background-color: #5a8bc4;
}

/* Remove/X button - softer red */
.cart-controls button:last-child {
  background-color: #d88b8b;
}

.cart-controls button:last-child:hover {
  background-color: #c47a7a;
}

@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 20px auto;
    padding: 15px;
  }
  
  .modal-buttons {
    flex-direction: column;
  }
  
  .modal-buttons button {
    width: 100%;
  }
}

/* hide PayPal branding */
.paypal-powered-by {
  display: none !important;
}

/* Product card styles merged from product_card_styles.css */

.product-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
}

.product-card {
  width: 225px;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  background-color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-image-container {
  position: relative;
  width: 100%;
  margin-bottom: 5px;
}

.product-card img {
  width: 100%;
  height: auto;
  border-radius: 5px;
  display: block;
}

.book-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 8px;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  box-sizing: border-box;
  overflow: hidden; /* Prevent text from overflowing */
  text-align: center;
}

.book-label {
  font-size: 0.7em; /* big - reduced proportionally */
  font-weight: bold;
  margin-bottom: 3px;
}

.book-title {
  font-size: 1.0em; /* biggest - reduced proportionally */
  font-weight: bold;
  margin-bottom: 3px; /* Same as book-label margin-bottom */
  line-height: 1.1;
}

.book-author {
  font-size: 0.65em; /* big for "Umwanditsi:" - reduced proportionally */
  margin-top: 0; /* Removed margin-top: auto to match spacing */
}

.book-author .author-name {
  font-size: 0.85em; /* bigger for "Abel N.A. Noble" - reduced proportionally */
  font-weight: bold;
}

.product-card h3 {
  font-size: 1.1em;
}

.price-button-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price-button-row p {
  font-weight: bold;
  margin: 0;
}

.price-button-row button {
  background-color: blue;
  color: white;
  border: none;
  font-size: 0.9em;
  border-radius: 4px;
  cursor: pointer;
}


/* Small screens view (max-width: 768px) */
/* Mobile Phones (max-width: 7in) */
@media (max-width: 7in) {
    .product-card { 
        width: 100% !important; 
    }
}

/* Tablets and Mobile styling (max-width: 768px) */
@media (max-width: 768px) {
    .product-card { 
        /* width: 100% removed to allow grid layout on tablets */
        padding: 5px !important;
        font-size: 1.0em;
    }
    
    /* Overlay and image styling removed to restore default "superimposed" behavior on mobile */
    
    .product-card h3 {
        font-size: 1.1em !important;
        margin: 5px 0 !important;
        line-height: 1.3;
    }
    
    .price-button-row {
        gap: 5px;
    }
    
    .price-button-row p {
        font-size: 0.9em !important;
        margin: 0 !important;
    }
    
    .price-button-row button {
        font-size: 0.85em !important;
        padding: 5px 8px !important; /* Increased button padding */
        white-space: nowrap;
    }
    
    .book-label {
        font-size: 0.8em !important;
    }
    .book-title {
        font-size: 1.1em !important;
    }
    .book-author {
        font-size: 0.75em !important;
    }
    .book-author .author-name {
        font-size: 0.95em !important;
    }
    
    .purchase p,
    .donate p {
        font-size: 0.95em !important;
        line-height: 1.6 !important;
    }
}
