/* ==========================================================================
   Judil Rentals - Premium WooCommerce Cart & Checkout Design System (v1.5.0)
   Shopify/Stripe-Style Desktop Layout (1fr Flexible Billing + 400px Fixed Order Summary)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --judil-navy: #0B1F3A;
  --judil-navy-dark: #071325;
  --judil-gold: #C9A227;
  --judil-gold-hover: #A8841D;
  --judil-gold-light: rgba(201, 162, 39, 0.1);
  --judil-light-gray: #F8F9FA;
  --judil-dark-gray: #222222;
  --judil-border: #E5E7EB;
  --judil-font-playfair: 'Playfair Display', Georgia, serif;
  --judil-font-inter: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --judil-radius-sm: 8px;
  --judil-radius-md: 12px;
  --judil-radius-lg: 16px;
  --judil-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --judil-shadow-md: 0 4px 20px rgba(11, 31, 58, 0.08);
  --judil-shadow-lg: 0 10px 30px rgba(11, 31, 58, 0.12);
}

/* Reset Base Styles for WooCommerce Standalone Page Layout */
html, body.judil-standalone-checkout,
body.woocommerce-cart,
body.woocommerce-checkout {
  background-color: var(--judil-light-gray) !important;
  font-family: var(--judil-font-inter) !important;
  color: var(--judil-dark-gray) !important;
  margin: 0 !important;
  padding: 0 !important;
  -webkit-font-smoothing: antialiased;
}

/* Universal Box-Sizing Guard */
.judil-checkout-wrapper *,
.woocommerce-checkout * {
  box-sizing: border-box !important;
}

/* Suppress Base WordPress Theme Header/Footer Elements */
body.judil-standalone-checkout header:not(.judil-site-header),
body.judil-standalone-checkout footer:not(.judil-site-footer),
body.woocommerce-cart #masthead,
body.woocommerce-cart .site-header,
body.woocommerce-cart header.entry-header,
body.woocommerce-cart #colophon,
body.woocommerce-cart .site-footer,
body.woocommerce-checkout #masthead,
body.woocommerce-checkout .site-header,
body.woocommerce-checkout header.entry-header,
body.woocommerce-checkout #colophon,
body.woocommerce-checkout .site-footer {
  display: none !important;
}

/* Main Checkout Wrapper & Container System (Matching Next.js max-w-7xl / 1280px) */
.judil-checkout-wrapper {
  width: 100% !important;
  padding-top: 100px;
  padding-bottom: 80px;
  min-height: calc(100vh - 400px);
  background-color: var(--judil-light-gray);
  box-sizing: border-box;
}

.judil-checkout-container {
  max-width: 1280px !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 0 16px !important;
  box-sizing: border-box !important;
}

@media (min-width: 640px) {
  .judil-checkout-container {
    padding: 0 24px !important;
  }
}

@media (min-width: 1024px) {
  .judil-checkout-container {
    padding: 0 32px !important;
  }
}

/* Force 100% width across all WooCommerce internal wrappers */
.judil-checkout-container .woocommerce,
.judil-checkout-container .woocommerce-cart,
.judil-checkout-container .woocommerce-checkout,
.judil-checkout-container .entry-content,
.judil-checkout-container article,
.judil-checkout-container main,
.judil-checkout-container #content,
.judil-checkout-container #primary {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  box-sizing: border-box !important;
}

/* Header Component Styles (.judil-site-header) */
.judil-site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  height: 80px;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--judil-border);
  box-shadow: var(--judil-shadow-sm);
  display: flex;
  align-items: center;
  font-family: var(--judil-font-inter);
}

.judil-header-container {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.judil-brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
}

.judil-logo-img {
  width: 36px;
  height: 36px;
  border-radius: var(--judil-radius-sm);
  object-fit: cover;
  border: 1px solid var(--judil-border);
}

.judil-brand-name {
  font-family: var(--judil-font-playfair);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--judil-navy) !important;
}

.judil-brand-name.white {
  color: #ffffff !important;
}

