/* OZLintels Calculator CSS */

/* Import fonts */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Golos+Text:wght@400;500;600;700&display=swap");

/* Basic reset */
.ozlintels-calculator * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Calculator container */
.ozlintels-calculator {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell,
    "Helvetica Neue", sans-serif;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0;
  color: #333;
}

/* Calculator header */
.calculator-header {
  text-align: center;
  margin-bottom: 30px;
}

.calculator-title {
  font-family: "Golos Text", sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: #033452;
  margin-bottom: 5px;
}

.calculator-subtitle {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  color: #666;
  margin-top: 0;
  margin-bottom: 15px;
}

/* Category tabs */
.category-tabs {
  margin-bottom: 25px;
  border-bottom: 1px solid #ddd;
}

.tabs-list {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
  justify-content: center;
}

.tab {
  font-family: "Inter", sans-serif;
  padding: 12px 20px;
  cursor: pointer;
  border: 1px solid transparent;
  border-bottom: none;
  margin-right: 5px;
  border-radius: 4px 4px 0 0;
  background-color: #f5f5f5;
  transition: all 0.2s ease;
  font-weight: 500;
}

.tab:hover {
  background-color: rgba(21, 181, 205, 0.1);
}

.tab.active {
  background-color: #15b5cd;
  color: white;
  border-color: #15b5cd;
}

/* Category Image Container */
.category-image-container {
  margin-bottom: 25px;
  text-align: center;
  background-color: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 20px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-image-wrapper {
  position: relative;
  max-width: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-image {
  max-width: 100%;
  max-height: 300px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: opacity 0.3s ease;
}

.category-image-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-family: "Inter", sans-serif;
}

.loading-spinner-small {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid #eee;
  border-top-color: #15b5cd;
  animation: spin 1s linear infinite;
}

/* Responsive adjustments for category image */
@media (max-width: 768px) {
  .category-image-container {
    padding: 15px;
    min-height: 150px;
  }

  .category-image {
    max-height: 200px;
  }
}

@media (max-width: 480px) {
  .category-image-container {
    padding: 10px;
    min-height: 120px;
  }

  .category-image {
    max-height: 150px;
  }
}

/* Products Container */
.products-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

/* Product card */
.product-card {
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  background-color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
}

/* Product title */
.product-title {
  font-family: "Golos Text", sans-serif;
  font-size: 12px;
  font-weight: 600;
  margin: 0;
  padding: 10px 15px;
  color: #033452;
  background-color: #f9f9f9;
  border-bottom: 1px solid #eee;
  text-align: center;
}

/* Product sizes */
.product-sizes {
  list-style-type: none;
  padding: 0;
  margin: 0;
  flex: 1;
}

.size-item {
  font-family: "Inter", sans-serif;
  padding: 6px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #eee;
  line-height: 1.2;
}

.size-item:nth-child(odd) {
  background-color: #f5f5f5;
}

.size-item:nth-child(even) {
  background-color: #f9f9f9;
}

.size-length {
  font-weight: 500;
  font-size: 14px;
  color: #333;
}

/* Quantity Control */
.qty-control {
  display: flex;
  align-items: center;
}

.qty-select {
  width: 60px;
  height: 30px;
  padding: 5px;
  border: 1px solid #ced4de;
  border-radius: 4px;
  text-align: center;
  font-family: "Inter", sans-serif;
  font-size: 14px;
}

/* Placeholder text color */
::placeholder {
  color: #a0a0a0 !important;
  opacity: 1 !important;
}

:-ms-input-placeholder {
  color: #a0a0a0 !important;
}

::-ms-input-placeholder {
  color: #a0a0a0 !important;
}

/* Custom cut section - FIXED: Better layout management */
.custom-cut-section {
  padding: 15px;
  background-color: #f5f5f5;
  border-top: 1px solid #ced4de;
  display: flex;
  flex-direction: column;
  min-height: 120px; /* Ensure minimum height */
}

.cut-price {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: #033452;
  margin-bottom: 10px;
  flex-shrink: 0; /* Prevent shrinking */
}

/* FIXED: Scrollable container for custom cut forms */
.custom-cut-forms-container {
  flex: 1;
  max-height: 200px; /* Maximum height before scrolling */
  overflow-y: auto;
  margin-bottom: 10px;
  padding-right: 5px; /* Space for scrollbar */
}

/* Custom scrollbar styling */
.custom-cut-forms-container::-webkit-scrollbar {
  width: 6px;
}

.custom-cut-forms-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.custom-cut-forms-container::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.custom-cut-forms-container::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* FIXED: Custom cut form layout */
.custom-cut-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px; /* Reduced margin */
  position: relative;
  padding: 8px;
  border: 1px solid #eee;
  border-radius: 4px;
  background-color: white;
  min-height: 44px; /* Consistent height */
}

