/* ==========================================================
   OWNER AREA
========================================================== */

.owner-area {
  min-height: 75vh;

  padding: 35px 0;

  background: #f6f7f9;
}

.owner-page-header {
  display: flex;

  justify-content: space-between;

  align-items: center;

  gap: 20px;

  margin-bottom: 25px;
}

.owner-page-header h1 {
  margin-bottom: 5px;

  font-size: 30px;

  font-weight: 700;
}

.owner-page-header p {
  margin: 0;

  color: var(--muted);
}

/* ==========================================================
   SIDEBAR
========================================================== */

.owner-sidebar {
  position: sticky;

  top: 90px;

  overflow: hidden;

  background: #ffffff;

  border: 1px solid var(--border);

  border-radius: 18px;
}

.owner-sidebar-brand {
  display: flex;

  align-items: center;

  gap: 12px;

  padding: 20px;

  border-bottom: 1px solid var(--border);
}

.owner-sidebar-brand > div:last-child {
  display: flex;

  flex-direction: column;
}

.owner-sidebar-brand small {
  color: var(--muted);
}

.owner-shop-icon {
  width: 45px;

  height: 45px;

  display: flex;

  align-items: center;

  justify-content: center;

  border-radius: 12px;

  background: #fff1f3;

  font-size: 23px;
}

.owner-menu {
  padding: 10px;
}

.owner-menu a {
  display: flex;

  align-items: center;

  gap: 12px;

  padding: 11px 13px;

  margin-bottom: 3px;

  border-radius: 10px;

  color: var(--text);

  text-decoration: none;
}

.owner-menu a:hover {
  background: #f7f7f7;

  color: var(--primary);
}

.owner-menu a.active {
  background: #fff1f3;

  color: var(--primary-dark);

  font-weight: 600;
}

.owner-menu-label {
  padding: 18px 13px 7px;

  color: #999;

  font-size: 11px;

  font-weight: 700;

  letter-spacing: 0.6px;
}

/* ==========================================================
   CARD
========================================================== */

.owner-card {
  padding: 22px;

  background: #ffffff;

  border: 1px solid var(--border);

  border-radius: 18px;
}

.owner-card h2 {
  margin-bottom: 18px;

  font-size: 20px;

  font-weight: 700;
}

.owner-card-header {
  display: flex;

  justify-content: space-between;

  align-items: center;

  gap: 20px;

  margin-bottom: 18px;
}

.owner-card-header h2 {
  margin: 0;
}

.owner-card-header a {
  color: var(--primary-dark);

  text-decoration: none;

  font-weight: 600;
}

/* ==========================================================
   DASHBOARD
========================================================== */

.owner-revenue-card {
  display: flex;

  flex-direction: column;

  padding: 25px;

  border-radius: 18px;

  background: #ffffff;

  border: 1px solid var(--border);
}

.owner-revenue-card span {
  color: var(--muted);
}

.owner-revenue-card strong {
  margin-top: 6px;

  color: var(--primary-dark);

  font-size: 30px;
}

.owner-stat-card {
  height: 100%;

  display: flex;

  flex-direction: column;

  padding: 20px;

  border: 1px solid var(--border);

  border-radius: 18px;

  background: #ffffff;
}

.owner-stat-card i {
  margin-bottom: 12px;

  color: var(--primary);

  font-size: 22px;
}

.owner-stat-card strong {
  font-size: 26px;
}

.owner-stat-card span {
  color: var(--muted);

  font-size: 14px;
}

/* ==========================================================
   TABLE
========================================================== */

.owner-table {
  margin-bottom: 0;
}

.owner-table thead th {
  color: #777;

  font-size: 13px;

  font-weight: 600;

  white-space: nowrap;
}

.owner-table td {
  vertical-align: middle;
}

/* ==========================================================
   PRODUCT CELL
========================================================== */

.owner-product-cell {
  display: flex;

  align-items: center;

  gap: 12px;

  min-width: 230px;
}

.owner-product-cell > div:last-child {
  display: flex;

  flex-direction: column;
}

.owner-product-image {
  width: 55px;

  height: 55px;

  flex: 0 0 55px;

  display: flex;

  align-items: center;

  justify-content: center;

  overflow: hidden;

  border-radius: 10px;

  background: #f7f7f7;
}