.judil-brand-gold {
  color: var(--judil-gold);
  font-weight: 300;
  text-transform: lowercase;
}

.judil-nav-desktop {
  display: flex;
  align-items: center;
  gap: 32px;
}

@media (max-width: 768px) {
  .judil-nav-desktop {
    display: none;
  }
}

.judil-nav-link {
  font-family: var(--judil-font-inter);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--judil-navy) !important;
  text-decoration: none !important;
  transition: color 0.2s ease;
}

.judil-nav-link:hover {
  color: var(--judil-gold) !important;
}

.judil-nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.judil-icon-link {
  color: var(--judil-navy) !important;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, background-color 0.2s ease;
  text-decoration: none !important;
}

.judil-icon-link:hover {
  color: var(--judil-gold) !important;
  background-color: var(--judil-light-gray);
}

/* Footer Component Styles (.judil-site-footer) */
.judil-site-footer {
  background-color: var(--judil-navy);
  color: rgba(255, 255, 255, 0.9);
  padding: 64px 0 32px;
  font-family: var(--judil-font-inter);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 60px;
}

.judil-footer-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.judil-footer-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 48px;
}

@media (min-width: 768px) {
  .judil-footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .judil-footer-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
  }
}

.judil-footer-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.judil-footer-desc {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

.judil-footer-title {
  font-family: var(--judil-font-playfair);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--judil-gold) !important;
  margin: 0 0 8px 0;
}

.judil-footer-links {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.judil-footer-links a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8) !important;
  text-decoration: none !important;
  transition: color 0.2s ease;
}

.judil-footer-links a:hover {
  color: var(--judil-gold) !important;
}

.judil-footer-info {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.judil-hours-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
  margin: 0;
}

.judil-hours-text .closed {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.judil-whatsapp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: #25D366;
  color: #ffffff !important;
  font-family: var(--judil-font-inter);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: var(--judil-radius-md);
  text-decoration: none !important;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
  transition: all 0.3s ease;
  margin-top: 8px;
}

.judil-whatsapp-btn:hover {
  background-color: #128C7E;
  transform: translateY(-2px);
}

