img {
  max-width: 100%;
  height: auto;
  display: block;
}
/* ================= GLOBAL ================= */

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

body {
  font-family: 'Heebo', sans-serif;
  direction: rtl;
  background: white;
}

/* ============= UNIFIED NAVBAR WITH HAMBURGER ============ */
.navbar {
  background: #3f6f77;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 60px;
  color: white;
  position: relative;
}

.navbar .logo {
  font-size: 34px;
  font-weight: 800;
  z-index: 1002;
}

.navbar .logo img {
  height: 50px;
  width: auto;
  display: block;
}

/* Hamburger Menu Button */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1002;
}

.hamburger span {
  width: 28px;
  height: 3px;
  background: white;
  border-radius: 3px;
  transition: 0.3s;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Desktop Menu */
.nav-center {
  display: flex;
  gap: 35px;
}

.nav-center a {
  color: white;
  text-decoration: none;
  font-size: 17px;
  transition: 0.3s;
}

.nav-center a:hover {
  color: #d7b84a;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 15px;
  z-index: 1002;
}

.nav-left img {
  height: 24px;
  margin-left: 10px;
}

/* ============= CART AREA ============ */
.cart-area {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 25px;
    transition: 0.3s;
    position: relative;
    background: rgba(255,255,255,0.1);
    border: 2px solid transparent;
}

.cart-area:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
}

/* Cart has items — more visible */
.cart-area.has-items {
    background: #d7b84a;
    border-color: #c9a83a;
}

.cart-area.has-items:hover {
    background: #c9a83a;
    border-color: #b89030;
}

/* Pulsing dot when cart has items */
.cart-area.has-items::before {
    content: '';
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    background: #e74c3c;
    border-radius: 50%;
    border: 2px solid #3f6f77;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(231,76,60,0.5); }
    70%  { box-shadow: 0 0 0 8px rgba(231,76,60,0); }
    100% { box-shadow: 0 0 0 0 rgba(231,76,60,0); }
}

.cart-icon {
    height: 20px;
    width: auto;
    flex-shrink: 0;
}

.cart-label {
    font-size: 15px;
    font-weight: 600;
}

.cart-badge {
    background: rgba(255,255,255,0.25);
    color: white;
    font-size: 13px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 12px;
    min-width: 22px;
    text-align: center;
    transition: 0.3s;
}

.cart-area.has-items .cart-badge {
    background: white;
    color: #3f6f77;
}

.secure-badge {
    font-size: 13px;
    opacity: 0.7;
    margin-right: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.payment-icon {
    height: 18px;
    width: auto;
    opacity: 0.9;
    vertical-align: middle;
}

.cart-area.has-items .payment-icon {
    opacity: 1;
}

/* ================= HERO (HOMEPAGE) ================= */

.hero {
  position: relative;
  background: #c2a24c;
  min-height: 700px;
  padding: 60px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(194,162,76,0.9);
  top: 0;
  left: 0;
}

.hero-content {
  position: relative;
  display: flex;
  width: 90%;
  max-width: 1400px;
  justify-content: center;
  align-items: center;
  gap: 40px;
}

/* BOOK SIDE */

.book-side {
  text-align: center;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.book-img {
  width: 520px;
  margin-bottom: 0;
}

.buy-btn {
  background: #2f5f66;
  color: white;
  border: none;
  padding: 14px 50px;
  border-radius: 12px;
  font-size: 16px;
  margin-bottom: 15px;
}

.price-blue {
  font-size: 28px;
  color: #2f5f66;
  font-weight: 600;
}

/* TEXT SIDE */

.text-side {
  text-align: right;
  max-width: 550px;
}

.headline {
  font-size: 40px;
  color: #8a0d0d;
  margin-bottom: 20px;
}

.subheadline {
  font-size: 28px;
  color: black;
  font-weight: 400;
  margin-bottom: 35px;
}

.cta-btn {
  background: #3f6f77;
  color: white;
  border: none;
  padding: 16px 60px;
  border-radius: 30px;
  font-size: 16px;
  margin-bottom: 30px;
  cursor: pointer;
  transition: 0.3s;
}

.cta-btn:hover {
  background: #2d535c;
  transform: translateY(-2px);
}

.price-area {
  font-size: 26px;
}

.old-price {
  text-decoration: line-through;
  margin-left: 15px;
  color: #8a0d0d;
}

.new-price {
  color: #8a0d0d;
  font-weight: 600;
}

/* Hero book-side add to cart button */

.add-cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #2f5f66;
  color: white;
  border: none;
  padding: 13px 40px;
  border-radius: 25px;
  font-size: 16px;
  font-family: 'Heebo', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  margin-top: 0;
  align-self: center;
}

.add-cart-btn:hover {
  background: #1e4048;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.btn-cart-icon {
  width: 18px;
  height: auto;
}

/* ================= CART DRAWER ================= */

.cart-link {
  cursor: pointer;
  background: rgba(255,255,255,0.15);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 15px;
  transition: 0.3s;
}

.cart-link:hover {
  background: rgba(255,255,255,0.25);
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  height: 100vh;
  background: white;
  box-shadow: -5px 0 30px rgba(0,0,0,0.2);
  z-index: 1001;
  transform: translateX(100%);
  transition: 0.3s;
  display: flex;
  flex-direction: column;
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  border-bottom: 1px solid #eee;
  background: #3f6f77;
  color: white;
}

.cart-header h3 {
  font-size: 20px;
}

.close-btn {
  background: none;
  border: none;
  font-size: 28px;
  color: white;
  cursor: pointer;
  line-height: 1;
}

.cart-items-list {
  flex: 1;
  overflow-y: auto;
  padding: 20px 25px;
}

.cart-items-list p {
  text-align: center;
  color: #888;
  font-size: 15px;
  padding: 30px 0;
}

.cart-footer {
  padding: 20px 25px;
  border-top: 1px solid #eee;
  background: #f9f9f9;
}

.checkout-btn {
  width: 100%;
  background: #3f6f77;
  color: white;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  transition: 0.3s;
}

.checkout-btn:hover {
  background: #2d535c;
}

#overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
}

