/* Base Styles */
:root {
  --border-color: #e0e0e0;
  --bg-light: #fafafa;
  --bg: #fff;
  --shadow: 0 2px 6px rgba(0,0,0,.08);
  --primary: #f05025;
  --primary-hover: #d94119;
  --success: #28a745;
  --success-hover: #218838;
  --danger: #dc3545;
  --danger-hover: #c82333;
  --radius: 8px;
  --radius-sm: 6px;
  --pad: 24px;
  --pad-sm: 16px;
  --pad-xs: 12px;
  --pad-xxms: 18px;
  --pad-xxs: 25px;
}

.dokan-bundle-items-container {
  padding: var(--pad);
  background-color: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow-x: hidden;
}

.dokan-section-content {
  padding: var(--pad);
  background-color: var(--bg);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
}

.dokan-bundle-items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: var(--pad-xs);
  border-bottom: 1px solid var(--border-color);
}

.dokan-bundle-items-header h4 {font-size: 16px; font-weight: 600;}

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

.summost h4 {margin-left: 0; flex-grow: 1;}
.summost .dokan-add-bundle-product {margin-left: auto;}

.dokan-bundle-items-table {width: 100%; display: block;}
.dokan-bundle-items-table thead {display: block; margin-bottom: 16px;}
.dokan-bundle-items-table thead tr {
  display: flex;
  background-color: #f5f5f5;
  border-radius: var(--radius-sm);
  padding: 0 var(--pad-xs);
  font-size: 15px;
}

.dokan-bundle-items-table th, .dokan-bundle-items-table td {
  display: flex;
  align-items: center;
}

.dokan-bundle-items-table th {
  padding: 16px 0;
  font-weight: 600;
  color: #333;
  flex: 1;
}

.dokan-bundle-items-table th:first-child, .dokan-bundle-items-table td:first-child {
  text-align: left;
  flex: 3;
  justify-content: flex-start;
}

.dokan-bundle-items-table th:nth-child(2), .dokan-bundle-items-table td:nth-child(2) {
  text-align: center;
  flex: 2;
  justify-content: center;
}

.dokan-bundle-items-table th:last-child, .dokan-bundle-items-table td:last-child {
  text-align: right;
  flex: 1;
  justify-content: flex-end;
}

.dokan-bundle-items-table th:first-child {font-size: 19px; padding-left: 0;}
.dokan-bundle-items-table th:last-child {font-size: 19px; padding-right: 0;}
.dokan-bundle-items-table tbody {display: block;}

.dokan-bundle-items-table tbody tr {
  display: flex;
  background-color: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  align-items: center;
  min-height: 100px;
}

.dokan-bundle-items-table tbody tr:last-child {margin-bottom: 0;}
.dokan-bundle-items-table td {padding: 32px 0;}
.dokan-bundle-items-table td:first-child {padding-right: var(--pad);}
.dokan-bundle-items-table td:last-child {padding-left: var(--pad); white-space: nowrap;}

.bundle-product-info {
  display: flex;
  align-items: center;
  gap: var(--pad-xs);
  flex-grow: 1;
}

.bundle-product-info img {
  width: 60px; height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.bundle-product-title {
  font-weight: 600;
  font-size: 16px;
  color: #333;
  line-height: 1.3;
  flex-grow: 1;
  overflow-wrap: anywhere;
  text-align: left;
}

.bundle-product-type {
  font-size: 13px;
  color: #666;
  font-weight: 500;
  padding: 2px 8px;
  background-color: #f8f9fa;
  border-radius: 4px;
  display: inline-block;
  white-space: nowrap;
  margin-right: var(--pad-xxs);
}

.dokan-bundle-product-modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0,0,0,.6);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.dokan-bundle-product-modal.dokan-hide {display: none !important;}

.dokan-bundle-modal-content {
  background: var(--bg);
  width: 95%;
  max-width: 1100px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.dokan-bundle-modal-header, .dokan-bundle-modal-footer {
  padding: 20px;
  background-color: #f1f1f1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dokan-bundle-modal-body {
  padding: 20px;
  max-height: 450px;
  overflow-y: auto;
}

.dokan-bundle-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #777;
  border-radius: 8px;
  cursor: pointer;
  transition: color .2s;
}

