/* =============================================================
   CB Distance & Slot Delivery — Frontend Styles
   v2.0 — Enhanced Card UI (chefbakers.com)
   Preserves all original selectors. Adds new card-based layout.
   ============================================================= */

@import url('https://chefbakerscomdebff.zapwp.com/q:u/r:0/wp:0/w:1/u:https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── 1. Main container
       Overrides the inline style injected by PHP render_delivery_ui()
       Using !important to beat the inline style on margin/padding/bg
   ────────────────────────────────────────────────────────── */
.cbdsd-delivery-box {
  background: #FFF5ea !important;
  border-radius: 24px !important;
  padding: 2px 24px 24px !important;
  margin-bottom: 20px !important;
  border: none !important;
  box-shadow: 0 4px 24px rgba(61,26,14,0.08), 0 1px 4px rgba(61,26,14,0.05);
  font-family: 'DM Sans', sans-serif;
  box-sizing: border-box;
}

/* ── 2. Section headings (h4 inside delivery box) ── */
.cbdsd-delivery-box h4 {
  font-size: 22px;
  font-weight: 700;
  color: #3D1A0E;
  margin: 0 0 16px 0;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

/* ── 3. Options list wrapper ── */
.cbdsd-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

/* ── 4. Individual option cards ── */
.cbdsd-option-card {
  position: relative;
  border: 1.5px solid #E8E0D8;
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: #FFFFFF;
  overflow: hidden;
  box-sizing: border-box;
}

.cbdsd-option-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #FFF8F0 0%, #FFF3E6 100%);
  opacity: 0;
  transition: opacity 0.22s ease;
  border-radius: inherit;
  pointer-events: none;
}

.cbdsd-option-card:hover {
  border-color: #F0B97D;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(232,130,58,0.12);
}

.cbdsd-option-card.selected {
  border-color: #E8823A;
  border-width: 2px;
  background: #FFF8F0;
  box-shadow: 0 4px 16px rgba(232,130,58,0.15);
}

.cbdsd-option-card.selected::before {
  opacity: 1;
}

/* Hide the native radio — card itself is the clickable element */
.cbdsd-option-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* ── 5. Card inner flex row ── */
.cbdsd-card-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ── 6. Card icon ── */
.cbdsd-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #FFF0E0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  transition: transform 0.22s ease, background 0.22s ease;
}

.cbdsd-option-card.selected .cbdsd-card-icon {
  transform: scale(1.08);
  background: #FFE4C8;
}

/* ── 7. Card text ── */
.cbdsd-card-text {
  flex: 1;
  min-width: 0;
}

.cbdsd-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #3D1A0E;
  line-height: 1.2;
  margin-bottom: 2px;
}

.cbdsd-card-subtitle {
  font-size: 13px;
  color: #8A6A5A;
  font-weight: 400;
  line-height: 1.3;
}

.cbdsd-card-note {
  font-size: 11.5px;
  color: #C0927A;
  font-weight: 400;
  margin-top: 1px;
}

/* ── 8. Animated checkmark circle ── */
.cbdsd-card-check {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #D8CCC6;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: transparent;
}

.cbdsd-card-check svg {
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s ease;
}

.cbdsd-option-card.selected .cbdsd-card-check {
  background: #E8823A;
  border-color: #E8823A;
  transform: scale(1.1);
}

.cbdsd-option-card.selected .cbdsd-card-check svg {
  opacity: 1;
  transform: scale(1);
}

/* ── 9. Expandable panels (next-day / select-date)
       JS uses .show()/.hide() — we set base display:none here.
       .cbdsd-panel.active used for CSS animation only.
   ── */
.cbdsd-select-date,
.cbdsd-next-day {
  display: none; /* JS controls show/hide */
}

.cbdsd-panel {
  padding: 12px 14px 4px;
  margin-top: 6px;
  background: rgba(255,248,240,0.7);
  border-radius: 0 0 14px 14px;
  border-top: 1px dashed #F0C8A0;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  animation: cbdsdSlideDown 0.22s ease;
}

@keyframes cbdsdSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cbdsd-panel label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #7A5040;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cbdsd-panel select,
.cbdsd-panel input[type="date"],
.cbdsd-panel input[type="text"] {
  width: 100%;
  padding: 9px 36px 9px 14px;
  border: 1.5px solid #E8D8CC;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: #3D1A0E;
  background: #FFFFFF;
  outline: none;
  cursor: pointer;
  margin-bottom: 10px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238A6A5A' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  box-sizing: border-box;
}