.judil-footer-bottom {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

@media (min-width: 768px) {
  .judil-footer-bottom {
    flex-direction: row;
  }
}

.judil-footer-legal {
  display: flex;
  align-items: center;
  gap: 24px;
}

.judil-footer-legal a {
  color: rgba(255, 255, 255, 0.4) !important;
  text-decoration: none !important;
  transition: color 0.2s ease;
}

.judil-footer-legal a:hover {
  color: var(--judil-gold) !important;
}

/* Headings */
.woocommerce-cart .entry-title,
.woocommerce-checkout .entry-title,
.woocommerce-page h1,
.woocommerce h1 {
  font-family: var(--judil-font-playfair) !important;
  font-size: 32px !important;
  font-weight: 700 !important;
  color: var(--judil-navy) !important;
  margin-bottom: 28px !important;
  letter-spacing: -0.02em;
}

@media (min-width: 768px) {
  .woocommerce-cart .entry-title,
  .woocommerce-checkout .entry-title,
  .woocommerce-page h1,
  .woocommerce h1 {
    font-size: 44px !important;
  }
}

.woocommerce h2,
.woocommerce h3,
.woocommerce-checkout h3 {
  font-family: var(--judil-font-playfair) !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  color: var(--judil-navy) !important;
  margin-bottom: 20px !important;
}

/* WooCommerce Notices */
.woocommerce-error,
.woocommerce-info,
.woocommerce-message {
  border-top: none !important;
  border-radius: var(--judil-radius-md) !important;
  padding: 16px 24px 16px 56px !important;
  font-family: var(--judil-font-inter) !important;
  font-size: 14px !important;
  box-shadow: var(--judil-shadow-sm) !important;
  position: relative !important;
  margin-bottom: 32px !important;
  list-style: none !important;
}

.woocommerce-message {
  background-color: rgba(37, 211, 102, 0.08) !important;
  color: #128C7E !important;
  border: 1px solid rgba(37, 211, 102, 0.2) !important;
}

.woocommerce-info {
  background-color: var(--judil-gold-light) !important;
  color: var(--judil-navy) !important;
  border: 1px solid rgba(201, 162, 39, 0.3) !important;
}

.woocommerce-error {
  background-color: rgba(220, 38, 38, 0.08) !important;
  color: #991B1B !important;
  border: 1px solid rgba(220, 38, 38, 0.2) !important;
}

/* ==========================================================================
   Shopify/Stripe-Style Desktop 2-Column Grid Layout (Screens >= 992px)
   ========================================================================== */
.woocommerce form.checkout,
.woocommerce-checkout form.checkout {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

@media (min-width: 992px) {
  .woocommerce form.checkout,
  .woocommerce-checkout form.checkout {
    display: grid !important;
    grid-template-columns: 1fr 400px !important; /* Billing form takes 1fr (flexible wide column), Order summary takes fixed 400px sidebar */
    gap: 36px !important;
    align-items: start !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Left Column: Billing & Shipping Details occupy full 1fr column */
  #customer_details,
  .woocommerce-checkout #customer_details {
    grid-column: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
  }

  /* Force all billing wrapper cards inside left column to expand 100% */
  .woocommerce-billing-fields,
  .woocommerce-shipping-fields,
  .woocommerce-additional-fields,
  .woocommerce-billing-fields__field-wrapper,
  .woocommerce-shipping-fields__field-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    box-sizing: border-box !important;
  }

  #customer_details .col-1,
  #customer_details .col-2,
  .col2-set .col-1,
  .col2-set .col-2 {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 0 24px 0 !important;
  }

  #order_review_heading,
  .woocommerce-checkout #order_review_heading {
    display: none !important;
  }

  /* Right Column: Order Review Sidebar (Fixed 400px) */
  #order_review,
  .woocommerce-checkout #order_review {
    grid-column: 2 !important;
    width: 100% !important;
    max-width: 400px !important;
    float: none !important;
    margin: 0 !important;
    position: sticky !important;
    top: 100px !important;
    box-sizing: border-box !important;
  }
}

/* Mobile & Tablet Fallback Layout (< 991px) */
@media (max-width: 991px) {
  .woocommerce form.checkout,
  .woocommerce-checkout form.checkout {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 32px !important;
  }

  #customer_details,
  #order_review,
  .col2-set .col-1,
  .col2-set .col-2 {
    width: 100% !important;
    float: none !important;
    max-width: 100% !important;
  }
}

/* Billing & Shipping Card Container */
.woocommerce-billing-fields,
.woocommerce-shipping-fields,
.woocommerce-additional-fields {
  background: #ffffff;
  border-radius: var(--judil-radius-lg);
  border: 1px solid var(--judil-border);
  padding: 32px;
  box-shadow: var(--judil-shadow-sm);
  margin-bottom: 24px;
}

/* Form Row Grid (First name / Last name side by side on desktop) */
.woocommerce form .form-row {
  margin-bottom: 20px !important;
  padding: 0 !important;
  width: 100% !important;
}

@media (min-width: 640px) {
  .woocommerce form .form-row-first {
    width: 48.5% !important;
    display: inline-block !important;
    float: left !important;
  }

  .woocommerce form .form-row-last {
    width: 48.5% !important;
    display: inline-block !important;
    float: right !important;
  }

  .woocommerce form .form-row-wide {
    clear: both !important;
    width: 100% !important;
    display: block !important;
    float: none !important;
  }
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row select,
.woocommerce form .form-row textarea,
.select2-container--default .select2-selection--single {
  height: 48px !important;
  padding: 12px 16px !important;
  border-radius: var(--judil-radius-md) !important;
  border: 1px solid var(--judil-border) !important;
  background-color: #ffffff !important;
  font-family: var(--judil-font-inter) !important;
  font-size: 14px !important;
  color: var(--judil-dark-gray) !important;
  transition: all 0.2s ease !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.woocommerce form .form-row textarea {
  height: auto !important;
  min-height: 100px !important;
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row select:focus,
.woocommerce form .form-row textarea:focus,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--judil-gold) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.18) !important;
}