.owner-product-image img {
  width: 100%;

  height: 100%;

  object-fit: cover;
}

/* ==========================================================
   PRODUCT GALLERY
========================================================== */

.owner-product-gallery {
  display: grid;

  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));

  gap: 12px;
}

.owner-product-gallery-item {
  position: relative;

  overflow: hidden;

  aspect-ratio: 1 / 1;

  border: 1px solid var(--border);

  border-radius: 12px;
}

.owner-product-gallery-item img {
  width: 100%;

  height: 100%;

  object-fit: cover;
}

.owner-product-gallery-item form {
  position: absolute;

  top: 6px;

  right: 6px;
}

/* ==========================================================
   RESPONSIVE
========================================================== */

@media (max-width: 991.98px) {
  .owner-sidebar {
    position: static;
  }

  .owner-menu {
    display: flex;

    overflow-x: auto;
  }

  .owner-menu-label {
    display: none;
  }

  .owner-menu a {
    flex: 0 0 auto;
  }
}

@media (max-width: 575.98px) {
  .owner-area {
    padding: 25px 0;
  }

  .owner-page-header {
    align-items: flex-start;

    flex-direction: column;
  }

  .owner-page-header h1 {
    font-size: 25px;
  }

  .owner-card {
    padding: 17px;
  }
}
/* ==========================================================
   OWNER ORDER STATUS
========================================================== */

.owner-order-status {
  display: inline-block;

  padding: 7px 11px;

  border-radius: 999px;

  font-size: 13px;

  font-weight: 600;
}

.owner-order-status.status-pending {
  background: #fff4c7;
  color: #8a6500;
}

.owner-order-status.status-confirmed {
  background: #e7efff;
  color: #3156a3;
}

.owner-order-status.status-packing {
  background: #f1e8ff;
  color: #7048a8;
}

.owner-order-status.status-shipping {
  background: #ddf7fc;
  color: #166d82;
}

.owner-order-status.status-completed {
  background: #e3f5e8;
  color: #137333;
}

.owner-order-status.status-cancelled {
  background: #fde6e8;
  color: #a02b37;
}

/* ==========================================================
   ORDER ITEM
========================================================== */

.owner-order-item {
  display: flex;

  justify-content: space-between;

  gap: 20px;

  padding: 14px 0;

  border-bottom: 1px solid var(--border);
}

.owner-order-item > div {
  display: flex;

  flex-direction: column;

  gap: 3px;
}

.owner-order-item small {
  color: var(--muted);
}

/* ==========================================================
   MONEY
========================================================== */

.owner-money-row,
.owner-order-total {
  display: flex;

  justify-content: space-between;

  gap: 20px;

  padding: 8px 0;
}

.owner-order-total {
  margin-top: 8px;

  font-size: 20px;
}

.owner-order-total strong {
  color: var(--primary-dark);

  font-size: 25px;
}

/* ==========================================================
   INFO
========================================================== */

.owner-info-row {
  display: flex;

  justify-content: space-between;

  gap: 20px;

  padding: 9px 0;

  border-bottom: 1px solid var(--border);
}

.owner-info-row:last-child {
  border-bottom: 0;
}

/* ==========================================================
   ORDER TIMELINE
========================================================== */

.owner-order-timeline {
  padding-left: 10px;
}

.owner-timeline-item {
  position: relative;

  display: grid;

  grid-template-columns: 20px 1fr;

  gap: 12px;

  padding-bottom: 24px;
}

.owner-timeline-item::before {
  content: "";

  position: absolute;

  top: 15px;

  left: 6px;

  width: 2px;

  height: 100%;

  background: var(--border);
}

.owner-timeline-item:last-child::before {
  display: none;
}

.owner-timeline-dot {
  position: relative;

  z-index: 1;

  width: 14px;

  height: 14px;

  margin-top: 4px;

  border: 3px solid #ffffff;

  border-radius: 50%;

  background: var(--primary);

  box-shadow: 0 0 0 2px var(--primary);
}

.owner-timeline-item > div {
  display: flex;

  flex-direction: column;
}

.owner-timeline-item small {
  color: var(--muted);
}

.owner-timeline-item p {
  margin: 5px 0 0;

  color: #555;
}

@media (max-width: 575.98px) {
  .owner-order-item {
    flex-direction: column;

    gap: 8px;
  }
}
/* ==========================================================
   OWNER CUSTOMER
========================================================== */