/* ================= CHECKOUT POPUP ================= */

.checkout-popup {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.checkout-popup-inner {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 480px;
    width: 90%;
    text-align: center;
    direction: rtl;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    position: relative;
    animation: popupSlideIn 0.3s ease;
}

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

.checkout-popup-icon {
    font-size: 50px;
    margin-bottom: 15px;
}

.checkout-popup h2 {
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 26px;
    color: #2a2018;
    margin-bottom: 10px;
}

.checkout-popup p {
    font-size: 15px;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

.checkout-popup-total {
    font-size: 22px;
    font-weight: 700;
    color: #3f6f77;
    margin-bottom: 25px;
}

.checkout-popup-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.checkout-popup .checkout-btn {
    background: #3f6f77;
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 25px;
    font-size: 15px;
    font-family: 'Heebo', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.checkout-popup .checkout-btn:hover {
    background: #2d535c;
}

.checkout-popup .continue-btn {
    background: white;
    color: #3f6f77;
    border: 2px solid #3f6f77;
    padding: 12px 28px;
    border-radius: 25px;
    font-size: 15px;
    font-family: 'Heebo', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.checkout-popup .continue-btn:hover {
    background: #e8f2f4;
}

.checkout-popup .close-popup-btn {
    position: absolute;
    top: 15px;
    left: 20px;
    background: none;
    border: none;
    font-size: 26px;
    color: #999;
    cursor: pointer;
}

.checkout-popup .close-popup-btn:hover { color: #333; }

/* ===== ENHANCED CART STYLES ===== */

.cart-subtotal-row {
    font-size: 15px;
    color: #555;
    margin-bottom: 6px;
    text-align: left;
}

.cart-delivery-row {
    font-size: 14px;
    color: #555;
    margin-bottom: 6px;
    text-align: left;
    padding: 8px 0;
    border-top: 1px solid #eee;
}

.cart-delivery-row div {
    display: flex;
    justify-content: space-between;
}

/* Delivery options */

.delivery-section {
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-top: 5px;
}

.delivery-label {
    font-size: 13px;
    color: #777;
    margin-bottom: 8px;
}

.delivery-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.delivery-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 14px;
    color: #333;
}

.delivery-option:hover {
    border-color: #3f6f77;
    background: #f0f7f8;
}

.delivery-option.selected {
    border-color: #3f6f77;
    background: #e8f2f4;
    color: #2d535c;
}

.delivery-option input[type="radio"] {
    accent-color: #3f6f77;
    width: 16px;
    height: 16px;
}

.delivery-name {
    flex: 1;
}

.delivery-price {
    font-weight: 600;
    color: #3f6f77;
}

/* Cart item rows */

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

.cart-item-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.cart-item-name {
    font-size: 15px;
    font-weight: 600;
    color: #2a2018;
}

.cart-item-price {
    font-size: 14px;
    color: #555;
}

.cart-remove-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 22px;
    cursor: pointer;
    padding: 0 0 0 6px;
    line-height: 1;
    transition: 0.2s;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-remove-btn:hover {
    color: #c0392b;
    background: #fdf0f0;
}

.cart-empty {
    text-align: center;
    color: #999;
    font-size: 15px;
    padding: 30px 0;
}

/* Grand total row */

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
    color: #3f6f77;
    padding: 10px 0;
    border-top: 2px solid #3f6f77;
    margin-top: 5px;
}

/* ===== SITE FOOTER ===== */

.site-footer {
    background: #4f7680;
    color: white;
    text-align: center;
    padding: 30px 20px;
    direction: rtl;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.footer-links {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-size: 15px;
    transition: 0.3s;
}

.footer-links a:hover {
    color: #d7b84a;
}

.footer-sep {
    color: rgba(255,255,255,0.4);
}

.footer-text {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
}

/* ================= SUMMARY SECTION ================= */
.summary {
    background: #4f7680;
    color: white;
    padding: 90px 20px;
    text-align: center;
}

.summary h2 {
    font-size: 48px;
    font-weight: 300;
}

.gold-line {
    width: 120px;
    height: 4px;
    background: #d1a64a;
    margin: 25px auto;
}

.summary p {
    max-width: 900px;
    margin: 20px auto;
    font-size: 20px;
    line-height: 1.8;
}

/* ================= SECOND SECTION ================= */
.section-two {
    display: flex;
    align-items: center;
}

.section-two img {
    width: 50%;
    display: block;
}

.section-two .text {
    width: 50%;
    padding: 80px;
}

.section-two h2 {
    font-size: 40px;
    color: #3f5f67;
    margin-bottom: 20px;
}

.section-two .text p {
    font-size: 18px;
    line-height: 1.8;
    color: #333;
}

/* ================= FOOTER ================= */
.footer {
    background: #4f7680;
    color: white;
    text-align: center;
    padding: 30px;
}

/* ================= MOBILE RESPONSIVE ================= */

@media (max-width: 1100px) {
  .hero-content {
    flex-direction: column;
    text-align: center;
    gap: 30px;
  }

  .text-side {
    text-align: center;
    max-width: 100%;
  }

  .book-img {
    width: 320px;
  }

  .hero {
    height: auto;
    padding: 60px 20px;
  }

  .headline {
    font-size: 32px;
  }

  .subheadline {
    font-size: 22px;
  }
}

@media (max-width: 900px) {
  /* Show hamburger, hide desktop menu */
  .hamburger {
    display: flex;
  }

  .navbar {
    padding: 15px 20px;
  }

  .navbar .logo img {
    height: 40px;
  }

  /* Mobile menu overlay */
  .nav-center {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: #3f6f77;
    flex-direction: column;
    gap: 0;
    padding-top: 80px;
    transition: 0.3s;
    z-index: 1001;
    box-shadow: -5px 0 20px rgba(0,0,0,0.3);
  }

  .nav-center.active {
    right: 0;
  }

  .nav-center a {
    padding: 18px 30px;
    width: 100%;
    text-align: right;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 16px;
  }

  .nav-center a:hover {
    background: rgba(255,255,255,0.1);
  }

  /* Section two */
  .section-two {
    flex-direction: column;
  }

  .section-two img,
  .section-two .text {
    width: 100%;
  }

  .section-two .text {
    padding: 40px 20px;
  }

  .section-two h2 {
    font-size: 32px;
  }

  .section-two .text p {
    font-size: 16px;
  }

  /* Summary */
  .summary {
    padding: 60px 20px;
  }

  .summary h2 {
    font-size: 32px;
  }

  .summary p {
    font-size: 17px;
  }

  /* Cart drawer */
  .cart-drawer {
    width: 100%;
    max-width: 380px;
  }

  /* Checkout popup */
  .checkout-popup-inner {
    padding: 30px 20px;
  }

  .checkout-popup h2 {
    font-size: 22px;
  }

  /* Footer */
  .footer-links {
    font-size: 14px;
  }

  .footer-links .footer-sep {
    display: none;
  }

  .footer-links a {
    font-size: 13px;
  }
}

@media (max-width: 600px) {
  .book-img {
    width: 240px;
  }

  .headline {
    font-size: 26px;
  }

  .subheadline {
    font-size: 18px;
  }

  .cta-btn {
    padding: 14px 40px;
    font-size: 15px;
  }

  .add-cart-btn {
    padding: 12px 30px;
    font-size: 15px;
  }

  /* Hide secure badge on very small screens */
  .secure-badge {
    display: none;
  }

  .cart-label {
    font-size: 14px;
  }

  /* Checkout popup buttons stack */
  .checkout-popup-btns {
    flex-direction: column;
    width: 100%;
  }

  .checkout-popup .checkout-btn,
  .checkout-popup .continue-btn {
    width: 100%;
  }

  .summary h2 {
    font-size: 26px;
  }

  .summary p {
    font-size: 16px;
  }

  .section-two h2 {
    font-size: 26px;
  }

  .section-two .text {
    padding: 30px 15px;
  }

  /* Mobile menu width */
  .nav-center {
    width: 100%;
    max-width: 300px;
  }

  .navbar .logo img {
    height: 36px;
  }
}
