:root {
  --primary-color: #7a1b31;
  --secondary-color: #ff9900;
  --accent-color: #ff9900;
  --background-color: #ffffff;
  --text-color: #7a1b31;
  --white: #ffffff;
  --shadow: 0 4px 6px rgba(122, 27, 49, 0.08), 0 1px 3px rgba(122, 27, 49, 0.04);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --remove-color: #dc2626;
}

/* Loading Animation Styles */
.loading-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(5px);
}

.loading-spinner {
  text-align: center;
  color: var(--primary-color);
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

.loading-spinner p {
  font-size: 1.2rem;
  font-weight: 500;
  margin: 0;
  color: var(--primary-color);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Hide loading animation when content is ready */
.loading-container.hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Roboto', 'Heebo', 'Montserrat', Arial, sans-serif;
  line-height: 1.8;
  color: var(--text-color);
  background-color: var(--background-color);
  direction: rtl;
  text-align: right;
  unicode-bidi: bidi-override;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.logo-image {
  max-width: 240px;
}

header {
  background: var(--primary-color) !important;
  color: var(--white) !important;
  box-shadow: 0 2px 12px rgba(122, 27, 49, 0.08);
  border-bottom: 4px solid var(--secondary-color);
  padding: 0 0 0 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 32px;
  min-height: 80px;
}

.logo {
  display: flex;
  align-items: center;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--white) !important;
  text-decoration: none;
  transition: transform 0.2s, filter 0.2s;
  margin-right: 0;
  margin-left: 32px;
}

.logo:hover {
  filter: brightness(1.15);
  transform: scale(1.04);
}

.logo-image {
  max-width: 240px;
  max-height: 64px;
  margin-right: 0;
  margin-left: 0;
}

.logo:focus {
  outline: none;
}

.logo i {
  margin-left: 15px;
}

.custom-dropdown {
  position: relative;
  width: 100%;
  margin-bottom: 20px;
  direction: rtl;
}

.custom-dropdown label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  text-align: right;
}

.dropdown-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background-color: #fff;
  cursor: pointer;
  transition: var(--transition);
  direction: rtl;
  text-align: right;
}

.dropdown-button:hover {
  border-color: var(--primary-color);
}

.selected-school {
  font-size: 1rem;
  text-align: right;
}

.fas.fa-chevron-down {
  font-size: 1rem;
  color: #4a5568;
  margin-right: 8px;
  margin-left: 0;
}

.dropdown-list {
  position: absolute;
  top: 100%;
  right: 0;
  width: 100%;
  padding: 10px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background-color: #fff;
  list-style: none;
  display: none;
  z-index: 10;
  max-height: 35vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  direction: rtl;
  text-align: right;
}

.dropdown-list li {
  padding: 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  text-align: right;
}

.dropdown-list li:hover {
  background-color: #edf2f7;
}

.school-logo {
  width: 24px;
  height: 24px;
  margin-right: 10px;
  margin-left: 0;
  vertical-align: middle;
}

.custom-dropdown.open .dropdown-list {
  display: block;
}

footer {
  background: var(--primary-color) !important;
  color: #fbeff4 !important;
  border-top: 3px solid var(--secondary-color);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -2px 12px rgba(122, 27, 49, 0.08);
  padding: 40px 0 0 0;
  margin-top: 48px;
  direction: rtl;
}

.footer-content {
  padding-bottom: 0;
}

.footer-columns {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 32px;
  margin-bottom: 0;
}

.footer-column {
  flex: 1 1 200px;
  min-width: 180px;
  margin-bottom: 0;
  text-align: right;
}

.footer-column h4 {
  color: var(--accent-color);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  text-align: right;
}

.footer-column p, .footer-column ul {
  color: #fbeff4;
  font-size: 1rem;
  margin-bottom: 10px;
}

.footer-column a {
  color: #fbeff4;
  text-decoration: none;
  transition: var(--transition);
  text-align: right;
}

.footer-column a:hover {
  color: var(--accent-color);
}

.footer-bottom {
  background-color: var(--primary-color);
  color: var(--white);
  text-align: center !important;
  padding: 20px 0;
  margin-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  direction: rtl;
}

.footer-bottom a {
  color: var(--accent-color);
  text-decoration: none;
  text-align: center;
}

.footer-bottom a:hover {
  text-decoration: underline;
}

.footer-bottom p {
  text-align: center !important;
  margin: 0;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 20px;
  direction: rtl;
}

nav li {
  margin: 0;
}

nav a {
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  text-align: right;
}

nav a:hover {
  color: var(--accent-color);
}

h1, h2, h3 {
  color: var(--text-color);
  margin-bottom: 16px;
  text-align: right;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: right;
}

h2 {
  font-size: 2rem;
  font-weight: 600;
  text-align: right;
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
  text-align: right;
}

p {
  margin-bottom: 16px;
  text-align: right;
}

.btn {
  display: inline-block;
  background: var(--secondary-color);
  color: var(--white);
  padding: 14px 28px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  font-weight: 700;
  text-align: center;
  margin: 15px 0;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(255, 153, 0, 0.2);
  border: 2px solid transparent;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn:hover {
  background: var(--primary-color);
  box-shadow: 0 8px 25px rgba(122, 27, 49, 0.3);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn:hover::before {
  left: 100%;
}

.btn:active {
  box-shadow: 0 4px 12px rgba(122, 27, 49, 0.2);
}

.btn-remove {
  background: var(--remove-color);
}

.btn-remove:hover {
  background: #e53e3e;
}

#add-child-form {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--white);
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  width: 90%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  direction: rtl;
  text-align: right;
}

#add-child-form .close-form {
  position: absolute;
  top: 16px;
  left: 16px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  transition: var(--transition);
}

#add-child-form .close-form:hover {
  color: var(--primary-color);
}

#add-child-form .btn-container {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  margin-top: 24px;
}

.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  backdrop-filter: blur(4px);
}

#add-child-form input,
#add-child-form select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 16px;
  transition: var(--transition);
  text-align: right;
  direction: rtl;
}

#add-child-form input:focus,
#add-child-form select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(122, 27, 49, 0.1);
}

.child-info {
  background: var(--white);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 32px;
  box-shadow: 0 4px 20px rgba(122, 27, 49, 0.08);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  direction: rtl;
  text-align: right;
  border: 1px solid rgba(122, 27, 49, 0.05);
  position: relative;
  overflow: hidden;
}

