﻿/* Fulfillment Calculator Section */
.fulfillment-calculator-section {
  width: 100%;
}

/* Base Styles */
.fulfilment-calculator {
  width: 100%;
  padding: 3rem 0;
}

.calculator-header {
  text-align: center;
  margin-bottom: 4rem;
}

.calculator-header h2 {
  margin-bottom: 1rem;
  color: rgb(var(--color-foreground));
  font-size: 4rem;
  font-weight: 700;
}

.calculator-header p {
  font-size: 1.6rem;
  color: rgba(var(--color-foreground), 0.75);
  max-width: 60rem;
  margin: 0 auto;
  line-height: 1.6;
}

@media screen and (min-width: 750px) {
  .calculator-header h2 {
    font-size: 5.2rem;
  }
}

/* Columns Layout */
.calculator-columns {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr;
  gap: 2rem;
  align-items: start;
}

.column {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Make last card in each column fill remaining space */
.column > .input-card:last-child {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

/* Result column should also stretch */
.result-column {
  display: flex;
  flex-direction: column;
}

.result-column .result-card {
  flex-grow: 1;
}

/* Adjust card sizes in second column */
.column:nth-child(2) .input-card:nth-child(1) {
  flex-grow: 1.5; /* Additional Services - takes more space */
}

.column:nth-child(2) .input-card:nth-child(2) {
  flex-grow: 0.8; /* Storage - takes medium space */
}

.column:nth-child(2) .input-card:nth-child(3) {
  flex-grow: 0.5; /* Shipping - takes less space but still grows */
  flex-shrink: 1;
}

/* Input Cards with Liquid Glass Effect */
.input-card {
  min-height: 12rem;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, calc(var(--button-glass-opacity) * 1.8)), 
    rgba(255, 255, 255, calc(var(--button-glass-opacity) * 1.2))
  );
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 1.6rem;
  padding: 1.8rem 1.8rem 1.6rem 1.8rem;
  margin-bottom: 1.8rem;
  box-shadow: 0px 6px 16px 0px rgba(0, 0, 0, 0.10), 
              0px 2px 4px 0px rgba(0, 0, 0, 0.08),
              inset 0px 1px 0px rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(calc(var(--button-glass-blur) * 1.5));
  -webkit-backdrop-filter: blur(calc(var(--button-glass-blur) * 1.5));
  transition: backdrop-filter 300ms ease, box-shadow 300ms ease, transform 300ms ease;
}

/* Highlighted corner contour */
.input-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 32%;
  height: 32%;
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  border-left: 1px solid rgba(255, 255, 255, 0.45);
  border-top-left-radius: inherit;
  pointer-events: none;
  z-index: 1;
  opacity: 0.85;
  transition: border-width 300ms ease, opacity 300ms ease;
}

/* Glass shine effect for cards */
.input-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 60%;
  height: 60%;
  background: linear-gradient(135deg, 
    rgba(var(--button-glass-shine-color), calc(var(--button-glass-shine-opacity) * 1.5)) 0%, 
    rgba(var(--button-glass-shine-color), calc(var(--button-glass-shine-opacity) * 0.8)) 30%,
    transparent 60%
  );
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
  opacity: 0.7;
  transition: opacity 300ms ease;
}

/* Ensure content stays above the shine */
.input-card > * {
  position: relative;
  z-index: 2;
}

.input-card h3 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: rgb(var(--color-foreground));
}

@media screen and (min-width: 750px) {
  .input-card h3 {
    font-size: 2rem;
  }
}

/* Form Elements */
.fulfilment-calculator .styled-select, 
.fulfilment-calculator .styled-input {
  width: 100%;
  padding: 1.2rem;
  border-radius: 0.8rem;
  border: 0.1rem solid rgba(var(--color-foreground), 0.2);
  background-color: rgb(var(--color-background));
  font-size: 1.5rem;
  color: rgb(var(--color-foreground));
  transition: border-color 0.1s ease, box-shadow 0.1s ease;
  font-family: var(--font-body-family);
  font-style: var(--font-body-style);
  font-weight: var(--font-body-weight);
  line-height: 1.2;
}

@media screen and (min-width: 750px) {
  .fulfilment-calculator .styled-select, 
  .fulfilment-calculator .styled-input {
    font-size: 1.6rem;
    padding: 1.4rem;
  }
}

.fulfilment-calculator .styled-select {
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg fill="currentColor" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-inline-end: 4rem;
  cursor: pointer;
}

/* Checkboxes & Radios */
.checkbox-square,
.radio-square {
  display: flex;
  align-items: center;
  margin-bottom: 0.8rem;
  gap: 0.8rem;
}

.checkbox-square input[type="checkbox"],
.radio-square input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 2rem;
  height: 2rem;
  border: 0.2rem solid rgba(var(--color-foreground), 0.55);
  border-radius: var(--inputs-radius);
  margin: 0;
  margin-top: -0.8rem;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.checkbox-square input[type="checkbox"]:checked,
