/* ========== DESKTOP FIRST (≥768px) ========== */

/* page header container */
.cart-page-header {
    box-sizing: border-box;
    width: 100%;
    padding: 0;
}

/* ---------- BREADCRUMBS ---------- */
.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px; /* --breadcrumb-gap */
    margin-bottom: 30px; /* --breadcrumb-margin-bottom */
    padding-top: 12px;      /* visual vertical alignment from JSON (y=12 inside breadcrumb frame) */
}

.breadcrumb-link {
    font-size: 11px;        /* --breadcrumb-font-size */
    font-weight: 500;       /* --breadcrumb-font-weight */
    color: #B9B9B9;         /* --breadcrumb-color */
    text-decoration: none;
    letter-spacing: 0;
    line-height: normal;
    transition: opacity 0.2s ease;
}

.breadcrumb-link:hover {
    opacity: 0.7;
}

/* custom arrow element (pure CSS, matches rotated rectangles) */
.breadcrumb-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 4.24px;          /* --arrow-width */
    height: 7.24px;         /* --arrow-height */
    flex-shrink: 0;
}

.breadcrumb-arrow::before,
.breadcrumb-arrow::after {
    content: '';
    position: absolute;
    width: 1px;             /* --arrow-rect-width */
    height: 5px;            /* --arrow-rect-height */
    background-color: #B9B9B9; /* --arrow-color */
    border-radius: 20px;   /* from JSON cornerRadii */
    top: 50%;
    left: 50%;
    transform-origin: center;
}

/* first rectangle: 45deg */
.breadcrumb-arrow::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

/* second rectangle: 135deg */
.breadcrumb-arrow::after {
    transform: translate(-50%, -50%) rotate(135deg);
}

/* Hidden elements (visible: false from Figma) – exactly match JSON but remain invisible */
.hidden-breadcrumb {
    display: none;
}

/* ---------- TITLE + BUTTON ROW ---------- */
.title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.cart-title {
    font-size: 36px;        /* --title-font-size */
    font-weight: 700;       /* --title-font-weight */
    color: #252B2B;         /* --title-color */
    letter-spacing: 0;      /* --title-letter-spacing */
    text-transform: uppercase; /* --title-text-transform */
    line-height: 1.2;
}

