/* ==========================================================================
   AmeriKitchen RFQ – Frontend Styles
   Matches the blue/orange brand seen in the screenshots.
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
  --rfq-blue: #2E3192;
  --rfq-blue-dark: #2E3192;
  --rfq-orange: #e85d04;
  --rfq-orange-dark: #c94e00;
  --rfq-white: #ffffff;
  --rfq-gray-50: #f8f9fc;
  --rfq-gray-100: #f1f3f7;
  --rfq-gray-200: #e2e6ef;
  --rfq-gray-400: #9aa3b8;
  --rfq-gray-600: #5a6380;
  --rfq-gray-800: #1e2333;
  --rfq-red: #dc2626;
  --rfq-green: #16a34a;

  --rfq-radius: 8px;
  --rfq-radius-lg: 12px;
  --rfq-shadow: 0 4px 24px rgba(26, 60, 143, 0.13);
  --rfq-shadow-sm: 0 2px 8px rgba(26, 60, 143, 0.08);
  --rfq-transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --rfq-drawer-w: 460px;
  /* WP admin bar uses z-index 99999, so we sit above it. */
  --rfq-z-overlay: 100000;
  --rfq-z-drawer: 100001;
  --rfq-z-trigger: 99998;
}

/* --------------------------------------------------------------------------
   Overlay
   -------------------------------------------------------------------------- */
.ak-rfq-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: var(--rfq-z-overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--rfq-transition);
}

.ak-rfq-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

/* --------------------------------------------------------------------------
   Drawer
   -------------------------------------------------------------------------- */
.ak-rfq-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--rfq-drawer-w);
  max-width: 100vw;
  background: var(--rfq-white);
  z-index: var(--rfq-z-drawer);
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 32px rgba(26, 60, 143, 0.16);
  transform: translateX(100%);
  transition: transform var(--rfq-transition);
  overflow: hidden;
}

.ak-rfq-drawer.is-open {
  transform: translateX(0);
}

/* Offset drawer so the WP admin bar doesn't cover the header. */
body.admin-bar .ak-rfq-drawer {
  top: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar .ak-rfq-drawer {
    top: 46px;
  }
}

/* --------------------------------------------------------------------------
   Drawer Header
   -------------------------------------------------------------------------- */
.ak-rfq-drawer__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 18px;
  background: var(--rfq-blue);
  color: var(--rfq-white);
  flex-shrink: 0;
}

.ak-rfq-drawer__title {
  margin: 0 0 2px;
  font-size: 20px;
  font-weight: 700;
  color: var(--rfq-white);
  letter-spacing: -0.3px;
}

.ak-rfq-drawer__count {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}

.ak-rfq-drawer__close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: var(--rfq-white);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--rfq-transition);
  flex-shrink: 0;
  margin-top: 2px;
}

.ak-rfq-drawer__close:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* --------------------------------------------------------------------------
   Steps
   -------------------------------------------------------------------------- */
.ak-rfq-step {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Items List
   -------------------------------------------------------------------------- */
.ak-rfq-drawer__items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ak-rfq-drawer__empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--rfq-gray-400);
  font-size: 14px;
}

/* Single item card */
.ak-rfq-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--rfq-gray-50);
  border: 1px solid var(--rfq-gray-200);
  border-radius: var(--rfq-radius);
  padding: 12px;
  transition: box-shadow var(--rfq-transition);
}

.ak-rfq-item:hover {
  box-shadow: var(--rfq-shadow-sm);
}

.ak-rfq-item__image {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 4px;
  background: var(--rfq-white);
  border: 1px solid var(--rfq-gray-200);
}

.ak-rfq-item__info {
  min-width: 0;
}

.ak-rfq-item__name {
  font-weight: 600;
  font-size: 14px;
  color: var(--rfq-gray-800);
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ak-rfq-item__cat {
  font-size: 12px;
  color: var(--rfq-gray-400);
  margin: 0 0 8px;
}

/* Qty stepper */
.ak-rfq-item__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ak-rfq-qty {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--rfq-gray-200);
  border-radius: 6px;
  overflow: hidden;
  background: var(--rfq-white);
}

.ak-rfq-qty__btn {
  background: none;
  border: none;
  width: 28px;
  height: 28px;
  font-size: 16px;
  font-weight: 600;
  color: var(--rfq-blue);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--rfq-transition);
}

.ak-rfq-qty__btn:hover {
  background: var(--rfq-gray-100);
}

