/* ===== Custom CSS Overrides for Masail Theme ===== */

/* Smooth scroll offset for fixed header */
html {
  scroll-padding-top: 80px;
}

/* Fix smooth scroll calculation */
a[href^="#"] {
  scroll-behavior: smooth;
}

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

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

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

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

/* Selection color */
::selection {
  background: var(--color-gold);
  color: var(--color-white);
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Amelia Plugin Style Integration */
#amelia-app {
  font-family: 'Tajawal', sans-serif !important;
  direction: rtl;
}

/* Ensure Amelia booking is properly styled within our theme */
.ameliabooking {
  max-width: 100%;
  margin: 20px auto;
}

.ameliabooking-container {
  font-family: 'Tajawal', sans-serif !important;
}

/* Page wrapper for inner pages */
.page-content .entry-content h1,
.page-content .entry-content h2,
.page-content .entry-content h3 {
  color: var(--color-primary);
  margin-bottom: 20px;
}

.page-content .entry-content p {
  margin-bottom: 16px;
}

.page-content .entry-content a {
  color: var(--color-primary);
  text-decoration: underline;
}

.page-content .entry-content a:hover {
  color: var(--color-gold);
}

/* ===== WooCommerce Styling ===== */
.masail-woocommerce {
  direction: rtl;
  font-family: 'Tajawal', sans-serif;
}

/* Shop Page Title */
.woocommerce-products-header__title {
  text-align: center;
  font-size: 2.5rem !important;
  color: var(--color-primary) !important;
  font-weight: 700 !important;
  position: relative;
  display: block;
  margin-bottom: 40px;
}

.woocommerce-products-header__title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 50%;
  transform: translateX(50%);
  width: 60px;
  height: 3px;
  background: var(--color-gold);
  border-radius: 2px;
}

/* Product Cards */
ul.products li.product {
  background: var(--color-white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid var(--color-border);
  transition: all 0.3s ease;
  text-align: center;
  padding: 0;
}

ul.products li.product:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  border-color: var(--color-gold);
}

ul.products li.product img {
  border-radius: 12px 12px 0 0;
  margin: 0;
}

ul.products li.product .woocommerce-loop-product__title {
  color: var(--color-primary);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 15px 20px 5px;
}

ul.products li.product .price {
  color: var(--color-gold) !important;
  font-size: 1.15rem;
  font-weight: 800;
  padding: 0 20px 10px;
}

ul.products li.product .price del {
  color: var(--color-text-muted) !important;
  font-size: 0.9rem;
}

ul.products li.product .button {
  background: var(--color-primary);
  color: var(--color-white) !important;
  border-radius: 50px;
  padding: 10px 28px;
  font-family: 'Tajawal', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  margin: 10px 20px 20px;
  transition: all 0.3s ease;
  display: inline-block;
}

ul.products li.product .button:hover {
  background: var(--color-primary-light);
  transform: translateY(-2px);
}

ul.products li.product .button.added {
  background: var(--color-gold) !important;
}

/* Star Ratings */
ul.products li.product .star-rating {
  color: var(--color-gold);
  margin: 0 auto;
}

/* WooCommerce Pagination */
.woocommerce-pagination ul.page-numbers {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 40px 0;
}

.woocommerce-pagination ul.page-numbers li a,
.woocommerce-pagination ul.page-numbers li span {
  padding: 10px 16px;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-primary);
  font-weight: 600;
  transition: all 0.3s ease;
}

.woocommerce-pagination ul.page-numbers li a:hover,
.woocommerce-pagination ul.page-numbers li span.current {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

/* ===== Checkout Page ===== */
.woocommerce-checkout {
  max-width: 100%;
}

.woocommerce-checkout h1,
.woocommerce-checkout h2,
.woocommerce-checkout h3 {
  color: var(--color-primary);
}

/* Checkout Form */
.woocommerce form .form-row label {
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.95rem;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce-page .select2-container .select2-selection--single {
  border: 2px solid var(--color-border);
  border-radius: 8px;
  padding: 12px 16px;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  background: var(--color-white);
  color: var(--color-text);
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(13, 74, 46, 0.1);
  outline: none;
}

/* Checkout Section Titles */
.woocommerce-checkout #customer_details h3,
.woocommerce-checkout #order_review_heading {
  font-size: 1.4rem;
  color: var(--color-primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-border);
}

/* Checkout Buttons */
.woocommerce button.button,
.woocommerce a.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
  background: var(--color-primary) !important;
  color: var(--color-white) !important;
  border-radius: 8px !important;
  padding: 14px 32px !important;
  font-family: 'Tajawal', sans-serif !important;
  font-weight: 700 !important;
  font-size: 1rem !important;
  border: none !important;
  transition: all 0.3s ease !important;
}

.woocommerce button.button:hover,
.woocommerce a.button:hover,
.woocommerce input.button:hover {
  background: var(--color-primary-light) !important;
  transform: translateY(-2px);
}

/* Place Order Button */
.woocommerce-checkout-payment .button#place_order {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light)) !important;
  font-size: 1.1rem !important;
  padding: 16px 40px !important;
  border-radius: 50px !important;
  width: 100%;
}

.woocommerce-checkout-payment .button#place_order:hover {
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary)) !important;
}