/* clear cart button */
.clear-cart-btn {
    background: transparent;
    border: 1px solid #252B2B;   /* --btn-border */
    padding: 7px 9px;            /* --btn-padding */
    font-family: inherit;
    font-size: 12px;             /* --btn-font-size */
    font-weight: 500;            /* --btn-font-weight */
    color: #252B2B;              /* --btn-color */
    text-transform: uppercase;   /* --btn-text-transform */
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0;
    line-height: normal;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.clear-cart-btn:hover {
    background-color: rgba(37, 43, 43, 0.05);
    transform: translateY(-1px);
}

.clear-cart-btn:active {
    transform: translateY(0);
}

/* ========== MOBILE LAYOUT (max-width: 766px) ========== */
@media (max-width: 766px) {
    .breadcrumbs {
        padding-top: 0;
        margin-bottom: 27px; /* --breadcrumb-margin-bottom */
        gap: 4px;            /* --breadcrumb-gap */
    }

    .breadcrumb-link {
        font-size: 9px;         /* --breadcrumb-font-size */
        font-weight: 400;       /* --breadcrumb-font-weight */
        color: #B9B9B9;
    }

    .breadcrumb-arrow {
        width: 2.93px;          /* --arrow-width */
        height: 5px;            /* --arrow-height */
    }

    .breadcrumb-arrow::before,
    .breadcrumb-arrow::after {
        width: 0.69px;          /* --arrow-rect-width */
        height: 3.45px;         /* --arrow-rect-height */
        background-color: #B9B9B9;
    }

    .title-row {
        gap: 5px;               /* itemSpacing = 5 from mobile JSON Frame 742 */
        flex-wrap: nowrap;
    }

    .cart-title {
        font-size: 18px;       /* --title-font-size */
        font-weight: 700;      /* --title-font-weight */
        white-space: nowrap;
    }

    .clear-cart-btn {
        padding: 7px 9px;       /* --btn-padding */
        font-size: 12px;        /* --btn-font-size */
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* extra small devices (below 480px): allow button text to wrap? but keep as is */
@media (max-width: 480px) {
    .title-row {
        flex-wrap: wrap;
        gap: 12px;
    }

    .cart-title {
        white-space: normal;
    }

    .clear-cart-btn {
        white-space: normal;
        text-align: center;
    }
}

/* Optional: ensure arrows alignment on all browsers */
.breadcrumb-arrow {
    vertical-align: middle;
}

/* preserve pixel perfection for arrow positioning */
.breadcrumbs > * {
    vertical-align: middle;
}

/* desktop container width */
.cart-container {
    width: 100%;
    box-sizing: border-box;
    padding-bottom: 60px;
}

/* desktop table header */
.cart-header {
  display: grid;
  grid-template-columns: 135px 100px 220px 130px 120px 100px 110px 48px;
  gap: 30px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #d7d7d7; /* --border-color */
  font-family: "Geometria", system-ui, sans-serif; /* --font-family-primary */
  font-size: 12px; /* --header-font-size */
  font-weight: 700; /* --header-font-weight */
  color: #25282b; /* --text-primary */
  letter-spacing: 0;
}
.cart-header > div {
  padding: 0 4px;
}

/* product item (desktop grid row) */
.cart-item {
  display: grid;
  grid-template-columns: 135px 100px 220px 130px 120px 100px 110px 48px;
  align-items: center;
  gap: 30px;
  padding: 16px 0;
  border-bottom: 1px solid #d7d7d7; /* --border-color */
  transition: background 0.2s;
  position: relative;
}
.cart-item:last-child {
  border-bottom: none;
}

/* product cells */
.item-photo {
  width: 135px;
  height: 85px;
  background: #f0f2f5;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.item-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.item-number {
  font-size: 14px; /* --body-font-size */
  font-weight: 400;
  font-family: "Geometria", system-ui, sans-serif; /* --font-family-primary */
  color: #25282b; /* --text-primary */
}
.item-name {
  font-size: 14px; /* --body-font-size */
  font-weight: 400;
  font-family: "Geometria", system-ui, sans-serif; /* --font-family-primary */
  color: #25282b; /* --text-primary */
  line-height: 1.3;
  padding-right: 8px;
}
.item-warehouse {
  font-size: 14px; /* --body-font-size */
  font-weight: 400;
  font-family: "Geometria", system-ui, sans-serif; /* --font-family-primary */
  color: #25282b; /* --text-primary */
}
.item-dimensions {
  font-size: 14px; /* --body-font-size */
  font-weight: 400;
  font-family: "Geometria", system-ui, sans-serif; /* --font-family-primary */
  color: #25282b; /* --text-primary */
}
.item-area {
  font-size: 14px; /* --body-font-size */
  font-weight: 400;
  font-family: "Inter", "Geometria", monospace; /* --font-family-numbers */
  color: #25282b; /* --text-primary */
}
.item-price-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.old-price {
  font-size: 10px; /* --old-price-font-size */
  font-weight: 400;
  font-family: "Geometria", system-ui, sans-serif; /* --font-family-primary */
  color: #898989; /* --text-secondary */
  text-decoration: line-through;
}
.current-price {
  font-size: 14px; /* --price-font-size */
  font-weight: 700;
  font-family: "Geometria", system-ui, sans-serif; /* --font-family-primary */
  color: #25282b; /* --text-primary */
}
.delete-btn {
    position: absolute;
    right: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  transition: background 0.2s;
}
.delete-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}
.delete-btn svg {
  width: 18px;
  height: 18px;
  stroke: #25282b; /* --text-primary */
  stroke-width: 1.5;
}

/* totals summary (desktop right side) */
.cart-summary {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid #d7d7d7; /* --border-color */
}
.summary-card {
  width: 280px;
  background: #ffffff; /* --bg-white */
  border-radius: 0;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  font-family: "Geometria", system-ui, sans-serif; /* --font-family-primary */
}
.summary-row:first-child {
  padding-top: 0;
}
.summary-row.total {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid #d7d7d7; /* --border-color */
  font-weight: 700;
}
.summary-label {
  color: #25282b; /* --text-primary */
  font-weight: 400;
}
.summary-value {
  color: #25282b; /* --text-primary */
  font-weight: 400;
}
.total .summary-value {
  font-weight: 700;
}

/* ========== MOBILE EXPAND/CONTENT (hidden on desktop) ========== */
.item-expand-details {
  display: none;
}
.expand-link {
  display: none;
}

/* ========== MEDIA QUERY : MOBILE (max-width: 766px) ========== */
@media (max-width: 766px) {
  .cart-header {
    display: none;
  }
  .cart-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: #ffffff;
    border: 1px solid #d7d7d7; /* --border-color */
    border-radius: 0;
    padding: 16px;
    margin-bottom: 16px;
    gap: 12px;
    box-shadow: none;
  }
  .cart-item:last-child {
    margin-bottom: 0;
  }
  /* top row: photo + info + delete */
  .item-top-row {
    display: flex;
    gap: 12px;
    position: relative;
  }
  .item-photo {
    width: 102px;
    height: 65px;
    flex-shrink: 0;
  }
  .item-info-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .item-number {
    font-size: 11px;
    font-weight: 400;
  }
  .item-name {
    font-size: 11px;
    line-height: 1.3;
    padding-right: 28px;
  }
  .delete-btn {
    position: absolute;
    top: 0;
    right: 0;
  }
  /* price row */
  .mobile-price-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 4px;
  }
  .item-price-block {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }
  .old-price {
    font-size: 10px;
  }
  .current-price {
    font-size: 14px;
  }
  /* expand link */
  .expand-link {
    display: block;
    font-size: 11px;
    font-family: "Geometria", system-ui, sans-serif; /* --font-family-primary */
    color: #898989; /* --text-secondary */
    background: none;
    border: none;
    text-align: left;
    padding: 0;
    margin-top: 6px;
    cursor: pointer;
    font-weight: 400;
  }
  .expand-link:hover {
    text-decoration: underline;
  }
  /* extra details (collapsed by default) */
  .item-expand-details {
    display: block;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: #f9fafb;
    padding: 0 8px;
    margin-top: 0;
    border-radius: 6px;
  }
  .item-expand-details.show {
    max-height: 180px;
    padding: 12px 8px;
    margin-top: 8px;
    border-top: 1px solid #d7d7d7; /* --border-color */
  }
  .details-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-family: "Geometria", system-ui, sans-serif; /* --font-family-primary */
    margin-bottom: 8px;
  }
  .details-row:last-child {
    margin-bottom: 0;
  }
  .details-label {
    color: #25282b; /* --text-primary */
    font-weight: 400;
  }
  .details-value {
    color: #25282b; /* --text-primary */
    font-weight: 400;
  }
  /* hide desktop-specific grid cells */
  .cart-item .item-warehouse,
  .cart-item .item-dimensions,
  .cart-item .item-area {
    display: none;
  }
  /* summary on mobile */
  .cart-summary {
    margin-top: 24px;
    justify-content: stretch;
  }
  .summary-card {
    width: 100%;
  }
}