.ak-rfq-qty__val {
  min-width: 28px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--rfq-gray-800);
  border-left: 1px solid var(--rfq-gray-200);
  border-right: 1px solid var(--rfq-gray-200);
  padding: 0 4px;
  line-height: 28px;
}

.ak-rfq-item__remove {
  background: none;
  border: none;
  color: var(--rfq-gray-400);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color var(--rfq-transition), background var(--rfq-transition);
}

.ak-rfq-item__remove:hover {
  color: var(--rfq-red);
  background: #fee2e2;
}

.ak-rfq-item__remove svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Drawer footer / CTA buttons
   -------------------------------------------------------------------------- */
.ak-rfq-drawer__footer {
  padding: 16px 24px;
  border-top: 1px solid var(--rfq-gray-200);
  flex-shrink: 0;
  background: var(--rfq-white);
}

.ak-rfq-drawer__footer--stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ak-rfq-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  background: var(--rfq-blue);
  color: var(--rfq-white);
  border: none;
  border-radius: var(--rfq-radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--rfq-transition), transform var(--rfq-transition), box-shadow var(--rfq-transition);
  box-shadow: 0 2px 8px rgba(26, 60, 143, 0.25);
}

.ak-rfq-btn-primary:hover:not(:disabled) {
  background: var(--rfq-blue-dark);
  box-shadow: 0 4px 16px rgba(26, 60, 143, 0.35);
  transform: translateY(-1px);
}

.ak-rfq-btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.ak-rfq-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.ak-rfq-btn-ghost {
  width: 100%;
  padding: 10px;
  background: none;
  border: none;
  color: var(--rfq-gray-600);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--rfq-radius);
  transition: background var(--rfq-transition), color var(--rfq-transition);
}

.ak-rfq-btn-ghost:hover {
  background: var(--rfq-gray-100);
  color: var(--rfq-gray-800);
}

/* --------------------------------------------------------------------------
   Contact Form – Step 2
   -------------------------------------------------------------------------- */
.ak-rfq-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ak-rfq-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ak-rfq-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--rfq-gray-800);
}

.ak-rfq-field label span {
  color: var(--rfq-orange);
  margin-left: 2px;
}

.ak-rfq-field input,
.ak-rfq-field textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--rfq-gray-200);
  border-radius: var(--rfq-radius);
  font-size: 14px;
  color: var(--rfq-gray-800);
  background: var(--rfq-white);
  transition: border-color var(--rfq-transition), box-shadow var(--rfq-transition);
  box-sizing: border-box;
  outline: none;
  font-family: inherit;
}

.ak-rfq-field input::placeholder,
.ak-rfq-field textarea::placeholder {
  color: var(--rfq-gray-400);
}

.ak-rfq-field input:focus,
.ak-rfq-field textarea:focus {
  border-color: var(--rfq-blue);
  box-shadow: 0 0 0 3px rgba(26, 60, 143, 0.1);
}

.ak-rfq-field input.is-invalid,
.ak-rfq-field textarea.is-invalid {
  border-color: var(--rfq-red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.ak-rfq-field textarea {
  resize: vertical;
  min-height: 80px;
}

/* Product summary box */
.ak-rfq-summary {
  background: var(--rfq-gray-50);
  border: 1px solid var(--rfq-gray-200);
  border-radius: var(--rfq-radius);
  padding: 14px 16px;
}

.ak-rfq-summary__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--rfq-gray-600);
  margin: 0 0 8px;
}

.ak-rfq-summary ul {
  list-style: disc;
  margin: 0;
  padding: 0 0 0 18px;
  font-size: 13px;
  color: var(--rfq-gray-800);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Form error */
.ak-rfq-form-error {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  border-radius: var(--rfq-radius);
  padding: 10px 14px;
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   Success state – Step 3
   -------------------------------------------------------------------------- */
.ak-rfq-step--success {
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  text-align: center;
  gap: 16px;
}

.ak-rfq-success-icon {
  width: 72px;
  height: 72px;
  background: #dcfce7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.ak-rfq-success-icon svg {
  width: 36px;
  height: 36px;
  stroke: var(--rfq-green);
  stroke-width: 2.5;
}

.ak-rfq-step--success h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--rfq-gray-800);
}

.ak-rfq-step--success p {
  color: var(--rfq-gray-600);
  font-size: 14px;
  margin: 0;
  max-width: 320px;
}

.ak-rfq-step--success .ak-rfq-btn-primary {
  margin-top: 8px;
  max-width: 240px;
}