.radio-square input[type="radio"]:checked {
  background-color: rgba(var(--color-foreground), 0.08);
  border-color: rgb(var(--color-foreground));
  border-width: 0.2rem;
}

.checkbox-square input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 0.5rem;
  height: 0.9rem;
  border: solid rgb(var(--color-foreground));
  border-width: 0 0.18rem 0.18rem 0;
}

.radio-square input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 0.5rem;
  height: 0.9rem;
  border: solid rgb(var(--color-foreground));
  border-width: 0 0.18rem 0.18rem 0;
}

.checkbox-square label,
.radio-square label {
  cursor: pointer;
  font-size: 1.5rem;
  color: rgb(var(--color-foreground));
  user-select: none;
  line-height: 1;
}

@media screen and (min-width: 750px) {
  .checkbox-square label,
  .radio-square label {
    font-size: 1.6rem;
  }
}

/* Button - exact copy of theme button styles */
.calculate-btn {
  width: 100%;
  display: inline-flex !important;
  justify-content: center;
  align-items: center;
  padding: 1.6rem 3rem;
  cursor: pointer !important;
  text-decoration: none;
  color: rgb(var(--color-button-text)) !important;
  border-radius: var(--buttons-radius) !important;
  position: relative;
  font-family: var(--font-button-family);
  font-style: var(--font-button-style);
  font-weight: var(--font-button-weight-medium);
  font-size: calc(var(--font-button-scale) * 1.4rem);
  line-height: calc(1 + 0.2 / var(--font-button-scale));
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.1), 0px 1px 3px 0px rgba(0, 0, 0, 0.08) !important;
  backdrop-filter: blur(var(--button-glass-blur)) !important;
  -webkit-backdrop-filter: blur(var(--button-glass-blur)) !important;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.28) 30%,
    rgba(var(--color-button), calc(var(--button-glass-opacity) * 0.6)) 55%,
    rgba(var(--color-button), calc(var(--button-glass-opacity) * 0.85)) 100%
  ) !important;
  gap: 1rem;
  overflow: hidden !important;
  margin-bottom: 3rem;
  -webkit-appearance: none;
  appearance: none;
}

/* Hover effect from base.css */
.calculate-btn:not(:disabled):before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.6) 0%,
    rgba(255, 255, 255, 0.35) 35%,
    rgba(255, 255, 255, 0.1) 65%,
    rgba(255, 255, 255, 0) 100%
  );
  opacity: 0;
  transition: opacity 400ms ease;
  z-index: 1;
}

/* Glass shine effect */
.calculate-btn::after {
  content: "" !important;
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 50%;
  background: linear-gradient(90deg, 
    rgba(var(--button-glass-shine-color), var(--button-glass-shine-opacity)) 0%, 
    transparent 60%
  ) !important;
  border-radius: inherit;
  pointer-events: none;
  z-index: 3;
  transition: opacity 300ms ease;
  opacity: 1 !important;
}

.calculate-btn:not(:disabled):hover {
  color: rgb(var(--color-button)) !important;
  backdrop-filter: blur(calc(var(--button-glass-blur) + 2px)) !important;
  -webkit-backdrop-filter: blur(calc(var(--button-glass-blur) + 2px)) !important;
}

.calculate-btn:not(:disabled):hover > * {
  z-index: 0;
}

.calculate-btn:not(:disabled):hover:before {
  opacity: 1;
}

/* Enhance glass shine on hover */
.calculate-btn:not(:disabled):hover::after {
  opacity: 1.2;
  background: linear-gradient(90deg, 
    rgba(var(--button-glass-shine-color), calc(var(--button-glass-shine-opacity) * 1.2)) 100%, 
    transparent 40%
  );
}

.calculate-btn > span {
  position: relative;
  z-index: 2;
}

.btn-hover {
  display: none;
}

/* Results Card with Glass Effect */
.result-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, calc(var(--button-glass-opacity) * 1.8)), 
    rgba(255, 255, 255, calc(var(--button-glass-opacity) * 1.2))
  ) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  padding: 1.4rem 2rem 0rem 2rem;
  border-radius: 1.6rem !important;
  box-shadow: 0px 6px 16px 0px rgba(0, 0, 0, 0.10), 
              0px 2px 4px 0px rgba(0, 0, 0, 0.08),
              inset 0px 1px 0px rgba(255, 255, 255, 0.4) !important;
  backdrop-filter: blur(calc(var(--button-glass-blur) * 1.5)) !important;
  -webkit-backdrop-filter: blur(calc(var(--button-glass-blur) * 1.5)) !important;
  display: none;
  opacity: 0;
  transform: translateY(1rem);
  transition: all 0.4s ease;
}

/* Glass shine effect for result card */
.result-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 32%;
  height: 32%;
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  border-left: 1px solid rgba(255, 255, 255, 0.45);
  border-top-left-radius: inherit;
  pointer-events: none;
  z-index: 1;
  opacity: 0.85;
}