/* Order Review Table */
.woocommerce-checkout-review-order-table {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid var(--color-border);
}

.woocommerce-checkout-review-order-table th {
  background: var(--color-primary);
  color: var(--color-white);
  font-weight: 700;
  padding: 14px 18px !important;
}

.woocommerce-checkout-review-order-table td {
  padding: 12px 18px !important;
  border-bottom: 1px solid var(--color-border);
}

.woocommerce-checkout-review-order-table .order-total th,
.woocommerce-checkout-review-order-table .order-total td {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-primary);
  background: var(--color-bg-section);
}

/* Payment Methods */
.woocommerce-checkout-payment {
  background: var(--color-white);
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid var(--color-border);
}

/* ===== Cart Page ===== */
.woocommerce-cart {
  max-width: 100%;
}

/* Cart Table */
.woocommerce table.shop_table {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid var(--color-border);
}

.woocommerce table.shop_table th {
  background: var(--color-primary);
  color: var(--color-white);
  font-weight: 700;
  padding: 14px 18px;
}

.woocommerce table.shop_table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.woocommerce table.shop_table .product-name a {
  color: var(--color-primary);
  font-weight: 700;
}

.woocommerce table.shop_table .product-name a:hover {
  color: var(--color-gold);
}

/* Quantity Input */
.woocommerce .quantity .qty {
  border: 2px solid var(--color-border);
  border-radius: 8px;
  padding: 8px;
  width: 80px;
  text-align: center;
  font-family: 'Tajawal', sans-serif;
}

/* Cart Totals */
.cart_totals {
  background: var(--color-white);
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid var(--color-border);
}

.cart_totals h2 {
  color: var(--color-primary);
  font-size: 1.3rem;
  margin-bottom: 15px;
}

/* Remove Product Link */
.woocommerce table.shop_table td.product-remove a {
  color: #cc3333 !important;
  font-size: 1.2rem;
  width: auto !important;
  height: auto !important;
}

.woocommerce table.shop_table td.product-remove a:hover {
  color: #ff4444 !important;
  background: transparent !important;
}

/* Coupon */
.woocommerce table.shop_table td.actions .coupon .input-text {
  border: 2px solid var(--color-border);
  border-radius: 8px;
  padding: 10px 16px;
  font-family: 'Tajawal', sans-serif;
}

/* ===== WooCommerce Notices ===== */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 25px;
  font-size: 0.95rem;
}

.woocommerce-message {
  border-top-color: var(--color-primary);
  background: rgba(13, 74, 46, 0.05);
}

.woocommerce-info {
  border-top-color: var(--color-gold);
  background: rgba(201, 168, 76, 0.05);
}

.woocommerce-error {
  border-top-color: #cc3333;
  background: rgba(204, 51, 51, 0.05);
}

.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before {
  color: inherit;
}

/* ===== WooCommerce Breadcrumb ===== */
.woocommerce-breadcrumb {
  margin-bottom: 30px;
  padding: 12px 20px;
  background: var(--color-white);
  border-radius: 8px;
  border: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.woocommerce-breadcrumb a {
  color: var(--color-primary);
}

.woocommerce-breadcrumb a:hover {
  color: var(--color-gold);
}

/* ===== Single Product Page ===== */
.single-product div.product .product_title {
  color: var(--color-primary);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 15px;
}

.single-product div.product .price {
  color: var(--color-gold) !important;
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 20px;
}

.single-product div.product .woocommerce-product-details__short-description {
  color: var(--color-text-light);
  line-height: 1.9;
  margin-bottom: 25px;
}

/* Tabs */
.woocommerce-tabs ul.tabs {
  border-bottom: 2px solid var(--color-border);
  display: flex;
  gap: 0;
  margin-bottom: 25px;
}

.woocommerce-tabs ul.tabs li {
  border: none !important;
  background: transparent !important;
  border-radius: 8px 8px 0 0 !important;
  margin: 0;
}

.woocommerce-tabs ul.tabs li a {
  color: var(--color-text-light);
  padding: 12px 24px;
  font-weight: 600;
  border-radius: 8px 8px 0 0;
}

.woocommerce-tabs ul.tabs li.active {
  border-bottom: 3px solid var(--color-primary) !important;
}

.woocommerce-tabs ul.tabs li.active a {
  color: var(--color-primary);
  background: var(--color-white);
}

/* Loading animation for placeholders */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Print styles */
@media print {
  .site-header,
  .back-to-top,
  .hero-scroll-indicator {
    display: none !important;
  }

  .hero-section {
    min-height: auto;
    padding: 40px 0;
  }

  body {
    color: #000;
    background: #fff;
  }
}

/* WooCommerce Responsive */
@media (max-width: 768px) {
  .woocommerce .col2-set .col-1,
  .woocommerce .col2-set .col-2,
  .woocommerce-page .col2-set .col-1,
  .woocommerce-page .col2-set .col-2 {
    width: 100%;
    float: none;
  }

  .woocommerce-checkout #customer_details,
  .woocommerce-checkout #order_review {
    width: 100%;
    float: none;
  }

  .woocommerce table.shop_table {
    font-size: 0.85rem;
  }

  .woocommerce table.shop_table td,
  .woocommerce table.shop_table th {
    padding: 10px 12px;
  }
}