.owner-customer-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.owner-customer-cell > div:last-child {
  display: flex;
  flex-direction: column;
}

.owner-customer-cell small {
  color: var(--muted);
}

.owner-customer-avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  border-radius: 50%;

  background: #fff1f3;
  color: var(--primary);

  font-size: 20px;
}

.owner-customer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.owner-customer-address {
  padding: 14px 0;

  border-bottom: 1px solid var(--border);
}

.owner-customer-address:last-child {
  border-bottom: 0;
}

.owner-customer-address small {
  display: block;

  margin-top: 5px;

  color: var(--muted);
}

.owner-customer-address p {
  margin: 5px 0 0;
}

/* ==========================================================
   PROMOTION
========================================================== */

.promotion-code {
  display: inline-block;

  padding: 7px 11px;

  border: 1px dashed var(--primary);

  border-radius: 8px;

  background: #fff5f6;

  color: var(--primary-dark);

  font-weight: 700;

  letter-spacing: 0.5px;
}

.promotion-status {
  display: inline-block;

  padding: 6px 10px;

  border-radius: 999px;

  background: #f1f1f3;

  font-size: 13px;

  font-weight: 600;
}
/* ==========================================================
   OWNER POSTS
========================================================== */

.owner-post-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
}

.owner-post-image {
  width: 70px;
  height: 55px;
  flex: 0 0 70px;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  border-radius: 10px;

  background: #f3f3f5;

  font-size: 21px;
}

.owner-post-image img {
  width: 100%;
  height: 100%;

  object-fit: cover;
}

.post-status {
  display: inline-block;

  padding: 6px 10px;

  border-radius: 999px;

  font-size: 13px;
  font-weight: 600;
}

.post-status-draft {
  background: #eeeeef;
  color: #555;
}

.post-status-published {
  background: #e3f5e8;
  color: #137333;
}

.post-status-hidden {
  background: #fde6e8;
  color: #a02b37;
}

.owner-post-editor {
  min-height: 420px;

  line-height: 1.7;
}

.owner-post-featured-preview {
  max-width: 500px;

  overflow: hidden;

  border-radius: 14px;
}

.owner-post-featured-preview img {
  width: 100%;
  display: block;
}

/* ==========================================================
   OWNER GALLERY
========================================================== */

.owner-gallery-grid {
  display: grid;

  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));

  gap: 20px;
}

.owner-gallery-card {
  overflow: hidden;

  background: #ffffff;

  border: 1px solid var(--border);

  border-radius: 18px;
}

.owner-gallery-card-image {
  position: relative;

  aspect-ratio: 4 / 3;

  overflow: hidden;

  background: #f5f5f5;
}

.owner-gallery-card-image img {
  width: 100%;
  height: 100%;

  object-fit: cover;

  transition: transform 0.25s ease;
}

.owner-gallery-card:hover .owner-gallery-card-image img {
  transform: scale(1.035);
}

.owner-gallery-hidden {
  position: absolute;

  top: 10px;
  left: 10px;

  padding: 5px 9px;

  border-radius: 999px;

  background: rgba(0, 0, 0, 0.75);

  color: #ffffff;

  font-size: 12px;
}

.owner-gallery-card-body {
  padding: 17px;
}

.owner-gallery-card-body h3 {
  margin-bottom: 4px;

  font-size: 17px;
}

.owner-gallery-card-body small {
  color: var(--primary-dark);

  font-weight: 600;
}

.owner-gallery-card-body p {
  min-height: 42px;

  margin: 10px 0 15px;

  color: var(--muted);

  font-size: 14px;
}

@media (max-width: 575.98px) {
  .owner-gallery-grid {
    grid-template-columns: repeat(2, 1fr);

    gap: 10px;
  }

  .owner-gallery-card-body {
    padding: 12px;
  }
}
/* ==========================================================
   OWNER REVIEW
========================================================== */

.owner-review-list {
  display: grid;

  gap: 16px;
}

.owner-review-header {
  display: flex;

  justify-content: space-between;

  align-items: flex-start;

  gap: 20px;
}

.owner-review-header > div:first-child {
  display: flex;

  flex-direction: column;
}

.owner-review-header small {
  color: var(--muted);
}