.woocommerce form .form-row label {
  font-family: var(--judil-font-inter) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--judil-navy) !important;
  margin-bottom: 6px !important;
  display: block !important;
}

.woocommerce form .form-row label .required {
  color: var(--judil-gold) !important;
  text-decoration: none !important;
}

/* Order Review Box */
#order_review {
  background: #ffffff;
  border-radius: var(--judil-radius-lg);
  border: 1px solid var(--judil-border);
  padding: 32px;
  box-shadow: var(--judil-shadow-md);
}

table.woocommerce-checkout-review-order-table {
  border: none !important;
  margin-bottom: 24px !important;
  width: 100% !important;
}

table.woocommerce-checkout-review-order-table th,
table.woocommerce-checkout-review-order-table td {
  padding: 14px 0 !important;
  border-bottom: 1px solid #F3F4F6 !important;
  font-family: var(--judil-font-inter) !important;
  background: transparent !important;
}

table.woocommerce-checkout-review-order-table tr.order-total th,
table.woocommerce-checkout-review-order-table tr.order-total td {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: var(--judil-navy) !important;
  border-top: 2px solid var(--judil-navy) !important;
  border-bottom: none !important;
  padding-top: 18px !important;
}

/* Payment Methods */
#payment {
  background: transparent !important;
  border-radius: 0 !important;
}

#payment ul.payment_methods {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 0 24px 0 !important;
  border-bottom: 1px solid var(--judil-border) !important;
}

#payment ul.payment_methods li {
  background: #F8F9FA !important;
  border-radius: var(--judil-radius-md) !important;
  border: 1px solid var(--judil-border) !important;
  margin-bottom: 12px !important;
  padding: 16px !important;
  transition: all 0.2s ease !important;
}

#payment ul.payment_methods li.payment_method_selected,
#payment ul.payment_methods li:has(input:checked) {
  background: #ffffff !important;
  border-color: var(--judil-gold) !important;
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.2) !important;
}

#payment ul.payment_methods li label {
  font-family: var(--judil-font-inter) !important;
  font-weight: 600 !important;
  color: var(--judil-navy) !important;
  cursor: pointer !important;
}

#payment div.payment_box {
  background: #F8F9FA !important;
  border-radius: var(--judil-radius-sm) !important;
  padding: 16px !important;
  font-size: 13px !important;
  color: #4B5563 !important;
  margin-top: 12px !important;
  border: 1px solid #E5E7EB !important;
}

#payment div.payment_box::before {
  display: none !important;
}

/* Place Order CTA Button */
#place_order,
.woocommerce-checkout #place_order {
  width: 100% !important;
  background-color: var(--judil-gold) !important;
  color: #ffffff !important;
  font-family: var(--judil-font-inter) !important;
  font-weight: 700 !important;
  font-size: 16px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  padding: 18px 32px !important;
  border-radius: var(--judil-radius-md) !important;
  border: none !important;
  box-shadow: 0 4px 16px rgba(201, 162, 39, 0.35) !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
}

#place_order:hover,
.woocommerce-checkout #place_order:hover {
  background-color: var(--judil-gold-hover) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(201, 162, 39, 0.45) !important;
}

/* Trust Badges */
.judil-checkout-trust-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  font-family: var(--judil-font-inter);
  font-size: 12px;
  font-weight: 500;
  color: #6B7280;
}

.judil-trust-icon {
  color: #25D366;
  width: 16px;
  height: 16px;
}

/* Order Received Styling */
.woocommerce-order-received .woocommerce-notice--success {
  background-color: rgba(37, 211, 102, 0.1) !important;
  border: 1px solid rgba(37, 211, 102, 0.3) !important;
  color: #128C7E !important;
  font-family: var(--judil-font-playfair) !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  padding: 24px !important;
  border-radius: var(--judil-radius-lg) !important;
  text-align: center !important;
  margin-bottom: 32px !important;
}