.child-info::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.child-info:hover {
  box-shadow: 0 12px 40px rgba(122, 27, 49, 0.15);
  border-color: rgba(122, 27, 49, 0.1);
}

.child-info:hover::before {
  opacity: 1;
}

.child-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  direction: rtl;
}

.child-details {
  flex: 1;
  text-align: right;
}

.child-details h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-color);
  text-align: right;
}

.child-header .child-school-logo img {
  width: 60px;
  height: 60px;
  /* border-radius: 8px; */
  margin-left: 0;
}

.child-actions {
  display: flex;
  gap: 8px;
  direction: rtl;
}

.child-info-icon {
  margin-left: 8px;
  margin-right: 0;
  color: var(--secondary-color);
}

.book-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
  direction: rtl;
}

.book-list.list-mode {
  grid-template-columns: 1fr;
}

.book {
  background: var(--white);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(122, 27, 49, 0.06);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  border: 1px solid rgba(122, 27, 49, 0.05);
  text-align: right;
  direction: rtl;
  position: relative;
  overflow: hidden;
}

.book::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.book-list.list-mode .book {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
}

.book:hover {
  box-shadow: 0 16px 40px rgba(122, 27, 49, 0.12);
  border-color: rgba(122, 27, 49, 0.1);
}

.book:hover::before {
  opacity: 1;
}

.book-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 16px;
}

.book-list.list-mode .book-image {
  width: 120px;
  height: 120px;
  margin-bottom: 0;
  flex-shrink: 0;
}

.book h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-color);
  text-align: right;
}

.smaller {
  font-size: 0.8rem !important;
  color: #666;
  text-align: right;
}

.book-list.list-mode .book-info {
  flex: 1;
  text-align: right;
}

.book-list.list-mode .add-to-cart {
  margin-right: 0;
  margin-left: 16px;
}

#cart {
    position: fixed;
    top: 20px;
    left: 20px;
    background: var(--primary-color);
    color: var(--white);
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: var(--transition);
    direction: rtl;
    text-align: right;
}

#cart::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  border-radius: 30px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#cart:hover {
  background: var(--secondary-color);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
  box-shadow: 0 12px 40px rgba(255, 153, 0, 0.3);
}

#cart:hover::before {
  opacity: 1;
}

#cart-items {
  list-style: none;
  margin: 0;
  padding: 0;
  direction: rtl;
}

#cart-items > li {
  background: var(--white);
  margin: 8px 0;
  padding: 12px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-align: right;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

#cart-items > li:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cart-child-items {
  list-style: none;
  margin: 8px 0 0 0;
  padding: 0;
  display: none;
  direction: rtl;
}

.cart-child-items.active {
  display: block;
}

.cart-child-items li {
  background: var(--secondary-color);
  margin: 4px 0;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  text-align: right;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-child-items li:last-child {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .hero-actions .btn {
    width: 100%;
    max-width: 300px;
  }
  
  .child-school-logo {
    position: absolute;
    margin-left: auto;
    left: 40px;
  }

  .book-list {
    margin-top: 0;
    gap: 16px;
  }

  .book {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 20px rgba(122, 27, 49, 0.08);
    position: relative;
    min-height: 280px;
  }
  
  .child-info {
    padding: 28px 24px;
    margin-bottom: 28px;
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(122, 27, 49, 0.12);
    border: 1px solid rgba(122, 27, 49, 0.08);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    animation: slideInUp 0.6s ease-out;
  }

  @keyframes slideInUp {
    from {
      opacity: 0;
      transform: translateY(30px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .child-info:nth-child(1) { animation-delay: 0.1s; }
  .child-info:nth-child(2) { animation-delay: 0.2s; }
  .child-info:nth-child(3) { animation-delay: 0.3s; }
  .child-info:nth-child(4) { animation-delay: 0.4s; }
  .child-info:nth-child(5) { animation-delay: 0.5s; }

  .child-info:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(122, 27, 49, 0.16);
  }

  .child-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  }

  .child-info::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
  }

  .child-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .child-details {
    flex: 1;
    min-width: 0;
  }

  .child-details h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
    line-height: 1.3;
  }

  .child-details p {
    font-size: 0.95rem;
    color: #4a5568;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
  }

  .child-info-icon {
    color: var(--secondary-color);
    font-size: 1rem;
    width: 20px;
    text-align: center;
    transition: all 0.3s ease;
  }

  .child-details p:hover .child-info-icon {
    transform: scale(1.2);
    color: var(--primary-color);
  }

  .child-header .child-school-logo img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    /* border-radius: 12px; */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: white;
    padding: 4px;
    transition: all 0.3s ease;
  }

  .child-header .child-school-logo img:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  }

  .child-actions {
    align-items: flex-start;
    gap: 12px;
  }
  
  .child-actions button {
    margin-bottom: 0;
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b2a4a 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(122, 27, 49, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
  }

  .child-actions button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
  }

  .child-actions button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(122, 27, 49, 0.4);
  }

  .child-actions button:hover::before {
    left: 100%;
  }

  .child-actions button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(122, 27, 49, 0.3);
  }

  .child-actions button i {
    margin-left: 6px;
    font-size: 0.9rem;
    transition: transform 0.2s ease;
  }

  .child-actions button:hover i {
    transform: scale(1.1);
  }

  .child-books-count {
    font-weight: 700;
    color: var(--secondary-color);
    background: linear-gradient(135deg, rgba(255, 153, 0, 0.15) 0%, rgba(255, 153, 0, 0.05) 100%);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 153, 0, 0.2);
    display: inline-block;
    transition: all 0.3s ease;
  }

  .child-books-count:hover {
    background: linear-gradient(135deg, rgba(255, 153, 0, 0.25) 0%, rgba(255, 153, 0, 0.1) 100%);
    transform: scale(1.05);
  }
  
  .btn {
    padding: 16px 24px;
    font-size: 0.95rem;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .book-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    margin: 0;
    border-radius: 16px 16px 0 0;
  }

  .book-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0;
    min-height: 120px;
  }

  .book h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--primary-color);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .smaller {
    font-size: 0.8rem !important;
  }

  .book p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 12px;
  }

  .add-to-cart {
    padding: 10px 18px;
    font-size: 0.95rem;
    align-self: flex-start;
    margin-top: 8px;
  }

  #cart {
    position: static;
    margin-top: 40px;
    width: 100%;
    max-height: none;
  }

  .view-toggle {
    display: none !important;
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.empty-state {
  text-align: center;
  padding: 80px 40px;
  background: linear-gradient(135deg, var(--white) 0%, rgba(255, 255, 255, 0.9) 100%);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(122, 27, 49, 0.08);
  border: 1px solid rgba(122, 27, 49, 0.05);
  position: relative;
  overflow: hidden;
}

.empty-state::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.empty-state i {
  font-size: 5rem;
  color: var(--primary-color);
  margin-bottom: 30px;
  opacity: 0.8;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; }
}