/* desktop only : ensure consistent spacing */
@media (min-width: 767px) {
  .item-top-row,
  .mobile-price-row {
    display: contents;
  }
  .expand-link {
    display: none;
  }
  .cart-item .item-warehouse,
  .cart-item .item-dimensions,
  .cart-item .item-area {
    display: block;
  }
}

/* additional small fixes */
button {
  background: none;
  border: none;
  cursor: pointer;
}
img {
  max-width: 100%;
  display: block;
}

/* ---------- MAIN FORM STYLES (DESKTOP FIRST) ---------- */
.order-form {
  position: relative;
  margin: 0 auto;
  box-sizing: border-box;
  max-width: 1015px;
  width: 100%;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding-left: 20px;
  padding-right: 20px;
  margin-top: 60px;
}

.form-field {
  width: 100%;
  box-sizing: border-box;
}

.page-content input,
.page-content textarea {
  width: 100%;
  height: 48px;
  background: #ffffff;
  border: 1px solid #000000!important;
  font-family: "Geometria", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #000000!important;
  padding: 11px!important;
  outline: none;
  transition: all 0.2s ease;
  letter-spacing: 0!important;
  box-sizing: border-box;
}

.page-content input:focus,
.page-content textarea:focus {
  border-color: #252b2b!important;
  box-shadow: 0 0 0 1px rgba(37, 43, 43, 0.2);
}

.page-content input::placeholder,
.page-content textarea::placeholder {
  color: rgba(0, 0, 0, 0.6);
  font-weight: 400;
  opacity: 1;
}