/* --------------------------------------------------------------------------
   "Agregar a Cotización" button on product cards
   -------------------------------------------------------------------------- */
.ak-rfq-btn.button,
button.ak-rfq-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 11px 18px;
  background: var(--rfq-orange);
  color: var(--rfq-white) !important;
  border: none;
  border-radius: var(--rfq-radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: background var(--rfq-transition), transform var(--rfq-transition), box-shadow var(--rfq-transition);
  box-shadow: 0 2px 8px rgba(232, 93, 4, 0.25);
  text-decoration: none;
  text-transform: uppercase;
}

.ak-rfq-btn.button:hover,
button.ak-rfq-btn:hover {
  background: var(--rfq-orange-dark);
  box-shadow: 0 4px 16px rgba(232, 93, 4, 0.35);
  transform: translateY(-1px);
  color: var(--rfq-white) !important;
}

.ak-rfq-btn.button:active,
button.ak-rfq-btn:active {
  transform: translateY(0);
}

/* Added state */
.ak-rfq-btn.is-added,
button.ak-rfq-btn.is-added {
  background: var(--rfq-blue);
  box-shadow: 0 2px 8px rgba(26, 60, 143, 0.25);
}

/* --------------------------------------------------------------------------
   Floating trigger button
   -------------------------------------------------------------------------- */
a.ak-rfq-btn.button.alt {
  padding: 0px !important;
  margin-left: 0px !important;
}

.ak-rfq-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--rfq-z-trigger);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--rfq-blue);
  color: var(--rfq-white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(26, 60, 143, 0.35);
  transition: background var(--rfq-transition), transform var(--rfq-transition), box-shadow var(--rfq-transition);
}

.ak-rfq-trigger:hover {
  background: var(--rfq-blue-dark);
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(26, 60, 143, 0.45);
}

.ak-rfq-trigger svg {
  width: 24px;
  height: 24px;
  pointer-events: none;
}

.ak-rfq-trigger__badge {
  position: absolute;
  top: -13px;
  /*-4px;*/
  right: -13px;
  /*-4px;*/
  min-width: 20px;
  height: 20px;
  background: var(--rfq-orange);
  color: var(--rfq-white);
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--rfq-white);
  line-height: 1;
  animation: ak-rfq-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ak-rfq-trigger__badge-mobile {
  position: absolute;
  top: 15px;
  right: 8px;
  /*-4px;*/
  min-width: 20px;
  height: 20px;
  background: var(--rfq-orange);
  color: var(--rfq-white);
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--rfq-white);
  line-height: 1;
  animation: ak-rfq-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.navigation-icon .icon-cart:before {
  color: #2E3192;
}

.navigation-icon .ak-rfq-trigger__badge {
  top: -6px;
  right: 0px;
}

@keyframes ak-rfq-pop {
  from {
    transform: scale(0);
  }

  to {
    transform: scale(1);
  }
}

/* --------------------------------------------------------------------------
   Toast notifications
   -------------------------------------------------------------------------- */
.ak-rfq-toast {
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: calc(var(--rfq-z-drawer) + 1);
  background: var(--rfq-gray-800);
  color: var(--rfq-white);
  padding: 11px 18px;
  border-radius: var(--rfq-radius);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--rfq-shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  max-width: 300px;
}

.ak-rfq-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.ak-rfq-toast--success {
  background: #15803d;
}

.ak-rfq-toast--error {
  background: #b91c1c;
}

/* --------------------------------------------------------------------------
   Loading spinner (on submit)
   -------------------------------------------------------------------------- */
.ak-rfq-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: var(--rfq-white);
  border-radius: 50%;
  animation: ak-rfq-spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes ak-rfq-spin {
  to {
    transform: rotate(360deg);
  }
}

#ak-rfq-trigger {
  width: max-content;
  padding: 5px 5px 5px 5px;
  margin-left: 2px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.icon-cart:before {
  content: "\e74d";
  color: #fff;
}

.ak-rfq-cart {
  border: 1px #2E3192 solid;
  border-radius: 50%;
  background: #2E3192;
  height: 30px;
  width: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 520px) {
  :root {
    --rfq-drawer-w: 100vw;
  }

  .ak-rfq-trigger {
    bottom: 16px;
    right: 16px;
  }

  .ak-rfq-toast {
    right: 16px;
    bottom: 84px;
    max-width: calc(100vw - 32px);
  }
}