/**
 * Abode Home & Gifts - Checkout Page Styles
 * Minimal Tailwind CSS compilation for WordPress checkout page
 * Built from Tailwind config to match Nuxt frontend
 */

/* Tailwind Base & Reset */
*, ::before, ::after {
  box-sizing: border-box;
  border-width: 0;
  border-style: solid;
  border-color: #e5e7eb;
}

html { line-height: 1.5; -webkit-text-size-adjust: 100%; tab-size: 4; font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
body { margin: 0; line-height: inherit; }
h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; }
a { color: inherit; text-decoration: inherit; }
b, strong { font-weight: bolder; }
button, input, select, textarea { font-family: inherit; font-size: 100%; line-height: inherit; color: inherit; margin: 0; padding: 0; }
button, select { text-transform: none; }
button, [type='button'], [type='submit'] { -webkit-appearance: button; background-color: transparent; background-image: none; }
table { text-indent: 0; border-color: inherit; border-collapse: collapse; }

/* Brand Colors */
:root {
  --greenpea-600: #7A8B62;
  --greenpea-700: #6A7A56;
  --zinc-900: #18181b;
  --zinc-800: #27272a;
  --zinc-700: #3f3f46;
  --zinc-600: #52525b;
  --zinc-500: #71717a;
  --zinc-400: #a1a1aa;
  --zinc-300: #d4d4d8;
  --zinc-200: #e4e4e7;
  --zinc-100: #f4f4f5;
  --zinc-50: #fafafa;
}

/* Utility Classes - Essential Only */
.container { width: 100%; max-width: 1280px; margin-left: auto; margin-right: auto; padding-left: 1rem; padding-right: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.max-w-4xl { max-width: 56rem; }
.max-w-6xl { max-width: 72rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.bg-white { background-color: #ffffff; }
.bg-zinc-50 { background-color: var(--zinc-50); }
.bg-zinc-100 { background-color: var(--zinc-100); }
.bg-greenpea-600 { background-color: var(--greenpea-600); }

.text-zinc-900 { color: var(--zinc-900); }
.text-zinc-700 { color: var(--zinc-700); }
.text-zinc-600 { color: var(--zinc-600); }
.text-zinc-500 { color: var(--zinc-500); }
.text-white { color: #ffffff; }
.text-greenpea-600 { color: var(--greenpea-600); }

.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }

.border { border-width: 1px; }
.border-zinc-200 { border-color: var(--zinc-200); }
.border-zinc-300 { border-color: var(--zinc-300); }

.shadow { box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); }
.shadow-sm { box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); }

.flex { display: flex; }
.block { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none; }

.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

.w-full { width: 100%; }
.min-h-screen { min-height: 100vh; }

.transition { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }

button:hover, .hover\:bg-greenpea-700:hover { background-color: var(--greenpea-700); }

/* WooCommerce Specific Overrides */
.woocommerce-form-row { margin-bottom: 1rem; }
.woocommerce-form-row label { display: block; margin-bottom: 0.5rem; font-weight: 500; color: var(--zinc-700); }
.woocommerce-form-row input, .woocommerce-form-row select, .woocommerce-form-row textarea { width: 100%; padding: 0.75rem; border: 1px solid var(--zinc-300); border-radius: 0.375rem; }
.woocommerce-form-row input:focus, .woocommerce-form-row select:focus, .woocommerce-form-row textarea:focus { outline: 2px solid var(--greenpea-600); outline-offset: -1px; border-color: var(--greenpea-600); }

.woocommerce-error, .woocommerce-message, .woocommerce-info { padding: 1rem; margin-bottom: 1.5rem; border-radius: 0.5rem; }
.woocommerce-error { background-color: #fef2f2; color: #991b1b; border-left: 4px solid #dc2626; }
.woocommerce-message { background-color: #f0fdf4; color: #166534; border-left: 4px solid #22c55e; }

.woocommerce-checkout-review-order { background-color: var(--zinc-50); padding: 1.5rem; border-radius: 0.5rem; }

/* Loading State */
.processing { opacity: 0.6; pointer-events: none; }
.processing::after { content: ""; border: 3px solid var(--zinc-200); border-top-color: var(--greenpea-600); border-radius: 50%; width: 1.5rem; height: 1.5rem; animation: spin 1s linear infinite; }

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

/* Checkout Review Order Table Styles */
.woocommerce-checkout-review-order-table {
  width: 100%;
  border-collapse: collapse;
}

.woocommerce-checkout-review-order-table thead th {
  text-align: left;
  font-weight: 600;
  color: var(--zinc-700);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  padding: 1rem 0.5rem;
  border-bottom: 2px solid var(--zinc-200);
}

.woocommerce-checkout-review-order-table tbody tr {
  border-bottom: 1px solid var(--zinc-100);
}

.woocommerce-checkout-review-order-table tbody td {
  padding: 1rem 0.5rem;
  vertical-align: top;
}

.woocommerce-checkout-review-order-table .product-name {
  width: 70%;
}

.woocommerce-checkout-review-order-table .product-total {
  width: 30%;
  text-align: right;
  font-weight: 600;
  color: var(--zinc-900);
}

.woocommerce-checkout-review-order-table tfoot th,
.woocommerce-checkout-review-order-table tfoot td {
  padding: 0.75rem 0.5rem;
  font-size: 0.875rem;
}

.woocommerce-checkout-review-order-table tfoot th {
  text-align: left;
  font-weight: 500;
  color: var(--zinc-600);
}

.woocommerce-checkout-review-order-table tfoot td {
  text-align: right;
  font-weight: 600;
  color: var(--zinc-900);
}

.woocommerce-checkout-review-order-table tfoot .order-total th {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--zinc-900);
  padding-top: 1rem;
  border-top: 2px solid var(--zinc-200);
}

.woocommerce-checkout-review-order-table tfoot .order-total td {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--greenpea-600);
  padding-top: 1rem;
  border-top: 2px solid var(--zinc-200);
}

/* Product thumbnails in checkout */
.woocommerce-checkout-review-order-table img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Gift Note Styles */
.gift-options-wrapper {
  background: #fafafa;
  padding: 20px;
  margin: 20px 0;
  border-radius: 8px;
  border: 1px solid #e4e4e7;
}

.gift-checkbox label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: #18181b;
  cursor: pointer;
  font-size: 16px;
}

