/* ==========================================================================
   Default theme — MultiTenantProject marketplace
   --------------------------------------------------------------------------
   This file is the DEFAULT THEME. Phase 5 themes override these variables;
   do not hard-code colors in views — use the --mp-* variables below and
   Bootstrap's --bs-* variables. Plain CSS on top of Bootstrap, no build step.

   Palette (Digikala/Amazon-style marketplace):
     brand   teal    #0e7490  — header, primary buttons, links, active states
     accent  orange  #ea580c  — price, add-to-cart CTA, the eye-catcher
     success #15803d  warning #b45309  danger #b91c1c  info #0369a1
   Direction: use logical properties (margin-inline, padding-inline,
   inset-inline, border-inline-start) where direction matters so the theme
   works in RTL (fa, ar) and LTR (en).
   ========================================================================== */

:root {
    /* -- Brand palette ------------------------------------------------ */
    --mp-brand: #0e7490;
    --mp-brand-dark: #155e75;
    --mp-brand-darker: #164e63;
    --mp-brand-soft: #ecfeff;
    --mp-accent: #ea580c;
    --mp-accent-dark: #c2410c;
    --mp-accent-soft: #fff7ed;
    --mp-success: #15803d;
    --mp-warning: #b45309;
    --mp-danger: #b91c1c;
    --mp-info: #0369a1;
    --mp-ink: #1f2937;
    --mp-muted: #6b7280;
    --mp-bg: #f6f7f9;
    --mp-surface: #ffffff;
    --mp-border: #e5e7eb;
    --mp-footer-bg: #0f172a;
    --mp-footer-text: #cbd5e1;

    /* -- Shape / depth ------------------------------------------------- */
    --mp-radius: .75rem;
    --mp-radius-sm: .5rem;
    --mp-shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
    --mp-shadow: 0 4px 16px rgba(16, 24, 40, .08);
    --mp-shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);

    /* -- Bootstrap re-theme (Bootstrap 5.3 components read these) ----- */
    --bs-primary: #0e7490;
    --bs-primary-rgb: 14, 116, 144;
    --bs-link-color: #0e7490;
    --bs-link-hover-color: #155e75;
    --bs-success: #15803d;
    --bs-warning: #b45309;
    --bs-danger: #b91c1c;
    --bs-info: #0369a1;
    --bs-body-bg: #f6f7f9;
    --bs-body-color: #1f2937;
    --bs-border-color: #e5e7eb;
    --bs-font-sans-serif: "Segoe UI", Tahoma, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

/* ==========================================================================
   Base
   ========================================================================== */

html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--mp-bg);
    color: var(--mp-ink);
}

/* The page content grows so the footer sticks to the bottom. */
.mp-main-wrap {
    flex: 1 0 auto;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.25rem var(--mp-brand);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

a {
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Section / page headings */
.mp-page-title {
    font-weight: 700;
    margin-bottom: 1rem;
}

.mp-section-title {
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

/* ==========================================================================
   Header — marketplace header: utility topbar, brand bar, nav row
   ========================================================================== */

.mp-header {
    background: var(--mp-surface);
    border-bottom: 1px solid var(--mp-border);
    box-shadow: var(--mp-shadow-sm);
}

/* Utility strip: language switcher + account. */
.mp-topbar {
    background: var(--mp-surface);
    border-bottom: 1px solid var(--mp-border);
    font-size: .875rem;
    padding-block: .25rem;
}

.mp-topbar .nav-link {
    padding-block: .25rem;
}

/* Brand bar: dark teal, brand + prominent search + cart. */
.mp-mainbar {
    background: var(--mp-brand-darker);
    color: #fff;
    padding-block: .75rem;
}

.mp-brand {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.mp-brand:hover {
    color: #fff;
    text-decoration: none;
}

.mp-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--mp-radius-sm);
    background: var(--mp-accent);
    color: #fff;
    flex: 0 0 auto;
}

.mp-brand-mark svg {
    width: 1.35rem;
    height: 1.35rem;
}

/* Tenant store logo (Phase 5 themes): replaces the SVG brand mark in the
   header when the tenant set a LogoUrl. Sized to match the mark. */
.mp-brand-logo {
    height: 2.25rem;
    width: auto;
    max-width: 12rem;
    object-fit: contain;
    border-radius: var(--mp-radius-sm);
    flex: 0 0 auto;
}

/* Theme picker swatches (Phase 5): the dot shape/size. The dot color
   itself comes from the theme data, set inline on the element
   (background-color), because it is data, not a fixed style. */
.mp-theme-swatch {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: 1px solid var(--mp-border);
    vertical-align: middle;
    margin-inline-end: .25rem;
}

/* Logo preview on the theme page (Phase 5, part 2): the seller's logo
   at a readable size, contained like the header brand logo. */
.mp-logo-preview {
    max-height: 4rem;
    max-width: 16rem;
    width: auto;
    object-fit: contain;
    border: 1px solid var(--mp-border);
    border-radius: var(--mp-radius-sm);
    background: var(--mp-surface);
}

/* Prominent search: full width on mobile, grows on desktop. */
.mp-search .form-control {
    border: none;
    border-start-start-radius: var(--mp-radius-sm);
    border-start-end-radius: 0;
    border-end-start-radius: var(--mp-radius-sm);
    border-end-end-radius: 0;
    padding-block: .6rem;
}

.mp-search .form-control:focus {
    box-shadow: none;
}

.mp-search .btn {
    border-start-start-radius: 0;
    border-start-end-radius: var(--mp-radius-sm);
    border-end-start-radius: 0;
    border-end-end-radius: var(--mp-radius-sm);
}

.mp-cart-link {
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-weight: 600;
    white-space: nowrap;
    padding: .4rem .5rem;
    border-radius: var(--mp-radius-sm);
}

.mp-cart-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .12);
    text-decoration: none;
}

