.contracts-block {
  margin-inline: auto;
  max-width: 1200px;
  padding: 0 16px;
  font-family: 'Montserrat', sans-serif; /* Ensure font matches */
}

.contracts-block-heading {
  font-size: 32px;
  font-weight: 700;
  margin: auto;
  display: flex;
  justify-content: center;
  text-align: center;
  padding-top: 32px;
  padding-bottom: 16px;
  color: #333;
}

.hr-contracts-block {
  width: 56px;
  border-bottom: 2px solid #e04c08; 
  height: 0;
  border-top: none;
  margin: 0 auto 16px; 
}

.contracts-block-slogan {
  text-align: center;
  margin-bottom: 30px;
  color: #666;
}

.togle-container {
  padding-top: 20px;
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
}

.toggle-pill {
  position: relative;
  display: flex;
  background-color: #f0f0f0;
  border-radius: 30px;
  overflow: hidden;
  height: 50px;
  width: 100%;
  max-width: 800px; /* Limit width */
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.toggle-pill button {
  flex: 1;
  z-index: 2;
  border: none;
  background: none;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: color 0.3s;
  color: #555;
  outline: none;
}

.toggle-pill button.active {
  color: #fff;
}

.toggle-pill button:not(.active):hover {
  color: #e04c08;
}

.toggle-ball {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 8px);
  height: 42px;
  background-color: #e04c08; /* Blue like the reference */
  border-radius: 25px;
  transition: left 0.3s ease;
  z-index: 1;
}

.toggle-ball.right {
  left: calc(50% + 4px);
}

/* --- GRID LAYOUT --- */
.contracts-list {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.contract-item {
  display: flex; 
  flex-direction: column;
  flex: 1 1 250px; /* Responsive width */
  max-width: 300px;
  min-width: 250px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  padding: 0; /* Remove default padding, inner containers handle it */
  overflow: hidden; /* For image */
  position: relative;
}

/* Hide items handled by JS toggling */
.contract-item[style*="display: none"] {
    display: none !important;
}

.contract-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Image Top */
.contract-card-image {
  width: 100%;
  height: 150px;
  overflow: hidden;
  background-color: #f3f4f6;
  position: relative;
}

.contract-card-image img {
  width: 100%;
  height: 100%;
  object-fit: initial;
  transition: transform 0.3s ease;
}

.contract-item:hover .contract-card-image img {
  transform: scale(1.05);
}

/* Content Container */
.contract-card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Headings */
.contract-item-card-heading1 {
  font-size: 18px;
  font-weight: 700;
  color: #fff; /* Title over image usually, but here it's below? Reference shows title ON image */
  /* Ah, reference shows title ON image. Let's adjust if requested, but plan said image top. 
     Wait, reference image has title INSIDE the blue/image area at the bottom. 
     Let's try to simulate that look: Text Overlay on Image bottom */
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  padding: 20px 15px 10px;
  color: white;
  z-index: 2;
}
/* Re-target heading selector to be specific if inside .contract-card-content, but wait, 
   we rendered it inside .contract-card-content in save(). 
   To match reference, we should probably move it via CSS or just style it simply below. 
   Let's style it below for now as per robust implementation, unless I can absolute position it relative to the card item if image is first child. */

.contract-item .contract-item-card-heading1 {
    /* Override for standard layout below image */
    color: #1f2937;
    margin-bottom: 5px;
    position: static;
    background: none;
    padding: 0;
}

/* If user wants the reference look exactly: Title is usually below image or on it. 
   The reference shows "Plan Free", "Plan Standard" on the blue background part of the image. 
   Let's keep it simple: Text below image for now unless explicitly moved. */

.contract-item-card-heading2 {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 15px;
}

/* Prices */
.contract-card-prices {
    margin-bottom: 15px;
}
.contract-item-card-price-eu {
    font-size: 18px;
    font-weight: 700;
    color: #e04c08;
}
.contract-item-card-price {
    font-size: 14px;
    color: #6b7280;
}

.contract-card-divider {
    height: 1px;
    background-color: #e5e7eb;
    margin: 10px 0 15px;
}

/* List features */
.contract-item-card-text ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 14px;
    color: #374151;
}
.contract-item-card-text li {
    padding-left: 32px;
    position: relative;
    margin-bottom: 8px;
    line-height: 1.4;
}
/* Checkmark icon */
.contract-item-card-text li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 2px;
    color: #fff; 
    background-color: #e04c08;
    font-weight: 900;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
}

.text-container-contract {
    flex-grow: 1; /* Push footer down */
    margin-bottom: 20px;
}

/* Footer: Button & Read More */
.contract-card-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: auto;
}

.contract-item-card-button {
  display: inline-block;
  width: 100%;
  text-align: center;
  padding: 12px 20px;
  background-color: #e04c08; /* Darker blue */
  color: white;
  border-radius: 25px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.3s;
}
.contract-item-card-button:hover {
  background-color: #c03c05; /* Slightly darker */
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(224, 76, 8, 0.4);
  color: white;
}

.contract-read-more-wrapper {
    width: 100%;
    text-align: center;
    border-top: 1px solid #f3f4f6;
    padding-top: 10px;
}
.contract-read-more-btn {
    background: none;
    border: none;
    color: #e04c08;
    font-weight: 500;
    cursor: pointer;
    font-size: 14px;
    padding: 5px 10px;
}
.contract-read-more-btn:hover {
    text-decoration: underline;
}


/* --- MODAL STYLES --- */
.contract-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent dim */
    z-index: 10000; /* High z-index */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}
.contract-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.contract-modal-container {
    background-color: #fff;
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    padding: 30px;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
.contract-modal-overlay.open .contract-modal-container {
    transform: scale(1);
}

.contract-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.2s;
}
.contract-modal-close:hover {
    color: #1f2937;
}

.contract-modal-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1f2937;
}

.contract-modal-body {
    font-size: 16px;
    line-height: 1.6;
    color: #4b5563;
    max-height: 70vh;
    overflow-y: auto;
}

/* Mobile Toggle Text */
@media (max-width: 700px) {
  .toggle-suffix {
    display: none;
  }
}