.dokan-bundle-modal-close:hover {color: #222;}

.dokan-bundle-product-search {
  width: 100%;
  padding: var(--pad-xs);
  margin-bottom: var(--pad);
  border: 1px solid #ccc;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.dokan-bundle-selectable-products {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--pad-xxms);
}

.bundle-selectable-product {
  background: var(--bg);
  border: 1px solid #eee;
  padding: 16px;
  border-radius: var(--radius);
  transition: box-shadow .2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bundle-selectable-product:hover {box-shadow: 0 2px 8px rgba(0,0,0,.05);}

.dokan-btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.dokan-add-bundle-product {
  background-color: var(--primary);
  color: white;
  border: none;
  transition: background-color .3s;
}

.dokan-add-bundle-product:hover {background-color: var(--primary-hover);}
.add-to-bundle {background-color: var(--success); color: white; border: none; transition: background-color .3s;}
.add-to-bundle:hover {background-color: var(--success-hover);}

.remove-bundle-item {
  background-color: var(--danger);
  color: white;
  border: none;
  transition: background-color .3s;
  margin-left: auto;
  flex-shrink: 0;
}

.remove-bundle-item:hover {background-color: var(--danger-hover);}

.gdmart-bundle-alert {
  background-color: #e8f4fd;
  border-left: 4px solid #1e90ff;
  color: #31708f;
  padding: 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 16px;
}

.dokan-bundle-save-notice {
  background-color: #fff3cd;
  color: #856404;
  border-left: 4px solid #ffeeba;
  padding: var(--pad-xs) 15px;
  border-radius: 4px;
  margin: 10px 0;
  font-size: 14px;
  font-weight: 500;
}

.bundle-item-summost, .bundle-item {padding: 0 15px;}

  .dokan-bundle-items-table td[colspan] {
    justify-content: center;
    width: 100%;
    padding: 20px;
    text-align: center;
    min-height: 80px;
    font-size: 16px;
    color: #666;
  }

  .dokan-bundle-items-table td[colspan="3"] {
    justify-content: center;
    width: 100%;
    padding: 20px;
    text-align: center;
    min-height: 80px;
    font-size: 16px;
    color: #666;
  }

.show_if_simple.dokan-clearfix.show_if_external {
  display: block !important;
}

.dokan-product-attribute-wrapper {
  display: block !important;
}

select#product_type.product-type-locked {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: var(--bg);
}

.product-type-lock-notice {
  margin: 2px 0 0 0;
  padding: 2px 4px;
  background-color: #fff3cd;
  border-left: 1px solid #ffc107;
  color: #856404;
  font-size: 10px;
  border-radius: 1px;
  display: inline-block;
}



@media screen and (max-width: 768px) {
  :root {--pad: 16px;}
  .summost {flex-direction: column;}
  .dokan-bundle-items-table thead {display: none;}
  
  .dokan-bundle-items-table tbody tr {
    flex-direction: column;
    align-items: stretch;
    padding: var(--pad-xs);
  }
  
  .dokan-bundle-items-table td,
  .dokan-bundle-items-table td:first-child,
  .dokan-bundle-items-table td:nth-child(2),
  .dokan-bundle-items-table td:last-child {
    flex: 1 1 100%;
    justify-content: space-between;
    padding: 8px 0;
    text-align: left;
    border-bottom: 1px solid #eee;
  }
  
  .bundle-product-title {font-size: 13px;}
  .remove-bundle-item {margin-top: 10px; align-self: flex-end; width: 100%;}
  .dokan-btn-sm, .bundle-selectable-product .add-to-bundle {width: 100%; text-align: center;}
  .dokan-bundle-modal-content {width: 95%; max-width: none;}
  .dokan-bundle-modal-body {max-height: 300px;}
  .dokan-bundle-items-table td[colspan] {font-size: 14px; padding: 16px;}
  
  .bundle-selectable-product,
  .dokan-bundle-selectable-products .bundle-selectable-product {
    display: grid;
    grid-template-columns: 1fr; 
    gap: var(--pad-xs);
    align-items: start; 
  }
  
  .dokan-bundle-selectable-products {padding: 0 15px;}

  .dokan-bundle-products-list .bundle-product-info {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "img title type"
      "button button button";
    gap: var(--pad-xs);
    align-items: center;
  }

  .dokan-bundle-products-list .bundle-product-info img {
    grid-area: img;
  }

  .dokan-bundle-products-list .bundle-product-info .bundle-product-title {
    grid-area: title;
  }

  .dokan-bundle-products-list .bundle-product-info .bundle-product-type {
    grid-area: type;
    justify-self: end;
    margin-right: 0; 
    font-size: 12px;
    padding: 2px 6px;
  }

  .dokan-bundle-products-list .bundle-product-info .add-to-bundle {
    grid-area: button;
    width: 100%;
  }

  .bundle-product-type {
    margin-top: 10px;
    margin-bottom: 10px;
  }
  
}