.custom-length-input {
  flex: 3;
  padding: 8px 10px;
  border: 1px solid #ced4de;
  border-radius: 4px;
  font-family: "Inter", sans-serif;
  font-size: 14px;
}

.custom-qty-select {
  width: 60px;
  height: 30px;
  padding: 5px;
  border: 1px solid #ced4de;
  border-radius: 4px;
  text-align: center;
  font-family: "Inter", sans-serif;
  font-size: 14px;
}

/* FIXED: Remove button styling - positioned top right, just red X */
.remove-custom-form {
  position: absolute !important;
  top: -10px !important;
  right: -10px !important;
  background: none !important;
  color: #dc3545 !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  font-size: 18px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  z-index: 10 !important;
  width: 20px !important;
  height: 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  font-weight: bold !important;
}

.remove-custom-form:hover {
  color: #c82333 !important;
  transform: scale(1.2) !important;
}

.remove-custom-form:active {
  transform: scale(0.9) !important;
}

/* FIXED: Add more button - always at bottom */
.add-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px; /* Reduced padding */
  background-color: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  font-size: 13px; /* Slightly smaller font */
  color: #033452;
  font-family: "Inter", sans-serif;
  font-weight: 500;
  transition: all 0.2s ease;
  flex-shrink: 0; /* Prevent shrinking */
  margin-top: auto; /* Push to bottom */
}

.add-more-btn:hover {
  background-color: #e9ecef;
  border-color: #15b5cd;
  color: #15b5cd;
}

/* Loading spinner */
.loading-spinner {
  grid-column: 1 / -1;
  text-align: center;
  padding: 30px;
  color: #666;
}

