/* ============================================
   Proposal Renderer Shared Styles
   Used by both internal review and customer pages
   ============================================ */

/* ===========================================
   Unit Cards
   =========================================== */

.pr-unit-card {
  background: white;
  border: 1px solid var(--color-gray-200, #e0e0e0);
  border-radius: var(--radius-lg, 8px);
  padding: var(--space-5, 20px);
  margin-bottom: 15px;
}

.pr-unit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--space-3, 12px);
  border-bottom: 2px solid var(--color-primary, #8B1538);
  margin-bottom: 15px;
}

.pr-unit-header h4 {
  margin: 0;
  font-size: var(--font-size-md, 16px);
  color: var(--color-gray-800, #333);
}

.pr-unit-total {
  text-align: right;
}

.pr-unit-total-amount {
  font-size: var(--font-size-xl, 20px);
  font-weight: 600;
  color: var(--color-primary, #8B1538);
}

.pr-unit-total-label {
  font-size: var(--font-size-xs, 11px);
  color: var(--color-gray-500, #888);
}

/* ===========================================
   Mattress Tile
   =========================================== */

.pr-mattress-tile {
  display: flex;
  align-items: center;
  padding: var(--space-3, 12px);
  background: var(--color-gray-50, #f8f9fa);
  border-radius: var(--radius-md, 6px);
  margin-bottom: var(--space-3, 12px);
}

.pr-mattress-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-md, 6px);
  margin-right: var(--space-3, 12px);
  flex-shrink: 0;
}

.pr-mattress-placeholder {
  width: 60px;
  height: 60px;
  background: #f0f0f0;
  border-radius: var(--radius-md, 6px);
  margin-right: var(--space-3, 12px);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #ccc;
}

.pr-mattress-info {
  flex: 1;
}

.pr-mattress-name {
  font-weight: 500;
  color: var(--color-gray-800, #333);
}

.pr-mattress-sku {
  font-family: var(--font-family-mono, monospace);
  color: var(--color-gray-500, #888);
  font-size: var(--font-size-xs, 11px);
}

.pr-mattress-price {
  text-align: right;
  font-weight: 600;
  color: var(--color-gray-800, #333);
}

/* ===========================================
   Bedding Summary Grid (Material/Color/Design)
   =========================================== */

.pr-bedding-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 10px 12px;
  background: #fdf8f4;
  border-radius: var(--radius-md, 6px);
  font-size: var(--font-size-sm, 12px);
  margin-bottom: var(--space-2, 8px);
}

.pr-bedding-summary-label {
  color: var(--color-gray-500, #888);
}

.pr-bedding-summary-value {
  color: var(--color-gray-800, #333);
  font-weight: 500;
}

.pr-no-bedding {
  padding: var(--space-3, 12px);
  background: var(--color-gray-50, #f8f9fa);
  border-radius: var(--radius-md, 6px);
  text-align: center;
  color: var(--color-gray-500, #888);
  font-size: var(--font-size-base, 13px);
}

/* ===========================================
   Tables (Sheets, Pillows, Blankets)
   =========================================== */

.pr-table-section {
  margin-top: var(--space-3, 12px);
}

.pr-table-label {
  font-size: var(--font-size-sm, 12px);
  font-weight: 600;
  color: var(--color-gray-600, #666);
  margin-bottom: var(--space-2, 8px);
}

.pr-table {
  width: 100%;
  font-size: var(--font-size-sm, 12px);
  border-collapse: collapse;
}

.pr-table thead tr {
  background: #f0f0f0;
}

.pr-table th {
  text-align: left;
  padding: 6px;
  font-weight: 600;
  color: var(--color-gray-800, #333);
}

.pr-table th.pr-align-right {
  text-align: right;
}

.pr-table td {
  padding: 6px;
  border-bottom: 1px solid #eee;
}

.pr-table td.pr-align-right {
  text-align: right;
}

.pr-table tbody tr:hover {
  background: #fafafa;
}

.pr-table tbody tr.pr-row-alt {
  background: #fafafa;
}

.pr-table tbody tr.pr-row-child {
  background: #fafafa;
}

.pr-table tbody tr.pr-row-child td:first-child {
  padding-left: 20px;
}

/* ===========================================
   SKU Cell (Monospace)
   =========================================== */

.pr-sku-cell {
  font-family: var(--font-family-mono, 'SF Mono', Monaco, monospace);
  font-size: var(--font-size-sm, 12px);
  color: var(--color-gray-500, #6c757d);
}

/* ===========================================
   Embroidery Badge
   =========================================== */

.pr-embroidery-badge {
  display: inline-block;
  font-family: 'SF Mono', var(--font-family-mono, monospace);
  font-size: 11px;
  background: linear-gradient(135deg, var(--color-primary, #8B1538) 0%, #6d102c 100%);
  color: white;
  padding: 3px 10px;
  border-radius: var(--radius-sm, 4px);
  font-weight: 500;
  margin-top: 4px;
}

.pr-embroidery-badge-sm {
  display: inline-block;
  font-family: 'SF Mono', var(--font-family-mono, monospace);
  font-size: 10px;
  background: linear-gradient(135deg, var(--color-primary, #8B1538) 0%, #6d102c 100%);
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 500;
}

.pr-no-embroidery {
  color: #ccc;
}

/* ===========================================
   Price Display
   =========================================== */

.pr-price {
  font-weight: 600;
  color: var(--color-primary, #8B1538);
}

.pr-price-muted {
  color: var(--color-gray-600, #666);
}

/* ===========================================
   Section Headers
   =========================================== */

.pr-section-header {
  margin: 0 0 15px;
  color: var(--color-gray-800, #333);
  border-bottom: 2px solid var(--color-primary, #8B1538);
  padding-bottom: var(--space-2, 8px);
  font-size: var(--font-size-md, 16px);
}

.pr-section-header-count,
.pr-section-count {
  font-weight: normal;
  color: var(--color-gray-500, #888);
  font-size: var(--font-size-base, 13px);
}

/* ===========================================
   Standalone Item Cards (Bedding, Pillows, Blankets)
   =========================================== */

.pr-standalone-section {
  margin-bottom: var(--space-6, 24px);
}

.pr-standalone-table-wrapper {
  background: white;
  border: 1px solid var(--color-gray-200, #e0e0e0);
  border-radius: var(--radius-lg, 8px);
  overflow: hidden;
}

.pr-standalone-card {
  background: white;
  border: 1px solid var(--color-gray-200, #e0e0e0);
  border-radius: var(--radius-lg, 8px);
  overflow: hidden;
}

.pr-standalone-table {
  width: 100%;
  font-size: var(--font-size-base, 13px);
  border-collapse: collapse;
}

.pr-standalone-table thead tr {
  background: var(--color-gray-50, #f8f9fa);
}

.pr-standalone-table th {
  text-align: left;
  padding: 12px 14px;
  font-weight: 600;
  color: var(--color-gray-800, #333);
}

.pr-standalone-table th.pr-align-right {
  text-align: right;
}

.pr-standalone-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
}

.pr-standalone-table td.pr-align-right {
  text-align: right;
}

.pr-standalone-table tbody tr:nth-child(even) {
  background: #fafafa;
}

.pr-standalone-table .pr-item-name {
  font-weight: 500;
  color: var(--color-gray-800, #333);
}

.pr-standalone-table .pr-item-details {
  color: var(--color-gray-500, #6c757d);
  font-size: var(--font-size-sm, 12px);
}

.pr-standalone-table .pr-item-options {
  color: var(--color-gray-500, #6c757d);
  font-size: var(--font-size-sm, 12px);
}

.pr-standalone-table .pr-qty {
  font-weight: 500;
}

.pr-standalone-table .pr-row-alt {
  background: #fafafa;
}

/* ===========================================
   Quantity Controls (Interactive - Customer Page)
   =========================================== */

.pr-qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pr-qty-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--color-gray-300, #d1d5db);
  border-radius: var(--radius-sm, 4px);
  background: white;
  color: var(--color-gray-600, #666);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 500;
  transition: var(--transition-fast, 150ms ease);
}

.pr-qty-btn:hover {
  background: var(--color-gray-100, #f5f5f5);
  border-color: var(--color-primary, #8B1538);
  color: var(--color-primary, #8B1538);
}

.pr-qty-btn:active {
  background: var(--color-gray-200, #e5e7eb);
}

.pr-qty-value {
  min-width: 32px;
  text-align: center;
  font-weight: 500;
  font-size: var(--font-size-base, 14px);
}

/* ===========================================
   Empty State
   =========================================== */

.pr-empty-state {
  text-align: center;
  padding: 60px 40px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: var(--radius-2xl, 16px);
  border: 2px dashed var(--color-gray-300, #dee2e6);
}

.pr-empty-state-icon {
  font-size: 64px;
  margin-bottom: var(--space-5, 20px);
  opacity: 0.5;
}

.pr-empty-state h3 {
  margin: 0 0 10px;
  color: var(--color-gray-600, #495057);
  font-size: var(--font-size-xl, 20px);
}

.pr-empty-state p {
  margin: 0;
  color: var(--color-gray-500, #6c757d);
  font-size: var(--font-size-base, 14px);
}

/* ===========================================
   Totals Summary
   =========================================== */

.pr-totals-card {
  background: white;
  border: 1px solid var(--color-gray-200, #e0e0e0);
  border-radius: var(--radius-lg, 8px);
  padding: var(--space-5, 20px);
  margin-top: var(--space-6, 24px);
}

.pr-totals-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2, 8px) 0;
  font-size: var(--font-size-base, 14px);
}

.pr-totals-row.pr-totals-grand {
  border-top: 2px solid var(--color-primary, #8B1538);
  margin-top: var(--space-2, 8px);
  padding-top: var(--space-3, 12px);
  font-size: var(--font-size-lg, 18px);
  font-weight: 600;
}

.pr-totals-label {
  color: var(--color-gray-600, #666);
}

.pr-totals-value {
  font-weight: 500;
  color: var(--color-gray-800, #333);
}

.pr-totals-grand .pr-totals-value {
  color: var(--color-primary, #8B1538);
}

/* ===========================================
   Proposal Header (Review Page Banner)
   =========================================== */

.pr-header-banner {
  background: var(--color-primary, #8B1538);
  color: white;
  padding: var(--space-6, 24px);
  border-radius: var(--radius-lg, 8px);
  margin-bottom: var(--space-6, 24px);
}

.pr-header-banner h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: white;
}

.pr-header-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.pr-header-status-draft {
  background: rgba(255, 255, 255, 0.2);
}

.pr-header-status-sent {
  background: var(--color-info, #17a2b8);
}

.pr-header-status-accepted {
  background: var(--color-success, #28a745);
}

.pr-header-subtitle {
  margin: 0;
  font-size: var(--font-size-base, 14px);
  color: rgba(255, 255, 255, 0.85);
}

.pr-header-total {
  text-align: right;
}

.pr-header-total-label {
  font-size: var(--font-size-sm, 12px);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 4px;
}

.pr-header-total-amount {
  font-size: 32px;
  font-weight: 700;
  color: white;
}

.pr-header-total-count {
  font-size: var(--font-size-sm, 12px);
  color: rgba(255, 255, 255, 0.7);
}

/* ===========================================
   Info Cards (Customer, Aircraft)
   =========================================== */

.pr-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6, 24px);
  margin-bottom: 30px;
}

.pr-info-card {
  background: white;
  border: 1px solid var(--color-gray-200, #e0e0e0);
  border-radius: var(--radius-lg, 8px);
  padding: var(--space-5, 20px);
}

.pr-info-card h4 {
  margin: 0 0 15px 0;
  color: var(--color-primary, #8B1538);
  font-size: var(--font-size-base, 14px);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pr-info-row {
  display: flex;
  justify-content: space-between;
  line-height: 2;
  font-size: var(--font-size-base, 14px);
}

.pr-info-label {
  color: var(--color-gray-500, #6c757d);
}

.pr-info-value {
  font-weight: 500;
  color: var(--color-gray-800, #333);
}

/* ===========================================
   Responsive Adjustments
   =========================================== */

@media (max-width: 768px) {
  .pr-info-grid {
    grid-template-columns: 1fr;
  }

  .pr-bedding-summary {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .pr-bedding-summary > div {
    display: flex;
    justify-content: space-between;
  }

  .pr-unit-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .pr-unit-total {
    text-align: left;
  }

  .pr-header-banner {
    padding: var(--space-4, 16px);
  }

  .pr-header-total-amount {
    font-size: 24px;
  }

  .pr-standalone-table {
    font-size: var(--font-size-sm, 12px);
  }

  .pr-standalone-table th,
  .pr-standalone-table td {
    padding: 10px 12px;
  }
}

/* ===========================================
   Print Styles
   =========================================== */

@media print {
  .pr-unit-card,
  .pr-standalone-card,
  .pr-info-card,
  .pr-totals-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .pr-qty-controls {
    display: none;
  }

  .pr-header-banner {
    background: var(--color-primary, #8B1538) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .pr-kit-header,
  .pr-kit-totals {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ===========================================
   Fixed Bed Sleep Kit Styles
   =========================================== */

.pr-kit-header {
  background: linear-gradient(135deg, #8B6914 0%, #a67c1a 100%);
  color: white;
  padding: var(--space-6, 25px);
  border-radius: var(--radius-xl, 12px);
  margin-bottom: var(--space-6, 25px);
}

.pr-kit-header-content {
  display: flex;
  justify-content: space-between;
  align-items: start;
}

.pr-kit-title {
  margin: 0 0 8px 0;
  font-size: 24px;
  font-weight: 600;
  color: white;
}

.pr-kit-subtitle {
  margin: 0;
  opacity: 0.9;
  font-size: var(--font-size-base, 14px);
  color: white;
}

.pr-kit-header-total {
  text-align: right;
}

.pr-kit-total-amount {
  font-size: 32px;
  font-weight: 700;
  color: white;
}

.pr-kit-total-label {
  font-size: var(--font-size-sm, 12px);
  opacity: 0.8;
  color: white;
}

/* Kit section header (gold underline instead of burgundy) */
.pr-section-header-kit {
  border-bottom-color: #8B6914;
}

/* Kit component cards */
.pr-kit-component-card {
  background: white;
  border: 1px solid var(--color-gray-200, #e0e0e0);
  border-radius: var(--radius-lg, 8px);
  padding: var(--space-5, 20px);
  margin-bottom: 15px;
}

.pr-kit-component-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 15px;
}

.pr-kit-component-title {
  margin: 0 0 5px 0;
  font-size: 15px;
  color: var(--color-gray-800, #333);
}

.pr-kit-component-subtitle {
  margin: 0;
  font-size: var(--font-size-sm, 12px);
  color: var(--color-gray-500, #666);
}

.pr-kit-component-price {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-primary, #8B1538);
}

.pr-kit-component-details {
  background: var(--color-gray-50, #f8f9fa);
  padding: var(--space-3, 12px);
  border-radius: var(--radius-md, 6px);
  font-size: var(--font-size-sm, 12px);
}

.pr-kit-component-notes {
  background: #fff3e0;
  padding: var(--space-2, 8px) var(--space-3, 12px);
  border-radius: var(--radius-md, 6px);
  font-size: var(--font-size-sm, 12px);
  color: #e65100;
  margin-top: var(--space-2, 8px);
}

.pr-kit-component-included {
  background: #e8f5e9;
  padding: var(--space-2, 8px) var(--space-3, 12px);
  border-radius: var(--radius-md, 6px);
  font-size: var(--font-size-sm, 12px);
  color: #2e7d32;
  margin-top: var(--space-2, 8px);
}

/* Pillow grid */
.pr-kit-pillow-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.pr-kit-pillow-item {
  background: var(--color-gray-50, #f8f9fa);
  padding: 10px;
  border-radius: var(--radius-md, 6px);
  font-size: var(--font-size-sm, 12px);
  text-align: center;
}

/* Customer badge */
.pr-kit-customer-badge {
  margin-top: 10px;
  padding: 6px 12px;
  background: #e3f2fd;
  border-radius: var(--radius-sm, 4px);
  display: inline-block;
  font-weight: 500;
  font-size: var(--font-size-base, 13px);
}

/* Info card highlight */
.pr-info-highlight {
  font-weight: 600;
  color: var(--color-primary, #8B1538);
}

.pr-info-content {
  font-size: var(--font-size-base, 13px);
  line-height: 1.8;
}

/* Kit totals footer */
.pr-kit-totals {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: white;
  padding: var(--space-6, 25px);
  border-radius: var(--radius-xl, 12px);
  margin-top: var(--space-6, 25px);
}

.pr-kit-totals-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pr-kit-totals-title {
  margin: 0;
  font-size: 18px;
  color: white;
}

.pr-kit-totals-subtitle {
  margin: 5px 0 0 0;
  opacity: 0.7;
  font-size: var(--font-size-base, 13px);
  color: white;
}

.pr-kit-totals-amount {
  font-size: 36px;
  font-weight: 700;
  color: white;
}

/* Responsive adjustments for kit */
@media (max-width: 768px) {
  .pr-kit-header-content {
    flex-direction: column;
    gap: 15px;
  }

  .pr-kit-header-total {
    text-align: left;
  }

  .pr-kit-total-amount {
    font-size: 28px;
  }

  .pr-kit-pillow-grid {
    grid-template-columns: 1fr;
  }

  .pr-kit-component-header {
    flex-direction: column;
    gap: 10px;
  }

  .pr-kit-totals-content {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .pr-kit-totals-amount {
    font-size: 32px;
  }
}