.cbdsd-panel select:focus,
.cbdsd-panel input[type="date"]:focus {
  border-color: #E8823A;
  box-shadow: 0 0 0 3px rgba(232,130,58,0.1);
}

.cbdsd-next-day-info {
  font-size: 12px;
  color: #A07060;
  margin-top: -4px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ── 10. Divider between delivery options and address ── */
.cbdsd-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #EAD8CC, transparent);
  margin: 4px 0 20px;
  border: none;
}

/* ── 11. Address section heading ── */
.cbdsd-address-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 600;
  color: #3D1A0E;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
}

/* ── 12. Address input row ── */
.cbdsd-address-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

#cbdsd_product_address {
  flex: 1;
  min-width: 0;
  padding: 12px 18px;
  border: 1.5px solid #E8D8CC;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: #3D1A0E;
  background: #FAFAF8;
  outline: none;
  transition: all 0.18s ease;
  box-sizing: border-box;
}

#cbdsd_product_address::placeholder {
  color: #C0A898;
  font-weight: 400;
}

#cbdsd_product_address:focus {
  border-color: #E8823A;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(232,130,58,0.1);
}

/* ── 13. Use my location button ── */
#cbdsd_use_my_location {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: #FFF0E0;
  border: 1.5px solid #F0C8A0;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #C06020;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
  outline: none;
  flex-shrink: 0;
  line-height: 1;
}

#cbdsd_use_my_location:hover {
  background: #FFE4C4;
  border-color: #E8823A;
  color: #A04010;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(232,130,58,0.18);
}

#cbdsd_use_my_location:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ── 14. Trust badges ── */
.cbdsd-trust-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #EAD8CC;
  flex-wrap: wrap;
}

.cbdsd-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #A07060;
  font-weight: 500;
}

.cbdsd-badge-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #D0B0A0;
  flex-shrink: 0;
}

/* ── 15. Express warning box (injected by JS after .cbdsd-express) ── */
#cbdsd-express-warning {
  display: none;
  margin-top: 8px;
  padding: 10px 14px;
  background: #FFF4E0;
  border: 1px solid #F0C070;
  border-radius: 10px;
  font-size: 13px;
  color: #8A5A10;
  text-align: center;
  position: relative;
  z-index: 1;
}

/* ── 16. Add-to-cart blocker (injected by JS into .cbdsd-delivery-box) ── */
#cbdsd-add-to-cart-blocker {
  display: none;
  margin-top: 10px;
  padding: 10px 14px;
  background: #FFF0F0;
  border: 1px solid #F0A0A0;
  border-radius: 10px;
  font-size: 13px;
  color: #c0392b;
  text-align: center;
}

/* ── 17. Small note text (original .cbdsd-note) ── */
.cbdsd-note {
  font-size: 12px;
  color: #A07060;
  margin-top: 6px;
  line-height: 1.4;
}

/* ── 18. Outlet info block in cart/checkout totals (original) ── */
.cbdsd-assigned-outlet {
  font-size: 13px;
  color: #555;
  margin-top: 4px;
  padding: 6px 10px;
  background: #FFF8F0;
  border-left: 3px solid #E8823A;
  border-radius: 4px;
}

/* ── 19. Admin debug block (original — keep as-is) ── */
.cbdsd-debug-block {
  border: 2px solid pink;
  padding: 8px;
  margin: 8px 0;
  font-size: 12px;
  background: #fff0f5;
}

/* ── 20. Cake Message Section ── */
.cbdsd-message-section {
  margin-top: 4px;
}

.cbdsd-message-section #cbdsd_cake_message {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #E8D8CC;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: #3D1A0E;
  background: #FFFAF7;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  margin-top: 10px;
}

.cbdsd-message-section #cbdsd_cake_message:focus {
  border-color: #E8823A;
  box-shadow: 0 0 0 3px rgba(232,130,58,0.12);
  background: #FFFFFF;
}

.cbdsd-message-section #cbdsd_cake_message::placeholder {
  color: #B8A898;
}

.cbdsd-message-section .cbdsd-note {
  margin-top: 6px;
}

@media (max-width: 480px) {
    #cbdsd_product_address {
    min-width: 180px;
    }
    #cbdsd_use_my_location{
    padding: 8px 10px !important;
        font-size: 12px !important;
        line-height: 14px;
        width: 110px;
        white-space: normal;
    }
    .cbdsd-delivery-box{
    padding: 5px 15px 10px !important;
    }
    .cbdsd-delivery-box h4
    { 
    margin: 10px 5px 20px !important;
    }
    }