.result-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 60%;
  height: 60%;
  background: linear-gradient(135deg, 
    rgba(var(--button-glass-shine-color), calc(var(--button-glass-shine-opacity) * 1.5)) 0%, 
    rgba(var(--button-glass-shine-color), calc(var(--button-glass-shine-opacity) * 0.8)) 30%,
    transparent 60%
  );
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
  opacity: 0.7;
}

.result-card > * {
  position: relative;
  z-index: 2;
}

.result-item {
  margin-bottom: 1.2rem;
}

.result-item p {
  margin: 0;
}

.result-item p:first-child {
  font-size: 1.5rem;
  color: rgba(var(--color-foreground), 0.7);
  margin-bottom: 0.3rem;
}

.result-item strong {
  font-size: 2rem;
  font-weight: 600;
  color: rgb(var(--color-foreground));
}

@media screen and (min-width: 750px) {
  .result-item p:first-child {
    font-size: 1.6rem;
  }

  .result-item strong {
    font-size: 2.2rem;
  }
}

.result-total {
  margin-top: 1.2rem;
}

.result-total p:first-child {
  font-size: 1.8rem;
  font-weight: 600;
  color: rgb(var(--color-foreground));
}

.result-total strong {
  font-size: 3.2rem;
  font-weight: 700;
  color: rgb(var(--color-button));
}

@media screen and (min-width: 750px) {
  .result-total p:first-child {
    font-size: 2rem;
  }

  .result-total strong {
    font-size: 3.6rem;
  }
}

.result-card hr {
  margin: 2rem 0;
  border: none;
  border-top: 0.1rem solid rgba(var(--color-foreground), 0.1);
}

.disclaimer {
  font-size: 1.2rem;
  color: rgba(var(--color-foreground), 0.6);
  margin-top: 1.6rem;
  line-height: 1.5;
}

/* Hover Effects */
.input-card:hover {
  backdrop-filter: blur(calc(var(--button-glass-blur) * 2));
  -webkit-backdrop-filter: blur(calc(var(--button-glass-blur) * 2));
  box-shadow: 0px 9px 22px 0px rgba(0, 0, 0, 0.14), 
              0px 3px 8px 0px rgba(0, 0, 0, 0.10),
              inset 0px 1px 0px rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.input-card:hover::before {
  border-top-width: 3px;
  border-left-width: 3px;
  opacity: 1;
}

.input-card:hover::after {
  opacity: 1;
  background: linear-gradient(135deg, 
    rgba(var(--button-glass-shine-color), calc(var(--button-glass-shine-opacity) * 2)) 0%, 
    rgba(var(--button-glass-shine-color), var(--button-glass-shine-opacity)) 30%,
    transparent 60%
  );
}

.fulfilment-calculator .styled-input:focus, 
.fulfilment-calculator .styled-select:focus {
  outline: 0.2rem solid rgba(var(--color-foreground), 0.5);
  outline-offset: 0.3rem;
  border-color: rgba(var(--color-foreground), 0.55);
}

.checkbox-square:hover input[type="checkbox"],
.radio-square:hover input[type="radio"] {
  border-color: rgba(var(--color-foreground), 0.75);
}

.checkbox-square input[type="checkbox"]:focus-visible,
.radio-square input[type="radio"]:focus-visible {
  outline: 0.2rem solid rgba(var(--color-foreground), 0.5);
  outline-offset: 0.3rem;
}

/* Label styling */
.input-card label {
  font-size: 1.5rem;
  color: rgba(var(--color-foreground), 0.85);
  display: block;
  margin-bottom: 0.8rem;
}

@media screen and (min-width: 750px) {
  .input-card label {
    font-size: 1.6rem;
  }
}

/* Mobile Responsiveness */
@media screen and (max-width: 749px) {
  .fulfilment-calculator {
    padding: 2rem 0;
  }

  .calculator-header {
    margin-bottom: 3rem;
  }

  .calculator-header h2 {
    font-size: 2.4rem;
  }

  .calculator-header p {
    font-size: 1.4rem;
  }

  .calculator-columns {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .input-card {
  min-height: 12rem;
    margin-bottom: 1.5rem !important;
    padding: 1.6rem 1.5rem 1.4rem 1.5rem !important;
  }

  .result-card {
    padding: 1.2rem 1.8rem 1.8rem 1.8rem !important;
  }

  .result-column {
    order: 3;
  }

  .calculate-btn {
    margin-bottom: 2rem;
  }
}

@media screen and (min-width: 750px) and (max-width: 989px) {
  .calculator-columns {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .result-column {
    grid-column: 1 / -1;
  }
}

/* Animations */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-0.5rem); }
  40%, 80% { transform: translateX(0.5rem); }
}

.fulfilment-calculator .error {
  animation: shake 0.5s;
  border-color: rgb(var(--color-error)) !important;
  background-color: rgba(var(--color-error), 0.05) !important;
}

/* Smooth transitions */
.fulfilment-calculator * {
  box-sizing: border-box;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  .fulfilment-calculator *,
  .fulfilment-calculator *::before,
  .fulfilment-calculator *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