.owner-review-comment {
  margin: 18px 0;

  font-size: 15px;

  line-height: 1.7;
}

.owner-review-existing-reply {
  padding: 15px;

  border-radius: 12px;

  background: #fff5f6;
}

/* ==========================================================
   CONTACT
========================================================== */

.contact-status {
  display: inline-block;

  padding: 6px 10px;

  border-radius: 999px;

  font-size: 13px;

  font-weight: 600;
}

.contact-status-new {
  background: #fde6e8;

  color: #a02b37;
}

.contact-status-reading {
  background: #fff4c7;

  color: #8a6500;
}

.contact-status-replied {
  background: #e7efff;

  color: #3156a3;
}

.contact-status-closed {
  background: #e3f5e8;

  color: #137333;
}

.contact-message {
  min-height: 180px;

  padding: 20px;

  border-radius: 14px;

  background: #f8f8fa;

  line-height: 1.8;
}
/* ==========================================================
   SHOP SETTINGS
========================================================== */

.owner-shop-logo-preview {
  width: 180px;
  height: 180px;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  border: 1px solid var(--border);
  border-radius: 18px;

  background: #ffffff;
}

.owner-shop-logo-preview img {
  width: 100%;
  height: 100%;

  object-fit: contain;

  padding: 10px;
}

.owner-shop-logo-empty {
  width: 180px;
  height: 180px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 2px dashed var(--border);
  border-radius: 18px;

  background: #f8f8fa;

  font-size: 55px;
}

.shop-map-preview {
  overflow: hidden;

  border: 1px solid var(--border);
  border-radius: 16px;
}

.shop-map-preview iframe {
  width: 100%;
  height: 350px;

  display: block;

  border: 0;
}

/* ==========================================================
   SHARED OWNER APPLICATION LAYOUT
   The direct sidebar used to inherit Bootstrap's .row > * width: 100%.
   These rules keep every existing Owner view in a stable two-column shell.
========================================================== */

.owner-area {
  min-height: calc(100vh - 76px);
  padding: 24px 0 40px;
}

.owner-area > .container-fluid {
  padding-right: 24px;
  padding-left: 24px;
}

.owner-layout,
.owner-area > .container-fluid > .row {
  align-items: flex-start;
}

.owner-layout {
  display: flex;
  min-height: calc(100vh - 124px);
  gap: 24px;
}

.owner-layout > .owner-sidebar,
.owner-area > .container-fluid > .row > .owner-sidebar,
.owner-area > .container-fluid > .row > div:has(> .owner-sidebar) {
  width: 240px;
  max-width: 240px;
  flex: 0 0 240px;
  padding-right: 0;
  padding-left: 0;
}

.owner-layout > .owner-main,
.owner-area > .container-fluid > .row > section:not(.owner-sidebar),
.owner-area > .container-fluid > .row > div:not(:has(> .owner-sidebar)) {
  min-width: 0;
  max-width: none;
  flex: 1 1 0;
}

.owner-main {
  min-width: 0;
  flex: 1;
  padding: 24px;
}

.owner-area > .container-fluid > .row > section.col-lg-9,
.owner-area > .container-fluid > .row > section.col-xl-10 {
  width: auto;
}