.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 120px;
  background-color: var(--text-color);
  color: var(--white);
  text-align: center;
  border-radius: 6px;
  padding: 8px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -60px;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.9rem;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

.load-books {
  margin-top: 25px;
}

.add-to-cart {
  margin-top: auto;
}

#checkout {
  margin-top: 30px;
  width: 100%;
  background: var(--secondary-color);
  color: var(--white);
  border: 2px solid var(--secondary-color);
  border-radius: 12px;
  padding: 16px 24px;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(255, 153, 0, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#checkout:hover {
  background: var(--white);
  color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 153, 0, 0.4);
}

.view-toggle {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 25px;
}

.view-toggle button {
  background: var(--primary-color);
  color: var(--white);
  border: none;
  padding: 12px 18px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
}

.view-toggle button:first-child {
  border-radius: 8px 0 0 8px;
}

.view-toggle button:last-child {
  border-radius: 0 8px 8px 0;
}

.view-toggle button.active {
  background: var(--secondary-color);
}

.cart-child-total {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  background-color: #edf2f7;
  border-radius: 8px;
  margin-top: 15px;
}

.cart-child-total .cart-child-price {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary-color);
}

.cart-child-name::after {
  content: '\f107';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  transition: transform 0.3s ease;
  margin-left: 10px;
}

.cart-child-name.active::after {
  transform: rotate(180deg);
}

.cart-child-name {
  font-weight: 700;
  font-size: 1.2rem;
  margin: auto;
  color: var(--primary-color);
  cursor: pointer;
  transition: var(--transition);
}

.cart-child-name:hover {
  color: var(--secondary-color);
}

.child-books {
  display: none;
  background-color: #f7fafc;
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.child-books.active {
  display: block;
}

@media screen and (max-width: 768px) {
  .child-info {
    padding: 20px 16px;
    margin-bottom: 20px;
    border-radius: 12px;
  }
  .child-books {
    padding: 15px;
    margin-top: 15px;
  }
  .book {
    max-height: 150px;
  }
  .logo-image {
    max-width: 240px;
    margin-left: 15px;
  }
  .container {
    padding: 20px 15px;
  }
}

@media screen and (min-width: 769px) {
  .hero-text {
    max-width: 70%;
  }
  .child-details {
    max-width: 13%;
  }
}

.view-toggle {
  display: none;
}

.view-toggle.active {
  display: flex;
}

/* Modern 2025 additions */

/* Smooth scrolling for the entire page */
html {
  scroll-behavior: smooth;
}

/* Improved focus styles for accessibility */
:focus {
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --primary-color: #1e40af;
    --secondary-color: #ea580c;
    --accent-color: #f59e0b;
    --background-color: #78350f;
    --text-color: #fef3c7;
    --white: #451a03;
  }

  body {
    background-color: var(--background-color);
    color: var(--text-color);
  }

  .book, .child-info, #cart, #add-child-form {
    background-color: #451a03;
  }

  .dropdown-button, .dropdown-list {
    background-color: #92400e;
    border-color: #a16207;
  }

  .dropdown-list li:hover {
    background-color: #451a03;
  }
}

/* Improved animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.5s ease-out;
}

/* Glass morphism effect */
.glass-effect {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Improved button styles */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease-out, height 0.3s ease-out;
}

.btn:hover::after {
  width: 300px;
  height: 300px;
}

/* Improved form input styles */
input, select {
  transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus, select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);
}

/* Gradient text for headings */
h1, h2, h3 {
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

/* Improved responsiveness */
@media screen and (max-width: 480px) {
  .child-info, .child-books {
    margin-bottom: 16px;
  }
  .child-info {
    padding: 20px 16px;
    margin-bottom: 20px;
    border-radius: 16px;
    box-shadow: 0 6px 24px rgba(122, 27, 49, 0.1);
    animation: slideInUp 0.5s ease-out;
  }

  .child-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(122, 27, 49, 0.14);
  }

  .child-details h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
  }

  .child-details p {
    font-size: 0.9rem;
    margin-bottom: 6px;
    gap: 6px;
  }

  .child-info-icon {
    font-size: 0.9rem;
    width: 18px;
  }

  .child-details p:hover .child-info-icon {
    transform: scale(1.1);
  }

  .child-header .child-school-logo img {
    width: 50px;
    height: 50px;
    border-radius: 10px;
  }

  .child-header .child-school-logo img:hover {
    transform: scale(1.05);
  }

  .child-actions button {
    padding: 10px 16px;
    font-size: 0.85rem;
    border-radius: 10px;
  }

  .child-actions button:hover {
    transform: translateY(-1px);
  }

  .child-actions button i {
    margin-left: 4px;
    font-size: 0.85rem;
  }

  .child-books-count {
    padding: 2px 8px;
    font-size: 0.8rem;
  }

  .child-books-count:hover {
    transform: scale(1.03);
  }

  .container {
    padding: 20px 16px;
  }
  .logo-image {
    max-width: 170px;
  }
  h1 {
    font-size: 2rem;
    margin-bottom: 16px;
  }
  h2 {
    font-size: 1.6rem;
    margin-bottom: 12px;
  }
  h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
  }
  .book .book-info h3 {
    font-size: 1rem;
  }
  p, .btn, li {
    font-size: 0.9rem;
  }
  .book .btn {
    font-size: 0.85rem;
  }
  .hero-text {
    margin-bottom: 24px;
    padding: 0;
  }
  .child-header .child-school-logo img {
    width: 45px;
    height: 45px;
  }
  .m-hide {
    display: none !important;
  }
  #add-child-form {
    padding: 24px 20px;
  }
  .book-list.list-mode .book {
    flex-direction: row;
  }
  .book {
    min-height: 240px;
  }
  .book-list.list-mode .book-image {
    width: 80px;
    height: 80px;
  }
  .book-list.list-mode .add-to-cart {
    align-self: flex-end;
  }
  .smaller {
    font-size: 0.75rem !important;
  }
  .book .price-button-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    gap: 8px;
  }
  .book .price-display {
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary-color);
  }
  .book p {
    display: none;
  }
  @media (min-width: 481px) {
    .book .price-button-row {
      display: none;
    }
    .book p {
      display: block;
    }
  }
  .btn {
    padding: 12px 20px;
    font-size: 0.9rem;
    min-height: 44px;
    border-radius: 10px;
  }
  .book .add-to-cart {
    padding: 8px 14px;
    font-size: 0.8rem;
    border-radius: 8px;
    min-height: 36px;
  }
  .book .add-to-cart:active {
    transform: scale(0.95);
  }
  .book .btn-remove {
    background: var(--remove-color);
    color: white;
  }
  .book p {
    font-size: 1rem;
  }
  #cart {
    margin-top: 32px;
    padding: 20px;
    border-radius: 16px;
  }
  #add-child-form {
    padding: 24px 20px;
    border-radius: 16px;
  }
  #add-child-form input,
  #add-child-form .custom-dropdown {
    margin-bottom: 16px;
  }
  .custom-dropdown {
    margin-bottom: 16px;
  }
  .dropdown-button {
    padding: 12px;
  }
  .dropdown-list {
    padding: 8px;
  }
  .dropdown-list li {
    padding: 8px;
  }
  footer {
    padding: 32px 0 0 0;
  }
  .footer-columns {
    flex-direction: column;
    gap: 24px;
  }
  .footer-column {
    text-align: center;
  }
  .footer-column h4 {
    font-size: 1.2rem;
  }
  .footer-column p,
  .footer-column ul {
    font-size: 0.9rem;
  }
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}