textarea {
  height: 120px;
  resize: vertical;
  padding-top: 11px;
  padding-bottom: 11px;
  line-height: 1.4;
}


.row-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 21px;
  width: 100%;
}

.file-picker {
  position: relative;
  width: 100%;
  height: 48px;
  background: #ffffff;
  border: 1px solid #000000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 0 11px;
  cursor: pointer;
  transition: border 0.2s;
  box-sizing: border-box;
}

.file-picker:hover {
  border-color: #252b2b;
}

.file-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.file-label-text {
  font-family: "Geometria", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #000000;
  letter-spacing: 0;
  white-space: nowrap;
}

.file-name {
  font-family: "Geometria", system-ui, sans-serif;
  font-size: 12px;
  color: #555;
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
}

#realFileInput {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.checkbox-custom {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  cursor: pointer;
  font-family: "Geometria", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #252b2b;
  user-select: none;
  position: relative;
}

.checkbox-custom input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.checkmark-box {
  width: 18px;
  height: 18px;
  background: #252b2b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.checkmark-svg {
  width: 12px;
  height: 12px;
  display: block;
  opacity: 0;
  transition: opacity 0.1s ease;
}

.checkbox-custom input:checked ~ .checkmark-box .checkmark-svg {
  opacity: 1;
}

.page-content .submit-btn {
  background: #252b2b;
  border: none;
  padding: 0 100px;
  height: 50px;
  font-family: "Geometria", system-ui, sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-content .submit-btn:hover {
  opacity: 0.9;
}

.page-content .submit-btn:active {
  transform: scale(0.98);
}

.page-content input[type="tel"],
.page-content input[type="email"],
.page-content input[type="text"] {
  line-height: normal;
}

@media (max-width: 766px) {
  .order-form {
    max-width: 100%;
    gap: 20px;
  }

  .row-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .action-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .submit-btn {
    width: 100%;
    white-space: normal;
    text-align: center;
    padding: 0 34px;
    height: 45px;
    font-size: 10px;
  }

  .checkbox-custom {
    gap: 18px;
    align-items: flex-start;
  }

  .checkbox-custom span:last-child {
    line-height: 1.3;
  }

  .file-label-text {
    font-size: 14px;
    font-weight: 700;
  }

  .file-name {
    max-width: 100px;
  }

  textarea {
    height: 148px;
  }
}

@media (max-width: 480px) {
  .file-label-text {
    font-size: 13px;
  }

  .file-name {
    max-width: 70px;
    font-size: 10px;
  }

  .file-picker {
    padding: 0 8px;
  }
}

@media (min-width: 767px) {
  .action-row {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
  }
}

/* ========== SUCCESS MESSAGE STYLES ========== */
.order-success-message {
  text-align: center;
  padding: 60px 20px;
  max-width: 480px;
  margin: 0 auto;
}

.success-icon {
  margin-bottom: 24px;
}

.success-icon svg {
  width: 64px;
  height: 64px;
  display: inline-block;
}

.success-title {
  font-family: "Geometria", system-ui, sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #25282b;
  margin: 0 0 16px 0;
  line-height: 1.2;
}

.success-order-id {
  font-family: "Geometria", system-ui, sans-serif;
  font-size: 16px;
  color: #25282b;
  margin: 0 0 8px 0;
}

.success-order-id strong {
  color: #4caf50;
  font-weight: 700;
}

.success-text {
  font-family: "Geometria", system-ui, sans-serif;
  font-size: 14px;
  color: #898989;
  margin: 0 0 32px 0;
  line-height: 1.4;
}

.success-home-link {
  display: inline-block;
  font-family: "Geometria", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #25282b;
  text-decoration: none;
  border-bottom: 1px solid #25282b;
  padding-bottom: 2px;
  transition: opacity 0.2s, border-color 0.2s;
}

.success-home-link:hover {
  opacity: 0.7;
  border-color: transparent;
}

/* Mobile success styles */
@media (max-width: 766px) {
  .order-success-message {
    padding: 40px 16px;
  }
  
  .success-icon svg {
    width: 48px;
    height: 48px;
  }
  
  .success-title {
    font-size: 20px;
  }
  
  .success-order-id {
    font-size: 14px;
  }
  
  .success-text {
    font-size: 13px;
  }
}