.loading-spinner:before {
  content: "";
  display: block;
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  border-radius: 50%;
  border: 3px solid #ddd;
  border-top-color: #15b5cd;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Cut price note */
.cut-price-note {
  text-align: center;
  margin-top: 20px;
  padding: 12px;
  background-color: #f9f9f9;
  border-radius: 4px;
  font-size: 14px;
  color: #666;
  border: 1px solid #eee;
}

/* Product footer */
.product-footer {
  padding: 12px 15px;
  background-color: #f5f5f5;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Button container for side-by-side buttons */
.button-container {
  display: flex;
  gap: 10px;
  width: 100%;
}

/* FIXED: Unified Add to Cart button styling */
.unified-add-to-cart {
  flex: 1;
  font-family: "Inter", sans-serif !important;
  background-color: #15b5cd !important;
  color: white !important;
  border: none !important;
  padding: 10px 16px !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  font-size: 14px !important;
  transition: all 0.2s ease !important;
  font-weight: 500 !important;
  text-align: center !important;
  min-height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.unified-add-to-cart:hover {
  background-color: #033452 !important;
  transform: translateY(-1px) !important;
}

.unified-add-to-cart:disabled {
  background-color: #999 !important;
  cursor: not-allowed !important;
  transform: none !important;
  opacity: 0.7 !important;
}

/* Technical Specs Button Styling */
.technical-specs-btn {
  flex: 1;
  font-family: "Inter", sans-serif !important;
  background-color: #f8f9fa !important;
  color: #495057 !important;
  border: 1px solid #dee2e6 !important;
  padding: 10px 16px !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  font-size: 14px !important;
  transition: all 0.2s ease !important;
  font-weight: 500 !important;
  text-align: center !important;
  min-height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.technical-specs-btn:hover {
  background-color: #e9ecef !important;
  border-color: #adb5bd !important;
  color: #212529 !important;
  transform: translateY(-1px) !important;
}

.technical-specs-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(21, 181, 205, 0.25);
}

/* Success message */
.success-message {
  font-family: "Inter", sans-serif !important;
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #15b5cd;
  color: white;
  padding: 15px;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  animation: fadeInOut 3s forwards;
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  10% {
    opacity: 1;
    transform: translateY(0);
  }
  90% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* Cart badge styling */
.woo-cart-badge {
  position: absolute !important;
  top: -8px !important;
  right: -8px !important;
  background-color: #15b5cd !important;
  color: white !important;
  border-radius: 50% !important;
  width: 18px !important;
  height: 18px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 11px !important;
  font-weight: bold !important;
  z-index: 1000 !important;
}

/* Cart icon positioning */
.cart-contents,
.cart-icon,
.cart,
a.cart,
.header-cart,
.site-header-cart,
.woocommerce-cart-link,
#site-header-cart,
.menu-item-cart,
.cart-link,
.header-cart-link,
.woocommerce-cart,
.cart-button,
.cart-wrapper,
.cart-container {
  position: relative !important;
}

/* Side Cart Styles - REPLACE ONLY THIS SECTION */
.side-cart {
  position: fixed !important;
  top: 90px !important;
  right: -400px !important;
  width: 350px !important;
  max-width: 90vw !important;
  height: calc(100vh - 90px) !important;
  background-color: white !important;
  box-shadow: -2px 0 15px rgba(0, 0, 0, 0.15) !important;
  z-index: 9999 !important;
  display: flex !important;
  flex-direction: column !important;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  font-family: "Inter", sans-serif !important;
  border-left: 1px solid #eee !important;
  border-radius: 8px 0 0 8px !important;
}

.side-cart.active {
  right: 0 !important;
}

.side-cart-header {
  padding: 20px;
  border-bottom: 2px solid #15B5CD;
  display: flex;
  align-items: center;
  background-color: #f8f9fa;
  position: relative;
  flex-shrink: 0;
}

.side-cart-header h3 {
  margin: 0;
  font-size: 22px;
  color: #033452;
  font-weight: 700;
  font-family: "Golos Text", sans-serif !important;
  text-align: center;
  flex: 1;
  letter-spacing: -0.5px;
}

.close-side-cart {
  background: #fff !important;
  border: 2px solid #dee2e6 !important;
  font-size: 18px !important;
  cursor: pointer !important;
  color: #6c757d !important;
  padding: 0 !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  transition: all 0.2s ease !important;
  position: absolute !important;
  right: 15px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.close-side-cart:hover {
  background: #dc3545 !important;
  color: white !important;
  border-color: #dc3545 !important;
  transform: translateY(-50%) scale(1.1) !important;
}

.side-cart-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  min-height: 0;
}

.side-cart-content::-webkit-scrollbar {
  width: 6px;
}

.side-cart-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.side-cart-content::-webkit-scrollbar-thumb {
  background: #15B5CD;
  border-radius: 3px;
}

.side-cart-content::-webkit-scrollbar-thumb:hover {
  background: #033452;
}

.side-cart-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100px;
  color: #666;
}

.side-cart-spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid #eee;
  border-top-color: #15b5cd;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

.empty-cart-message {
  text-align: center;
  padding: 40px 20px;
}

.empty-cart-message p {
  margin: 0 0 10px 0;
  font-size: 18px;
  color: #495057;
  font-weight: 500;
}

.empty-cart-subtext {
  color: #6c757d !important;
  font-size: 14px !important;
  font-style: italic !important;
}

.side-cart-items {
  margin-bottom: 15px;
}

.side-cart-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 15px 0;
  border-bottom: 1px solid #f1f3f4;
  transition: background-color 0.2s ease;
}

.side-cart-item:hover {
  background-color: #f8f9fa;
  margin: 0 -10px;
  padding-left: 10px;
  padding-right: 10px;
  border-radius: 6px;
}

.side-cart-item-info {
  flex: 1;
  padding-right: 15px;
}

.side-cart-item-info h4 {
  margin: 0 0 8px 0;
  font-size: 15px;
  font-weight: 600;
  color: #033452;
}

.side-cart-item-price {
  margin: 0;
  font-size: 16px;
  color: #15B5CD;
  font-weight: 700;
}

.side-cart-item-meta {
  font-size: 13px !important;
  color: #666 !important;
  margin-top: 5px !important;
}

.remove-item {
  background: #fff !important;
  border: 1px solid #dee2e6 !important;
  font-size: 14px !important;
  cursor: pointer !important;
  color: #dc3545 !important;
  padding: 0 !important;
  width: 28px !important;
  height: 28px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  transition: all 0.2s ease !important;
  font-weight: bold !important;
}

.remove-item:hover {
  background: #dc3545 !important;
  color: white !important;
  border-color: #dc3545 !important;
  transform: scale(1.1) !important;
}

.side-cart-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0 15px 0;
  border-top: 2px solid #15B5CD;
  font-weight: 700;
  font-size: 18px;
  color: #033452;
  background-color: #f8f9fa;
  margin: 0 -20px;
  padding-left: 20px;
  padding-right: 20px;
}

.subtotal-amount {
  color: #15B5CD;
  font-size: 20px;
}

.side-cart-footer {
  padding: 20px !important;
  border-top: 2px solid #15B5CD !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  background-color: #f8f9fa !important;
  flex-shrink: 0 !important;
  position: relative !important;
  z-index: 10 !important;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.1) !important;
}