/* Footer Styles */
footer, footer a {
  background-color: var(--primary-color);
  color: var(--white);
}

/* .footer-content {
  padding: 60px 0;
} */

.footer-columns {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

.footer-column {
  flex: 1;
  margin: 0 15px;
  min-width: 200px;
}

.footer-column h4 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: var(--accent-color);
}

.footer-column p, .footer-column ul {
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-column ul {
  list-style: none;
  padding: 0;
}

.footer-column ul li {
  margin-bottom: 10px;
}

.footer-column ul li a {
  color: var(--white);
  text-decoration: none;
  transition: var(--transition);
}

.footer-column ul li a:hover {
  color: var(--accent-color);
}

.footer-bottom {
  background-color: rgba(0, 0, 0, 0.1);
  text-align: center;
  padding: 20px 0;
  font-size: 0.9rem;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
  .footer-columns {
    flex-direction: column;
  }

  .footer-column {
    margin-bottom: 30px;
  }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  footer {
    background-color: #2d3748;
  }

  .footer-bottom {
    background-color: rgba(255, 255, 255, 0.05);
  }
}


/*  */
@keyframes pulse-highlight {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 153, 0, 0.7);
  }
  70% {
    box-shadow: 0 0 0 18px rgba(255, 153, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 153, 0, 0);
  }
}

.first-action {
  position: relative;
  animation: pulse-highlight 2s infinite;
  z-index: 1;
}

.first-action::before {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--secondary-color);
  color: var(--white);
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.9rem;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.first-action:hover::before {
  opacity: 1;
}

/* Add this to your :root or existing variable declarations */
:root {
  --secondary-color-rgb: 255, 153, 0; /* This should match your --secondary-color */
}

@media (prefers-reduced-motion: reduce) {
  .first-action {
    animation: none;
  }
}
/*  */

.hero-text {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(249, 246, 247, 0.9) 100%);
  color: var(--primary-color);
  border-radius: 24px;
  border: 1px solid rgba(122, 27, 49, 0.08);
  box-shadow: 0 8px 32px rgba(122, 27, 49, 0.08);
  padding: 48px 32px 40px 32px;
  margin: 40px 0 32px 0;
  text-align: right;
  position: relative;
  overflow: hidden;
}

.hero-text::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.hero-text h1 {
  font-size: 2.6rem;
  font-weight: 800;
  margin-bottom: 20px;
  color: var(--primary-color);
  line-height: 1.2;
}

.hero-text h1 .accent {
  background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

.hero-text p {
  font-size: 1.2rem;
  font-weight: 400;
  margin-bottom: 28px;
  color: #555;
  max-width: 600px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.btn.first-action {
  background-color: var(--secondary-color);
  color: var(--white) !important;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 12px 32px;
  border-radius: 9px;
  box-shadow: 0 1px 4px rgba(122, 27, 49, 0.07);
  margin-top: 8px;
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
  position: relative;
  z-index: 2;
}

.btn.first-action::before,
.btn.first-action::after {
  display: none !important;
  background: none !important;
  background-color: transparent !important;
  content: none !important;
}

.btn.first-action:hover {
  background-color: var(--primary-color);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(122, 27, 49, 0.13);
}

.btn:hover:not(.first-action) {
  background-color: var(--secondary-color) !important;
  color: var(--white) !important;
}

#popErrorMsg {
  display: none;
  color: var(--secondary-color);
}

/* Update header, footer, and button backgrounds to use maroon */
header, footer, .btn, .footer-bottom {
  background-color: var(--primary-color) !important;
  color: var(--white) !important;
}

.btn:hover {
  background-color: var(--secondary-color) !important;
  color: var(--white) !important;
}

/* Use orange for highlights/accent */
a, .accent, .selected-school, .footer-bottom a {
  color: var(--secondary-color) !important;
}

body {
  background-color: var(--background-color) !important;
  color: var(--text-color) !important;
}

/* Inputs and dropdowns on white */
input, select, .dropdown-button, .dropdown-list {
  background-color: var(--white) !important;
  color: var(--text-color) !important;
  border-color: var(--primary-color) !important;
}

/* Additional RTL improvements for Hebrew text */
* {
  /* Remove the global unicode-bidi override that was causing English text to be backwards */
}

/* Only apply RTL to Hebrew text elements */
[lang="he"], [dir="rtl"] {
  direction: rtl;
  text-align: right;
  unicode-bidi: bidi-override;
}

input, select, textarea {
  text-align: right;
  direction: rtl;
  /* Remove unicode-bidi override for form elements */
}

button {
  direction: rtl;
  text-align: center;
}

/* Improve Hebrew text flow - only for Hebrew content */
[lang="he"] p, [lang="he"] h1, [lang="he"] h2, [lang="he"] h3, [lang="he"] h4, [lang="he"] h5, [lang="he"] h6, [lang="he"] span, [lang="he"] div {
  text-align: right;
  direction: rtl;
}

/* Fix for icons and symbols in RTL */
.fas, .far, .fab {
  /* Remove unicode-bidi override for icons */
}

/* Improve form elements for RTL */
.form-group {
  direction: rtl;
  text-align: right;
}

.form-group label {
  text-align: right;
  direction: rtl;
}

/* Fix for dropdowns and select elements */
select {
  text-align: right;
  direction: rtl;
  /* Remove unicode-bidi override */
}

select option {
  text-align: right;
  direction: rtl;
}

/* Improve table layout for RTL */
table {
  direction: rtl;
  text-align: right;
}

th, td {
  text-align: right;
  direction: rtl;
}

/* Fix for navigation and menus */
nav {
  direction: rtl;
}

nav ul {
  direction: rtl;
}

nav li {
  direction: rtl;
}

nav a {
  text-align: right;
  direction: rtl;
}

/* Improve modal and popup layouts */
.modal {
  direction: rtl;
}

.modal-content {
  direction: rtl;
  text-align: right;
}

/* Fix for buttons and interactive elements */
.btn {
  direction: rtl;
  text-align: center;
}

.btn i {
  /* Remove unicode-bidi override for button icons */
}

/* Improve list layouts */
ul, ol {
  direction: rtl;
  text-align: right;
}

li {
  text-align: right;
  direction: rtl;
}

/* Fix for price and currency display */
.price, .currency {
  direction: rtl;
  /* Remove unicode-bidi override */
}

/* Improve search and filter elements */
.search-container {
  direction: rtl;
}

.filter-container {
  direction: rtl;
}

/* Fix for status badges and labels */
.status-badge, .label {
  direction: rtl;
  text-align: center;
}

/* Improve responsive design for RTL */
@media (max-width: 768px) {
  .container {
    direction: rtl;
    text-align: right;
  }
  
  .book-list {
    direction: rtl;
  }
  
  .child-info {
    direction: rtl;
    text-align: right;
  }
}

/* Fix for print styles in RTL */
@media print {
  body {
    direction: rtl;
    text-align: right;
  }
  
  * {
    direction: rtl;
  }
}

.child-info, .book, .btn {
  transition: box-shadow 0.3s, background 0.3s, color 0.3s, transform 0.3s;
}

.fade-in-up {
  animation: fadeInUp 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px);}
  to { opacity: 1; transform: translateY(0);}
}