.owner-sidebar {
  top: 88px;
  height: calc(100vh - 112px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: var(--radius);
}

.owner-sidebar-brand {
  position: relative;
}

.sidebar-toggle {
  display: none;
  width: 38px;
  height: 38px;
  margin-left: auto;
  border: 0;
  border-radius: 10px;
  background: #fff1f3;
  color: var(--primary-dark);
  font-size: 20px;
}

.owner-menu {
  display: flex;
  min-height: calc(100% - 86px);
  flex-direction: column;
}

.owner-menu a {
  min-height: 44px;
}

.owner-menu-logout {
  margin-top: auto;
  color: #a02b37 !important;
}

.owner-menu-logout:hover {
  background: #fff4f5 !important;
}

.owner-form-card {
  max-width: 1120px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

@media (max-width: 991.98px) {
  .owner-area > .container-fluid {
    padding-right: 16px;
    padding-left: 16px;
  }

  .owner-layout,
  .owner-area > .container-fluid > .row {
    gap: 14px;
  }

  .owner-layout,
  .owner-area > .container-fluid > .row {
    display: flex;
    flex-direction: column;
  }

  .owner-layout > .owner-sidebar,
  .owner-area > .container-fluid > .row > .owner-sidebar,
  .owner-area > .container-fluid > .row > div:has(> .owner-sidebar) {
    width: 100%;
    max-width: none;
    flex-basis: auto;
    position: relative;
    top: auto;
    height: auto;
    overflow: visible;
  }

  .owner-layout > .owner-main,
  .owner-area > .container-fluid > .row > section:not(.owner-sidebar),
  .owner-area > .container-fluid > .row > div:not(:has(> .owner-sidebar)) {
    width: 100%;
    flex-basis: auto;
  }

  .owner-main {
    padding: 4px 0 0;
  }

  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .owner-menu {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    display: none;
    min-height: 0;
    max-height: min(70vh, 520px);
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 16px 36px rgba(40, 20, 25, 0.14);
  }

  .owner-sidebar.is-open .owner-menu {
    display: flex;
  }
}

@media (max-width: 575.98px) {
  .owner-form-card {
    padding: 18px;
  }
}

/* ==========================================================
   OWNER MOBILE LAYOUT FIX
   Fix sidebar keeping desktop viewport height on mobile.
========================================================== */

@media (max-width: 991.98px) {
  .owner-area {
    min-height: auto;
    padding: 16px 0 28px;
  }

  .owner-area > .container-fluid {
    padding-right: 12px;
    padding-left: 12px;
  }

  .owner-layout,
  .owner-area > .container-fluid > .row {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  /* Wrapper that contains owner-sidebar */
  .owner-layout > .owner-sidebar,
  .owner-area > .container-fluid > .row > .owner-sidebar,
  .owner-area > .container-fluid > .row > div:has(> .owner-sidebar) {
    width: 100%;
    max-width: 100%;
    flex: 0 0 auto;
    padding-right: 0;
    padding-left: 0;
  }

  /*
   * IMPORTANT:
   * .owner-sidebar itself previously kept:
   * height: calc(100vh - 112px)
   * even when it was nested inside a Bootstrap column.
   * That created the large blank white block on mobile.
   */
  .owner-sidebar {
    position: relative !important;
    top: auto !important;

    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;

    overflow: visible !important;
    overscroll-behavior: auto;

    border-radius: 14px;
  }

  .owner-sidebar-brand {
    min-height: 58px;
    padding: 10px 12px;
    border-bottom: 0;
  }

  .owner-shop-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    padding: 5px;
    border-radius: 10px;
  }

  .owner-shop-info small {
    font-size: 12px;
  }

  .owner-shop-info strong {
    font-size: 14px;
  }

  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;

    flex: 0 0 36px;
  }

  /* Dropdown menu below the compact Owner header */
  .owner-menu {
    position: absolute;
    z-index: 1050;

    top: calc(100% + 8px);
    right: 0;
    left: 0;

    display: none;

    min-height: 0 !important;
    max-height: min(70vh, 520px);

    padding: 10px;

    overflow-x: hidden;
    overflow-y: auto;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: #fff;

    box-shadow: 0 16px 36px rgba(40, 20, 25, 0.14);
  }

  .owner-sidebar.is-open .owner-menu {
    display: flex;
    flex-direction: column;
  }

  .owner-menu a,
  .owner-menu-logout {
    width: 100%;
    flex: 0 0 auto;
  }

  /* Main Owner content must appear immediately after sidebar */
  .owner-layout > .owner-main,
  .owner-area > .container-fluid > .row > section:not(.owner-sidebar),
  .owner-area > .container-fluid > .row > div:not(:has(> .owner-sidebar)) {
    width: 100%;
    max-width: 100%;
    flex: 0 0 auto;
    min-width: 0;
  }

  .owner-main {
    padding: 0;
  }
}

@media (max-width: 575.98px) {
  .owner-page-header {
    margin-bottom: 18px;
  }

  .owner-page-header > .d-flex,
  .owner-page-header > div.d-flex {
    width: 100%;
  }

  .owner-page-header > .d-flex .btn,
  .owner-page-header > div.d-flex .btn {
    flex: 1 1 auto;
  }

  .owner-card {
    padding: 16px;
    border-radius: 14px;
  }

  .owner-table,
  .table {
    font-size: 14px;
  }
}