.view-cart-button,
.checkout-button {
  display: block !important;
  text-align: center !important;
  padding: 14px 20px !important;
  border-radius: 6px !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
  font-size: 16px !important;
  font-family: "Inter", sans-serif !important;
  border: 2px solid transparent !important;
}

.view-cart-button {
  background-color: #fff !important;
  color: #033452 !important;
  border-color: #15B5CD !important;
}

.view-cart-button:hover {
  background-color: #15B5CD !important;
  color: white !important;
  text-decoration: none !important;
}

.checkout-button {
  background-color: #15B5CD !important;
  color: white !important;
  border-color: #15B5CD !important;
}

.checkout-button:hover {
  background-color: #033452 !important;
  border-color: #033452 !important;
  text-decoration: none !important;
}

/* Technical Specs Modal */
.tech-specs-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tech-specs-modal {
  background-color: white;
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  font-family: "Inter", sans-serif;
}

.tech-specs-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  flex-direction: column;
  position: relative;
}

.tech-specs-header h3 {
  margin: 0 0 5px 0;
  font-size: 20px;
  color: #033452;
  font-weight: 600;
  font-family: "Golos Text", sans-serif;
}

.tech-specs-header h4 {
  margin: 0;
  font-size: 16px;
  color: #666;
  font-weight: 500;
}

.close-tech-specs {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.close-tech-specs:hover {
  background-color: #f5f5f5;
}

.tech-specs-content {
  padding: 20px;
}

.tech-specs-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  color: #666;
}

.tech-specs-spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid #eee;
  border-top-color: #15b5cd;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

.specs-grid {
  display: grid;
  gap: 15px;
}

.spec-item {
  padding: 12px;
  background-color: #f9f9f9;
  border-radius: 6px;
  border-left: 4px solid #15b5cd;
}

.spec-item strong {
  color: #033452;
  display: inline-block;
  min-width: 120px;
}

.specs-error {
  text-align: center;
  padding: 30px;
  color: #666;
}

.specs-error p {
  margin: 0 0 10px 0;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
  .products-container {
    grid-template-columns: repeat(2, 1fr);
  }

  .side-cart {
    width: 320px;
  }
}

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

  .tab {
    padding: 8px 12px;
    font-size: 13px;
    text-transform: uppercase;
  }

  .calculator-title {
    font-size: 22px;
  }

  .calculator-subtitle {
    font-size: 14px;
  }

  .button-container {
    flex-direction: column;
    gap: 8px;
  }

  .tech-specs-modal {
    width: 95%;
    margin: 20px;
  }

  .tech-specs-header {
    padding: 15px;
  }

  .tech-specs-content {
    padding: 15px;
  }

  .spec-item strong {
    min-width: auto;
    display: block;
    margin-bottom: 5px;
  }

  .side-cart {
    width: 100%;
    max-width: 100%;
  }

  .side-cart-header h3 {
    font-size: 18px;
  }

  .side-cart-content {
    padding: 15px;
  }

  .side-cart-footer {
    padding: 15px;
  }

  /* Mobile adjustments for custom cut section */
  .custom-cut-forms-container {
    max-height: 150px; /* Smaller on mobile */
  }
}

@media (max-width: 480px) {
  .custom-cut-form {
    flex-wrap: wrap;
    padding: 6px;
  }

  .custom-length-input {
    width: 100%;
    margin-bottom: 5px;
  }

  .unified-add-to-cart,
  .technical-specs-btn {
    padding: 10px 12px !important;
    font-size: 13px !important;
  }

  .side-cart-header h3 {
    font-size: 16px;
  }

  .side-cart-content {
    padding: 15px;
  }

  .side-cart-footer {
    padding: 15px;
  }

  .custom-cut-forms-container {
    max-height: 120px; /* Even smaller on very small screens */
  }
}

.no-products,
.error-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 30px;
  color: #666;
  font-family: "Inter", sans-serif !important;
}

/* Add styles for validation errors */
.input-error {
  border-color: red !important;
}

.error-message {
  color: red;
  font-size: 12px;
  margin-top: 4px;
  display: block;
}