.pop {
  animation: popAnim 0.3s;
}
@keyframes popAnim {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}


@media (max-width: 768px) {
  #cart {
    position: static;
    width: 100%;
    left: unset;
    top: unset;
    box-shadow: none;
    animation: none;
    margin-top: 32px;
    border-radius: 20px;
    z-index: 1;
    display: block !important;
  }
}

.child-info, .book {
  position: relative;
  overflow: hidden;
}
.child-info::before, .book::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 16px 16px 0 0;
}

.btn {
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  box-shadow: 0 2px 8px rgba(122,27,49,0.08);
  border: none;
  color: var(--white);
}
.btn:hover {
  background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
  color: var(--white);
}

h1, h2, h3 {
  font-family: 'Montserrat', 'Heebo', sans-serif;
  font-weight: 800;
  letter-spacing: 0.5px;
}
h1 { font-size: 2.5rem; margin-bottom: 18px; }
h2 { font-size: 2rem; margin-bottom: 14px; }
h3 { font-size: 1.3rem; margin-bottom: 10px; }

.btn i, #cart i {
  font-size: 1.3em;
  margin-left: 8px;
}


@media (min-width: 1024px) {
  .book-list {
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
  }
  .book {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 340px;
    padding: 0;
    box-shadow: 0 4px 24px rgba(122,27,49,0.10);
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    position: relative;
    padding-bottom: 64px;
  }
  .book-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 20px 20px 0 0;
    margin: 0;
    box-shadow: none;
    background: #f7f7fa;
  }
  .book-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 16px 0 16px;
    text-align: center;
  }
  .book h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
    margin-top: 0;
    text-align: center;
    max-width: 100%;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .book .add-to-cart {
    width: 100%;
    border-radius: 0 0 20px 20px;
    margin: 0;
    padding: 16px 0;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: none;
    border-top: 1px solid #eee;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    color: #fff;
    transition: background 0.3s, transform 0.2s;
  }
  .book .add-to-cart:hover {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    box-shadow: 0 4px 16px rgba(255,153,0,0.18);
  }
  .book .btn-remove {
    background: linear-gradient(90deg, #dc2626, #7a1b31);
    color: #fff;
    border: none;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 2px 8px rgba(220,38,38,0.10);
    border-top: 1px solid #eee;
    font-size: 1.1rem;
    font-weight: 700;
    width: 100%;
    margin: 0;
    padding: 16px 0;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    transition: background 0.3s, transform 0.2s;
  }
  .book .btn-remove:hover {
    background: linear-gradient(90deg, #a61b1b, #7a1b31);
    color: #fff;
    box-shadow: 0 4px 16px rgba(220,38,38,0.18);
  }
}

*:focus {
  outline: none !important;
  box-shadow: none !important;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--secondary-color) !important;
  box-shadow: 0 0 0 2px #ff990033 !important;
}

/* Enhanced Mobile Responsiveness - 2025 */