.mp-cart-link svg {
    width: 1.35rem;
    height: 1.35rem;
    flex: 0 0 auto;
}

/* Nav row under the brand bar. */
.mp-nav {
    background: var(--mp-surface);
}

.mp-nav .nav-link {
    color: var(--mp-ink);
    font-weight: 600;
    padding-block: .65rem;
    padding-inline: .9rem;
}

.mp-nav .nav-link:hover,
.mp-nav .nav-link:focus {
    color: var(--mp-brand);
}

.mp-nav .nav-link.active {
    color: var(--mp-brand);
    box-shadow: inset 0 -3px 0 var(--mp-brand);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

/* Orange CTA (add to cart, main purchase action) built on Bootstrap's
   button variables so hover/active/disabled states match. */
.btn-accent {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--mp-accent);
    --bs-btn-border-color: var(--mp-accent);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--mp-accent-dark);
    --bs-btn-hover-border-color: var(--mp-accent-dark);
    --bs-btn-focus-shadow-rgb: 234, 88, 12;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--mp-accent-dark);
    --bs-btn-active-border-color: var(--mp-accent-dark);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: var(--mp-accent);
    --bs-btn-disabled-border-color: var(--mp-accent);
}

/* ==========================================================================
   Product cards (listing, search, similar / same-brand)
   ========================================================================== */

.mp-product-card {
    border: 1px solid var(--mp-border);
    border-radius: var(--mp-radius);
    overflow: hidden;
    background: var(--mp-surface);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.mp-product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--mp-shadow);
    border-color: #cbd5e1;
}

.mp-product-card .card-img-top {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #f1f5f9;
}

.mp-product-card .card-body {
    padding: .9rem 1rem 1rem;
}

.mp-product-card .card-title {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: .5rem;
}

.mp-product-card .card-title a {
    color: var(--mp-ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mp-product-card .card-title a:hover {
    color: var(--mp-brand);
    text-decoration: none;
}

.mp-product-card .card-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* -- Price ------------------------------------------------------------ */
/* Accent (orange) price; the "from" label stays small and muted. */
.mp-price {
    color: var(--mp-accent);
    font-weight: 700;
    font-size: 1.125rem;
    line-height: 1.4;
}

.mp-price .mp-price-from {
    font-size: .8125rem;
    font-weight: 400;
    color: var(--mp-muted);
}

.mp-price .mp-price-currency {
    font-size: .875rem;
    font-weight: 400;
    color: var(--mp-muted);
}

.mp-price-lg {
    font-size: 1.6rem;
}

.mp-offer-count {
    color: var(--mp-muted);
    font-size: .875rem;
}

/* Offer-count / status pills on cards and tables. */
.mp-badge-offer {
    background: var(--mp-brand-soft);
    color: var(--mp-brand-dark);
    border: 1px solid #a5f3fc;
    font-weight: 600;
}

/* ==========================================================================
   Filters (category sidebar) + chips
   ========================================================================== */

.mp-filter-card {
    border: 1px solid var(--mp-border);
    border-radius: var(--mp-radius);
    background: var(--mp-surface);
    position: sticky;
    top: 1rem;
}

.mp-filter-card fieldset legend {
    font-weight: 600;
}

.mp-chip {
    border-radius: 999px;
    padding-inline: .9rem;
}

/* ==========================================================================
   Product page — gallery, price block, offers table, tabs
   ========================================================================== */

.mp-gallery-main {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--mp-radius);
    border: 1px solid var(--mp-border);
    background: #f1f5f9;
}

.mp-gallery-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    cursor: pointer;
    border-radius: var(--mp-radius-sm);
    border: 2px solid transparent;
    background: #f1f5f9;
}

.mp-gallery-thumb:hover,
.mp-gallery-thumb.mp-active {
    border-color: var(--mp-brand);
}

.mp-no-image {
    min-height: 240px;
    border-radius: var(--mp-radius);
    border: 1px dashed var(--mp-border);
    color: var(--mp-muted);
}