.gift-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #7A8B62;
}

.gift-note-field {
  margin-top: 16px;
}

.gift-note-field label {
  font-weight: 500;
  color: #3f3f46;
  margin-bottom: 8px;
  display: block;
}

.gift-note-field textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #d4d4d8;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.2s;
  font-family: inherit;
}

.gift-note-field textarea:focus {
  outline: none;
  border-color: #7A8B62;
  box-shadow: 0 0 0 3px rgba(122, 139, 98, 0.1);
}

.gift-note-field textarea::placeholder {
  color: #a1a1aa;
  font-style: italic;
}

/* Checkout Blocks Gift Note Styles */
/* Hide gift message field by default - JavaScript will show it when checkbox is checked */
input[name="abode/gift-message"],
#abode-gift-message {
  transition: opacity 0.3s ease-in-out;
}

/* Target the wrapper div that contains the gift message field */
.wc-block-components-text-input:has(input[name="abode/gift-message"]),
.wc-block-checkout__additional_information:has(input[name="abode/gift-message"]),
.wp-block-woocommerce-checkout-order-note-block:has(input[name="abode/gift-message"]) {
  display: none;
  opacity: 0;
  overflow: hidden;
  max-height: 0;
  margin: 0;
  padding: 0;
  transition: opacity 0.3s ease-in-out, max-height 0.3s ease-in-out, margin 0.3s ease-in-out;
}

/* Hide the gift message label - use placeholder only */
label[for="order-abode-gift-message"] {
  display: none !important;
}

/* Style the gift checkbox label */
.wc-block-components-checkbox:has(input[name="abode/is-gift"]) label {
  font-weight: 500;
  color: var(--zinc-900);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

/* Gift checkbox styling */
input[name="abode/is-gift"] {
  cursor: pointer;
  accent-color: var(--greenpea-600);
}

/* Gift message input styling for Blocks */
input[name="abode/gift-message"] {
  border: 2px solid var(--zinc-300);
  border-radius: 6px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

input[name="abode/gift-message"]:focus {
  outline: none;
  border-color: var(--greenpea-600);
  box-shadow: 0 0 0 3px rgba(122, 139, 98, 0.1);
}

input[name="abode/gift-message"]::placeholder {
  color: var(--zinc-400);
  opacity: 0.6;
  font-style: italic;
}

/* Responsive */
@media (min-width: 768px) {
  .container { padding-left: 2rem; padding-right: 2rem; }
  .md\:p-8 { padding: 2rem; }
  .md\:px-8 { padding-left: 2rem; padding-right: 2rem; }
  .md\:py-16 { padding-top: 4rem; padding-bottom: 4rem; }
}