/* Base mobile-first approach */
@media (max-width: 480px) {
  /* Container and spacing */
  .container {
    padding: 16px 12px;
    margin: 0;
  }
  
  /* Header improvements */
  header .container {
    padding: 0 16px;
    min-height: 70px;
  }
  
  .logo {
    font-size: 1.8rem;
    margin-left: 16px;
  }
  
  .logo-image {
    max-width: 170px;
    max-height: 50px;
  }
  
  /* Typography scaling */
  h1 {
    font-size: 1.8rem;
    line-height: 1.3;
    margin-bottom: 12px;
  }
  
  h2 {
    font-size: 1.5rem;
    line-height: 1.4;
  }
  
  h3 {
    font-size: 1.2rem;
    line-height: 1.4;
  }
  
  /* Hero text improvements */
  .hero-text {
    padding: 24px 20px;
    margin: 20px 0;
    border-radius: 16px;
  }
  
  .hero-text h1 {
    font-size: 1.6rem;
    margin-bottom: 12px;
  }
  
  .hero-text p {
    font-size: 1rem;
    line-height: 1.5;
  }
  
  /* Child info cards */
  .child-info {
    padding: 20px 16px;
    margin-bottom: 20px;
    border-radius: 12px;
  }
  
  .child-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .child-details h3 {
    font-size: 1.1rem;
    margin-bottom: 6px;
  }
  
  .child-header .child-school-logo img {
    width: 50px;
    height: 50px;
    margin-top: 8px;
  }
  
  /* Book grid improvements */
  .book-list {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 16px;
  }
  
  .book {
    padding: 12px;
    border-radius: 12px;
    min-height: auto;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 1px solid rgba(122, 27, 49, 0.08);
    box-shadow: 0 2px 8px rgba(122, 27, 49, 0.06);
    transition: all 0.2s ease;
  }
  
  .book:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(122, 27, 49, 0.1);
  }
  
  .book-image {
    width: 70px;
    height: 90px;
    border-radius: 8px;
    margin: 0;
    flex-shrink: 0;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  }
  
  .book-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 90px;
    gap: 6px;
  }
  
  .book h3 {
    font-size: 0.9rem;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--primary-color);
    font-weight: 600;
  }
  
  .book p {
    font-size: 0.8rem;
    line-height: 1.4;
    margin-bottom: 6px;
    color: var(--secondary-color);
    font-weight: 700;
  }
  
  .smaller {
    font-size: 0.7rem !important;
  }
  
  /* Price and button row for mobile */
  .book .price-button-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid rgba(122, 27, 49, 0.1);
  }
  
  .book .price-display {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--secondary-color);
  }
  
  /* Hide the old price display for mobile */
  .book p {
    display: none;
  }
  
  /* For larger screens, hide the new layout and show the original */
  @media (min-width: 481px) {
    .book .price-button-row {
      display: none;
    }
    
    .book p {
      display: block;
    }
  }
  
  /* Button improvements for touch */
  .btn {
    padding: 12px 18px;
    font-size: 0.9rem;
    min-height: 42px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    font-weight: 600;
  }
  
  .book .add-to-cart {
    padding: 8px 14px;
    font-size: 0.85rem;
    min-height: 36px;
    border-radius: 6px;
    margin: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, #8a1f37 100%);
    border: none;
    box-shadow: 0 2px 4px rgba(122, 27, 49, 0.2);
  }
  
  .book .add-to-cart:active {
    transform: scale(0.95);
    box-shadow: 0 1px 2px rgba(122, 27, 49, 0.3);
  }
  
  .book .btn-remove {
    background: linear-gradient(135deg, var(--remove-color) 0%, #b91c1c 100%);
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
  }
  
  /* Hide the old price display for mobile */
  .book p {
    display: none;
  }
  
  /* Cart improvements */
  #cart {
    position: static;
    width: 100%;
    margin-top: 24px;
    margin-bottom: 40px;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 1rem;
  }
  
  /* Form improvements */
  #add-child-form {
    width: 95%;
    padding: 24px 20px;
    border-radius: 12px;
  }
  
  #add-child-form input,
  #add-child-form select {
    padding: 14px 16px;
    font-size: 1rem;
    min-height: 48px;
  }
  
  /* Dropdown improvements */
  .custom-dropdown {
    margin-bottom: 16px;
  }
  
  .dropdown-button {
    padding: 14px 16px;
    min-height: 48px;
    font-size: 1rem;
  }
  
  .dropdown-list {
    max-height: 40vh;
  }
  
  .dropdown-list li {
    padding: 12px 16px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  
  /* Footer improvements */
  footer {
    padding: 24px 0 0 0;
    margin-top: 32px;
  }
  
  .footer-columns {
    flex-direction: column;
    gap: 20px;
  }
  
  .footer-column {
    margin-bottom: 0;
    text-align: center;
  }
  
  .footer-column h4 {
    font-size: 1.1rem;
    margin-bottom: 12px;
  }
  
  .footer-column p,
  .footer-column ul {
    font-size: 0.9rem;
  }
}

/* Tablet improvements */
@media (min-width: 481px) and (max-width: 768px) {
  .container {
    padding: 24px 20px;
  }
  
  .book-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .book {
    padding: 20px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 1px solid rgba(122, 27, 49, 0.08);
    box-shadow: 0 4px 16px rgba(122, 27, 49, 0.08);
    transition: all 0.3s ease;
  }
  
  .book:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(122, 27, 49, 0.12);
  }
  
  .book-image {
    width: 100%;
    height: 160px;
    margin-bottom: 16px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  }
  
  .book-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  
  .book h3 {
    font-size: 1.1rem;
    line-height: 1.3;
    color: var(--primary-color);
    font-weight: 600;
  }
  
  .book p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--secondary-color);
    font-weight: 700;
  }
  
  .btn {
    padding: 16px 24px;
    font-size: 1rem;
    min-height: 48px;
    border-radius: 10px;
    font-weight: 600;
  }
  
  .book .add-to-cart {
    padding: 12px 20px;
    font-size: 0.95rem;
    min-height: 44px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #8a1f37 100%);
    border: none;
    box-shadow: 0 3px 8px rgba(122, 27, 49, 0.2);
  }
  
  .book .add-to-cart:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(122, 27, 49, 0.3);
  }
  
  .book .btn-remove {
    background: linear-gradient(135deg, var(--remove-color) 0%, #b91c1c 100%);
    box-shadow: 0 3px 8px rgba(220, 38, 38, 0.2);
  }
  
  /* Cart positioning for tablet */
  #cart {
    position: static;
    width: 100%;
    margin-top: 32px;
    padding: 20px 24px;
    border-radius: 16px;
  }
  
  /* Child info improvements */
  .child-info {
    padding: 24px 20px;
    margin-bottom: 24px;
  }
  
  .child-header {
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }
  
  .child-header .child-school-logo img {
    width: 60px;
    height: 60px;
  }
  
  /* Hero text improvements */
  .hero-text {
    padding: 32px 28px;
    margin: 24px 0;
  }
  
  .hero-text h1 {
    font-size: 2rem;
  }
  
  .hero-text p {
    font-size: 1.1rem;
  }
}

/* Large tablet and small desktop */
@media (min-width: 769px) and (max-width: 1023px) {
  .child-info {
    padding: 32px 28px;
    margin-bottom: 32px;
    border-radius: 24px;
  }

  .child-details h3 {
    font-size: 1.5rem;
    margin-bottom: 16px;
  }

  .child-details p {
    font-size: 1.05rem;
    margin-bottom: 10px;
  }

  .child-info-icon {
    font-size: 1.1rem;
    width: 24px;
  }

  .child-header .child-school-logo img {
    width: 70px;
    height: 70px;
    border-radius: 16px;
  }

  .child-actions button {
    padding: 14px 24px;
    font-size: 1rem;
    border-radius: 14px;
  }

  .child-actions button i {
    margin-left: 8px;
    font-size: 1rem;
  }

  .child-books-count {
    padding: 4px 12px;
    font-size: 0.9rem;
  }
}