.mp-price-block {
    background: var(--mp-surface);
    border: 1px solid var(--mp-border);
    border-radius: var(--mp-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.mp-qty-input {
    width: 80px;
    text-align: center;
}

/* Notice that replaces commerce when the store service is inactive. */
.mp-alert-strong {
    border-inline-start: 4px solid var(--mp-accent);
}

/* Offers comparison table (sellers tab): price column emphasized. */
.mp-offers-table td.mp-offer-price {
    color: var(--mp-accent);
    font-weight: 700;
    white-space: nowrap;
}

.mp-spec-name {
    width: 30%;
    background: var(--mp-bg);
}

/* ==========================================================================
   Tables (cart, dashboard, settings, subscription)
   ========================================================================== */

.mp-table {
    background: var(--mp-surface);
    border-radius: var(--mp-radius);
    overflow: hidden;
}

.mp-table > :not(caption) > * > * {
    padding: .75rem .9rem;
}

.mp-table thead th {
    background: var(--mp-bg);
    color: var(--mp-muted);
    font-size: .875rem;
    font-weight: 600;
    border-bottom: 1px solid var(--mp-border);
    white-space: nowrap;
}

.mp-table tfoot th,
.mp-table tfoot td {
    font-weight: 700;
    background: var(--mp-bg);
}

.mp-table .mp-grand-total {
    color: var(--mp-accent);
    font-size: 1.125rem;
    white-space: nowrap;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.form-control:focus,
.form-select:focus {
    border-color: var(--mp-brand);
    box-shadow: 0 0 0 .25rem rgba(14, 116, 144, .25);
}

.mp-panel {
    background: var(--mp-surface);
    border: 1px solid var(--mp-border);
    border-radius: var(--mp-radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.mp-panel-title {
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Search page form widths (replaces inline styles). */
.mp-search-form {
    max-width: 560px;
}

.mp-search-sort {
    max-width: 160px;
}

/* ==========================================================================
   Dashboard
   ========================================================================== */

.mp-dash-section {
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.mp-dash-card {
    border: 1px solid var(--mp-border);
    border-top: 4px solid var(--mp-brand);
    border-radius: var(--mp-radius);
    background: var(--mp-surface);
    box-shadow: var(--mp-shadow-sm);
}

.mp-dash-card--admin {
    border-top-color: var(--mp-brand);
}

.mp-dash-card--seller {
    border-top-color: var(--mp-success);
}

.mp-dash-card--shop {
    border-top-color: var(--mp-info);
}

.mp-dash-card .card-body {
    display: flex;
    flex-direction: column;
}

.mp-dash-card .card-title {
    font-weight: 700;
}

.mp-dash-card .btn {
    margin-top: auto;
    align-self: flex-start;
}

/* ==========================================================================
   Home hero
   ========================================================================== */

.mp-hero {
    background: linear-gradient(135deg, var(--mp-brand-darker), var(--mp-brand));
    color: #fff;
    border-radius: var(--mp-radius);
    padding: 2.5rem 2rem;
    margin-bottom: 1.5rem;
}

.mp-hero h1 {
    font-weight: 800;
}

.mp-hero p {
    color: rgba(255, 255, 255, .85);
}

.mp-hero .mp-search .form-control {
    border: none;
}

.mp-hero .mp-search .form-control:focus {
    box-shadow: none;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.mp-footer {
    background: var(--mp-footer-bg);
    color: var(--mp-footer-text);
    margin-top: 2.5rem;
    padding: 2rem 0 0;
}

.mp-footer a {
    color: #e2e8f0;
}

.mp-footer a:hover {
    color: #fff;
}

.mp-footer-title {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: .75rem;
}

.mp-footer .nav-link {
    color: var(--mp-footer-text);
    padding-inline: 0;
    padding-block: .2rem;
}

.mp-footer .nav-link:hover {
    color: #fff;
}

.mp-enamad-badge {
    display: inline-block;
    color: #e2e8f0;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: var(--mp-radius-sm);
    padding: .5rem .9rem;
    font-size: .875rem;
}

.mp-enamad-badge:hover {
    color: #fff;
    text-decoration: none;
    border-color: rgba(255, 255, 255, .45);
}

.mp-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .12);
    margin-top: 1.5rem;
    padding-block: .9rem;
    font-size: .875rem;
    color: #94a3b8;
}

/* ==========================================================================
   Empty states
   ========================================================================== */

.mp-empty {
    background: var(--mp-surface);
    border: 1px dashed var(--mp-border);
    border-radius: var(--mp-radius);
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--mp-muted);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 575.98px) {
    .mp-brand {
        font-size: 1.25rem;
    }

    .mp-hero {
        padding: 1.75rem 1.25rem;
    }

    /* The brand-bar search takes its own row on small screens. */
    .mp-mainbar .mp-search {
        order: 3;
        flex-basis: 100%;
    }
}