/* Desktop improvements */
@media (min-width: 1024px) {
  .container {
    max-width: 1200px;
    padding: 40px 32px;
  }
  
  .book-list {
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
  }
  
  /* Enhanced desktop book cards */
  .book {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 380px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(122, 27, 49, 0.12);
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    position: relative;
    padding-bottom: 72px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  }
  
  .book:hover {
    box-shadow: 0 20px 60px rgba(122, 27, 49, 0.18);
  }
  
  .book-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 20px 20px 0 0;
    margin: 0;
    box-shadow: none;
    background: #f7f7fa;
  }
  
  .book-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 20px 0 20px;
    text-align: center;
  }
  
  .book h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
    margin-top: 0;
    text-align: center;
    max-width: 100%;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
  }
  
  .book p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #666;
    margin-bottom: 16px;
  }
  
  .book .add-to-cart {
    width: 100%;
    border-radius: 0 0 20px 20px;
    margin: 0;
    padding: 18px 0;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: none;
    border-top: 1px solid #eee;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    color: #fff;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    min-height: 56px;
  }
  
  .book .add-to-cart:hover {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    box-shadow: 0 4px 16px rgba(255, 153, 0, 0.2);
  }
  
  .book .btn-remove {
    background: linear-gradient(90deg, #dc2626, #7a1b31);
    color: #fff;
    border: none;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 2px 8px rgba(220,38,38,0.10);
    border-top: 1px solid #eee;
    font-size: 1.1rem;
    font-weight: 700;
    width: 100%;
    margin: 0;
    padding: 16px 0;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    transition: background 0.3s, transform 0.2s;
  }
  
  .book .btn-remove:hover {
    background: linear-gradient(90deg, #a61b1b, #7a1b31);
    color: #fff;
    box-shadow: 0 4px 16px rgba(220,38,38,0.18);
  }
  
  /* Cart positioning for desktop */
  #cart {
    position: fixed;
    top: 20px;
    left: 20px;
    width: auto;
    margin-top: 0;
    padding: 16px 24px;
    border-radius: 25px;
  }
}

/* Ultra-wide desktop */
@media (min-width: 1440px) {
  .container {
    max-width: 1400px;
    padding: 48px 40px;
  }
  
  .book-list {
    grid-template-columns: repeat(5, 1fr);
    gap: 36px;
  }
  
  .book {
    min-height: 400px;
  }
  
  .book-image {
    height: 220px;
  }
  
  .book h3 {
    font-size: 1.3rem;
  }
  
  .book p {
    font-size: 1rem;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets */
  .btn {
    min-height: 48px;
    padding: 16px 24px;
  }
  
  .book .add-to-cart {
    min-height: 44px;
    padding: 14px 20px;
  }
  
  .dropdown-button {
    min-height: 48px;
    padding: 16px 20px;
  }
  
  .dropdown-list li {
    min-height: 48px;
    padding: 14px 20px;
  }
  
  /* Remove hover effects on touch devices */
  .book:hover {
    /* No movement for touch devices */
  }
  
  .btn:hover {
    /* No movement for touch devices */
  }
  
  /* Add active states for touch feedback */
  .btn:active {
    /* Touch feedback without movement */
  }
  
  .book .add-to-cart:active {
    /* Touch feedback without movement */
  }
}

/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .book-image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
  
  .logo-image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Landscape mobile optimizations */
@media (max-width: 768px) and (orientation: landscape) {
  .container {
    padding: 20px;
  }
  .book-list {
    gap: 12px;
  }
  .book {
    min-height: 200px;
  }
  .book-image {
    height: 120px;
  }
  .book-info {
    min-height: 80px;
  }
  .book h3 {
    font-size: 1rem;
  }
  .book p {
    font-size: 1rem;
  }
  .btn {
    padding: 10px 16px;
    font-size: 0.85rem;
  }
  .child-info {
    padding: 20px;
    margin-bottom: 20px;
  }
  .child-details h3 {
    font-size: 1.2rem;
  }
  .child-details p {
    font-size: 0.9rem;
  }
  .child-header .child-school-logo img {
    width: 45px;
    height: 45px;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .book:hover {
    /* No movement for reduced motion */
  }
  
  .btn:hover {
    /* No movement for reduced motion */
  }
}

/* Print styles */
@media print {
  .book-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .book {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  .btn {
    display: none;
  }
  
  #cart {
    display: none;
  }
  
  .hero-text {
    background: none;
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* Focus improvements for keyboard navigation */
@media (any-hover: hover) {
  .book:focus-within {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
  }
  
  .btn:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
  }
}

/* Dark mode support for mobile */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
  .book {
    background-color: #1a1a1a;
    border-color: #333;
  }
  
  .book h3 {
    color: #fff;
  }
  
  .book p {
    color: #ccc;
  }
  
  .child-info {
    background-color: #1a1a1a;
    border-color: #333;
  }
  
  .dropdown-button,
  .dropdown-list {
    background-color: #1a1a1a;
    border-color: #333;
    color: #fff;
  }
  
  .dropdown-list li:hover {
    background-color: #333;
  }
}

@media (max-width: 768px) {
  .book .add-to-cart,
  .book .btn-remove {
    min-height: 34px !important;
    padding: 0 10px !important;
    font-size: 0.95rem;
  }
}

@media (prefers-color-scheme: dark) and (max-width: 768px) {
  .child-info {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  }

  .child-info:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  }

  .child-details h3 {
    color: #ffffff;
  }

  .child-details p {
    color: #b0b0b0;
  }

  .child-info-icon {
    color: var(--secondary-color);
  }

  .child-header .child-school-logo img {
    background: #2d2d2d;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .child-books-count {
    background: linear-gradient(135deg, rgba(255, 153, 0, 0.2) 0%, rgba(255, 153, 0, 0.1) 100%);
    border: 1px solid rgba(255, 153, 0, 0.3);
  }

  .child-actions button {
    background: linear-gradient(135deg, var(--primary-color) 0%, #6a1b31 100%);
    box-shadow: 0 4px 12px rgba(122, 27, 49, 0.4);
  }

  .child-actions button:hover {
    box-shadow: 0 6px 16px rgba(122, 27, 49, 0.5);
  }
}

@media (prefers-reduced-motion: reduce) {
  .child-info {
    animation: none;
  }

  .child-info:hover {
    transform: none;
  }

  .child-actions button:hover {
    transform: none;
  }

  .child-actions button i {
    transition: none;
  }

  .child-actions button:hover i {
    transform: none;
  }

  .child-books-count:hover {
    transform: none;
  }

  .child-details p:hover .child-info-icon {
    transform: none;
  }

  .child-header .child-school-logo img:hover {
    transform: none;
  }
}

@media (hover: none) and (pointer: coarse) {
  .child-info:hover {
    transform: none;
  }

  .child-actions button:hover {
    transform: none;
  }

  .child-actions button:active {
    transform: scale(0.95);
  }

  .child-books-count:hover {
    transform: none;
  }

  .child-details p:hover .child-info-icon {
    transform: none;
  }

  .child-header .child-school-logo img:hover {
    transform: none;
  }

  .child-header .child-school-logo img:active {
    transform: scale(0.95);
  }
}

@media (prefers-contrast: high) {
  .child-info {
    border: 2px solid var(--primary-color);
  }

  .child-info::before {
    height: 6px;
  }

  .child-actions button {
    border: 2px solid var(--primary-color);
  }

  .child-books-count {
    border: 2px solid var(--secondary-color);
  }

  .child-header .child-school-logo img {
    border: 2px solid var(--primary-color);
  }
}

@media print {
  .child-info {
    background: white !important;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    break-inside: avoid;
  }

  .child-info::before,
  .child-info::after {
    display: none !important;
  }

  .child-actions button {
    background: white !important;
    color: black !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
  }

  .child-books-count {
    background: #f0f0f0 !important;
    border: 1px solid #ccc !important;
    color: black !important;
  }

  .child-header .child-school-logo img {
    background: white !important;
    border: 1px solid #ccc !important;
  }
}

@media (any-hover: hover) {
  .child-info:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
  }

  .child-actions button:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
  }

  .child-header .child-school-logo img:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
  }
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .child-info {
    border-width: 0.5px;
  }

  .child-actions button {
    border-width: 0.5px;
  }

  .child-books-count {
    border-width: 0.5px;
  }

  .child-header .child-school-logo img {
    border-width: 0.5px;
  }
}

@media (max-width: 768px) and (orientation: landscape) {
  .child-info {
    padding: 16px;
    margin-bottom: 16px;
  }

  .child-details h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
  }

  .child-details p {
    font-size: 0.85rem;
    margin-bottom: 4px;
  }

  .child-info-icon {
    font-size: 0.85rem;
    width: 16px;
  }

  .child-header .child-school-logo img {
    width: 40px;
    height: 40px;
    /* border-radius: 8px; */
  }

  .child-actions button {
    padding: 8px 12px;
    font-size: 0.8rem;
    border-radius: 8px;
  }

  .child-actions button i {
    margin-left: 3px;
    font-size: 0.8rem;
  }

  .child-books-count {
    padding: 1px 6px;
    font-size: 0.75rem;
  }
}

@media (max-width: 768px) and (orientation: portrait) {
  .child-info {
    padding: 24px 20px;
    margin-bottom: 24px;
  }

  .child-details h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
  }

  .child-details p {
    font-size: 0.95rem;
    margin-bottom: 8px;
  }

  .child-info-icon {
    font-size: 1rem;
    width: 20px;
  }

  .child-header .child-school-logo img {
    width: 55px;
    height: 55px;
    /* border-radius: 12px; */
  }

  .child-actions button {
    padding: 12px 18px;
    font-size: 0.9rem;
    border-radius: 12px;
  }

  .child-actions button i {
    margin-left: 5px;
    font-size: 0.9rem;
  }

  .child-books-count {
    padding: 3px 9px;
    font-size: 0.85rem;
  }
}

@media (min-width: 1024px) {
  .child-info {
    padding: 36px 32px;
    margin-bottom: 36px;
    border-radius: 28px;
  }

  .child-details h3 {
    font-size: 1.6rem;
    margin-bottom: 18px;
  }

  .child-details p {
    font-size: 1.1rem;
    margin-bottom: 12px;
  }

  .child-info-icon {
    font-size: 1.2rem;
    width: 26px;
  }

  .child-header .child-school-logo img {
    width: 80px;
    height: 80px;
    /* border-radius: 18px; */
  }

  .child-actions button {
    padding: 16px 28px;
    font-size: 1.1rem;
    border-radius: 16px;
  }

  .child-actions button i {
    margin-left: 10px;
    font-size: 1.1rem;
  }

  .child-books-count {
    padding: 5px 14px;
    font-size: 1rem;
  }
}

@media (min-width: 1440px) {
  .child-info {
    padding: 40px 36px;
    margin-bottom: 40px;
    border-radius: 32px;
  }

  .child-details h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
  }

  .child-details p {
    font-size: 1.2rem;
    margin-bottom: 14px;
  }

  .child-info-icon {
    font-size: 1.3rem;
    width: 28px;
  }

  .child-header .child-school-logo img {
    width: 90px;
    height: 90px;
    /* border-radius: 20px; */
  }

  .child-actions button {
    padding: 18px 32px;
    font-size: 1.2rem;
    border-radius: 18px;
  }

  .child-actions button i {
    margin-left: 12px;
    font-size: 1.2rem;
  }

  .child-books-count {
    padding: 6px 16px;
    font-size: 1.1rem;
  }
}

@media (min-width: 1920px) {
  .child-info {
    padding: 44px 40px;
    margin-bottom: 44px;
    border-radius: 36px;
  }

  .child-details h3 {
    font-size: 2rem;
    margin-bottom: 22px;
  }

  .child-details p {
    font-size: 1.3rem;
    margin-bottom: 16px;
  }

  .child-info-icon {
    font-size: 1.4rem;
    width: 30px;
  }

  .child-header .child-school-logo img {
    width: 100px;
    height: 100px;
    /* border-radius: 24px; */
  }

  .child-actions button {
    padding: 20px 36px;
    font-size: 1.3rem;
    border-radius: 20px;
  }

  .child-actions button i {
    margin-left: 14px;
    font-size: 1.3rem;
  }

  .child-books-count {
    padding: 7px 18px;
    font-size: 1.2rem;
  }
}

@media (min-width: 769px) {
  .book .price-display {
    display: none;
  }
  .book p {
    display: block;
  }
}

