@font-face {
    font-family: "Shabnam Regular";
    src: url("/fonts/Shabnam-FD.woff") format("woff");
    src: url("/fonts/Shabnam-FD.woff2") format("woff2");
}

@font-face {
    font-family: "Shabnam Medium";
    src: url("/fonts/Shabnam-Medium-FD.woff") format("woff");
    src: url("/fonts/Shabnam-Medium-FD.woff2") format("woff2");
}

@font-face {
    font-family: "Shabnam Bold";
    src: url("/fonts/Shabnam-Bold-FD.woff") format("woff");
    src: url("/fonts/Shabnam-Bold-FD.woff2") format("woff2");
}

:root {
    --background: #f8f9fc;
    --primary-blue: #2337c2;
    --primary-red: #ec2028;
    --primary-text: #213152;
    --secondary-text: #6b7280;
    --border: #e2e6f0;
    --blue-hover: #1a2790;
    --red-hover: #b51a20;
    --special-boxes: #dde2fa;
    --shadow-dark: rgba(0, 0, 0, 0.25);
    --shadow-light: rgba(181, 181, 181, 0.25);
    --rating-star: #ffcd45;
    /* Swiper Custom */
    --swiper-theme-color: #213152 !important;
    --swiper-navigation-size: 1rem !important;
    --swiper-pagination-bottom: 0px;
    --swiper-navigation-sides-offset: -15px;
}

/* @media (prefers-color-scheme: dark) {
  :root {
    --background: #0a0a0a;
    --foreground: #ededed;
  }
} */

html {
    padding: 0;
    margin: 0;
}

body {
    padding: 1rem 0;
    font-family: "Shabnam Regular";
    background: var(--background);
    color: var(--primary-text);
    overflow-x: hidden;
}

@media (min-width: 1024px) {
    body {
        padding: 1.5rem 2rem;
    }
}

/* Custom Swiper Overrides */
.swiper {
    padding-bottom: 1rem !important;
    padding-left: 1.25rem !important;
}

.swiper-slide {
    padding-bottom: 1rem;
    height: auto !important;
}

.swiper-button-next,
.swiper-button-prev {
    padding: 24px;
    border-radius: 50%;
    background-color: #FFF;
    -webkit-box-shadow: -3px -3px 4px 0 rgba(154, 154, 154, 0.1), 3px 3px 4px 0 rgba(0, 0, 0, 0.1);
    box-shadow: -3px -3px 4px 0 rgba(154, 154, 154, 0.1), 3px 3px 4px 0 rgba(0, 0, 0, 0.1);
}

.galleryMain {
    padding: 0 !important;
}

.galleryThumbs .swiper-slide-thumb-active img {
    border: 2px solid var(--primary-blue);
}

/* Custom noUiSlider Overrides */
.noUi-connect {
    background-color: var(--primary-red) !important;
}

.noUi-horizontal .noUi-handle {
    width: 20px !important;
    height: 20px !important;
    top: -3px !important;
}

.noUi-handle:after, .noUi-handle:before {
    height: 12px !important;
    left: 6px !important;
    top: 3px !important;
}

.noUi-handle:after {
    left: 11px !important;
}

/* Custom Persian Date Element Overrides */

persian-datepicker-element {
    /* Typography */
    --jdp-font-family: inherit;
    /* Layout */
    --jdp-border-radius: 0.375rem; /* matches Tailwind's rounded-md */
    --jdp-direction: rtl;
}

persian-datepicker-element {
    display: block;
    width: 100%;
    --jdp-spacing-xs: 4px;
    --jdp-spacing-sm: 8px;
    --jdp-spacing-md: 16px;
}

/* Custom Behaviours */
a {
    cursor: pointer;
}

a:hover {
    color: var(--blue-hover);
}

img {
    z-index: 9 !important;
}

input:focus,
select:focus,
textarea:focus {
    outline: 1px solid var(--primary-blue);
}

.h-0 {
    height: 0;
}

/* Chrome, Edge, Safari */
input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

/* Custom Color Classes */
.bg-background {
    background-color: var(--background) !important;
}

.text-background {
    color: var(--background) !important;
}

.bg-primary-blue {
    background-color: var(--primary-blue) !important;
}

.bg-primary-blue:hover {
    background-color: var(--blue-hover) !important;
}

.text-primary-blue {
    color: var(--primary-blue) !important;
}

.bg-primary-red {
    background-color: var(--primary-red) !important;
}

.bg-primary-red:hover {
    background-color: var(--red-hover) !important;
}

.text-primary-red {
    color: var(--primary-red) !important;
}

.bg-primary-text {
    background-color: var(--primary-text) !important;
}

.text-primary-text {
    color: var(--primary-text) !important;
}

.bg-secondary-text {
    background-color: var(--secondary-text) !important;
}

.text-secondary-text {
    color: var(--secondary-text) !important;
}

.bg-blue-hover {
    background-color: var(--blue-hover) !important;
}

.text-blue-hover {
    color: var(--blue-hover) !important;
}

.bg-red-hover {
    background-color: var(--red-hover) !important;
}

.text-red-hover {
    color: var(--red-hover) !important;
}

/* Custom Classes */
.inner-shadow {
    box-shadow: inset -3px -3px 3px 0 var(--shadow-light), inset 2px 2px 3px 0 var(--shadow-dark);
}

.outter-shadow {
    -webkit-box-shadow: -3px -3px 4px 0 rgba(154, 154, 154, 0.1), 3px 3px 4px 0 rgba(0, 0, 0, 0.1);
    box-shadow: -3px -3px 4px 0 rgba(154, 154, 154, 0.1), 3px 3px 4px 0 rgba(0, 0, 0, 0.1);
}

.outter-shadow-lg {
    -webkit-box-shadow: 2px 1px 8px 2px rgba(154, 154, 154, .5);
    box-shadow: 2px 1px 8px 2px rgba(154, 154, 154, 0.5);
}

.white-gradient {
    background: linear-gradient( 90deg, rgb(247, 248, 252, 0) 0%, rgb(247, 248, 252, 1) 100% );
}

/* Custom components */
.btn-blue {
    padding: 0.5rem;
    border-radius: 0.375rem;
    background-color: var(--primary-blue);
    color: #fff;
}

.btn-blue:hover {
    background-color: var(--blue-hover);
    color: #fff;
}

.btn-red {
    padding: 0.5rem;
    border-radius: 0.375rem;
    background-color: var(--primary-red);
    color: #fff;
}

.btn-red:hover {
    background-color: var(--red-hover);
    color: #fff;
}

/* Custom styles */

/* Admin nav links */
.admin-nav-link {
    display: block;
    padding: 0.55rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background-color: var(--special-boxes);
    color: var(--primary-text);
    text-align: right;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.admin-nav-link:hover {
    background-color: var(--primary-blue);
    color: #fff;
}

.admin-nav-link.active {
    background-color: var(--primary-blue);
    color: #fff;
}

.admin-nav-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.admin-nav-group-label {
    font-size: 0.75rem;
    color: var(--secondary-text);
    white-space: nowrap;
    padding-inline-start: 0.25rem;
}

/* Admin panel shell (topbar + responsive sidebar) */

.admin-shell {
    display: flex;
    align-items: stretch;
    min-height: 100vh;
}

.admin-main-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--background);
    border-bottom: 1px solid var(--border);
}

.admin-topbar-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
}

.admin-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    border-radius: 0.5rem;
    background: var(--special-boxes);
    color: var(--primary-text);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.admin-sidebar-toggle:hover {
    background: var(--primary-blue);
    color: #fff;
}

.admin-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

body.admin-sidebar-open .admin-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
}

.admin-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    height: 100dvh;
    width: min(85vw, 300px);
    z-index: 50;
    background: var(--background);
    border-left: 1px solid var(--border);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.25s ease;
}

body.admin-sidebar-open .admin-sidebar {
    transform: translateX(0);
}

.admin-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.admin-main {
    padding: 1rem;
}

@media (min-width: 1024px) {
    .admin-main {
        padding: 1.5rem 2rem;
    }
}

/* Responsive admin data tables */

.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    -webkit-overflow-scrolling: touch;
}

.admin-table {
    width: 100%;
    min-width: 640px; /* keeps admin table columns legible — wrapper scrolls instead of squishing */
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.admin-table th:not(:last-child),
.admin-table td:not(:last-child) {
    border-left: 1px solid var(--border);
}

.admin-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--special-boxes);
    color: var(--primary-text);
    font-weight: 600;
}

.admin-table tbody tr:hover {
    background: rgba(35, 55, 194, 0.05);
}

.admin-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.015);
}

/* Mirrored top scrollbar for wide admin tables */

.admin-table-topscroll {
    overflow-x: auto;
    overflow-y: hidden;
    height: 14px;
    margin-bottom: 0.4rem;
}

.admin-table-topscroll-inner {
    height: 1px;
}

/* Admin forms */

.admin-page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-text);
    margin-bottom: 1rem;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    width: 100%;
    max-width: 640px;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.1rem;
}

@media (min-width: 640px) {
    .admin-form-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-form-grid .admin-field-full {
        grid-column: 1 / -1;
    }
}

.admin-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.admin-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-text);
}

.admin-input,
.admin-select,
.admin-textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.55rem 0.75rem;
    background: #fff;
    font-size: 0.9rem;
    color: var(--primary-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-input:focus,
.admin-select:focus,
.admin-textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(35, 55, 194, 0.15);
}

.admin-textarea {
    resize: vertical;
    min-height: 5rem;
}

.admin-checkbox-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-checkbox-field input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--primary-blue);
}

.admin-field-hint {
    font-size: 0.75rem;
    color: var(--secondary-text);
}

.admin-field-error {
    font-size: 0.8rem;
    color: var(--primary-red);
}

.admin-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: 0.75rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--border);
}

.admin-input[readonly],
.admin-textarea[readonly] {
    background: var(--special-boxes);
    color: var(--secondary-text);
}

/* Admin sub-sections (product edit page and similar) */

.admin-section {
    max-width: 640px;
    margin: 0 auto 1.75rem auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}

.admin-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-text);
}

.admin-section-subtitle {
    font-size: 0.8rem;
    color: var(--secondary-text);
    margin-top: 0.15rem;
}

.admin-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    padding: 0.6rem 0.85rem;
    background: var(--background);
}

.admin-list-item-main {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.admin-list-item-thumb {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.4rem;
    object-fit: cover;
    border: 1px solid var(--border);
    background: var(--special-boxes);
    flex-shrink: 0;
}

.admin-list-item-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-list-item-title {
    font-size: 0.875rem;
    color: var(--primary-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-list-item-meta {
    font-size: 0.75rem;
    color: var(--secondary-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-list-item-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.85rem;
    flex-shrink: 0;
    white-space: nowrap;
}

.admin-list-empty {
    color: var(--secondary-text);
    font-size: 0.875rem;
    padding: 0.4rem 0;
}

.admin-inline-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px dashed var(--border);
}

/* Category tree (admin) */

.category-tree,
.category-tree-children {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.category-tree-children {
    margin-top: 0.4rem;
    margin-inline-end: 1.1rem;
    padding-inline-end: 0.9rem;
    border-inline-end: 1px dashed var(--border);
}

.category-tree-children[hidden] {
    display: none;
}

.category-node {
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    background: var(--background);
}

.category-node-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
}

.category-node-toggle {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.4rem;
    color: var(--secondary-text);
}

.category-node-toggle:hover {
    background: var(--special-boxes);
}

.category-node-toggle svg {
    width: 1rem;
    height: 1rem;
    transition: transform 0.15s ease;
}

.category-node-toggle[aria-expanded="true"] svg {
    transform: rotate(-90deg);
}

.category-node-toggle-spacer {
    width: 1.5rem;
    flex-shrink: 0;
}

.category-node-thumb {
    width: 2rem;
    height: 2rem;
    border-radius: 0.4rem;
    object-fit: cover;
    border: 1px solid var(--border);
    background: var(--special-boxes);
    flex-shrink: 0;
}

.category-node-name-wrap {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.category-node-name {
    font-weight: 500;
    color: var(--primary-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-node-slug {
    font-size: 0.75rem;
    color: var(--secondary-text);
    direction: ltr;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-node-badge-inactive {
    font-size: 0.7rem;
    color: var(--primary-red);
    border: 1px solid var(--primary-red);
    border-radius: 0.3rem;
    padding: 0.05rem 0.45rem;
    flex-shrink: 0;
}

.category-node-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.85rem;
    margin-inline-start: auto;
    flex-shrink: 0;
    white-space: nowrap;
}

/**/

.details-summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.details-summary::-webkit-details-marker,
.details-summary::marker {
    display: none;
}

.details-chevron {
    transition: transform 0.2s ease;
}

details[open] .details-chevron {
    transform: rotate(180deg);
}

/* FAQ accordion */
.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-align: right;
    padding: 1rem 0.25rem;
    cursor: pointer;
    background: none;
    border: none;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary-text);
    transition: color 0.15s ease;
}

.faq-question:hover {
    color: var(--primary-blue);
}

.faq-icon {
    flex-shrink: 0;
    transition: transform 0.25s ease;
    color: var(--primary-blue);
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-answer-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease;
}

.faq-item.active .faq-answer-wrapper {
    grid-template-rows: 1fr;
}

.faq-answer-inner {
    overflow: hidden;
}

.faq-answer-inner p {
    padding: 0 0.25rem 1rem;
    color: var(--secondary-text);
    font-size: 0.9rem;
    line-height: 1.8;
}

.social-media svg:hover {
    fill: var(--blue-hover);
    cursor: pointer;
}

.social-media svg g path:hover {
    fill: var(--blue-hover);
}

.product-category-nav-item:last-of-type {
    color: var(--primary-text) !important;
}

/* mobile header search bar appear and reappear */
.search-wrapper {
    overflow: hidden;
    max-height: 100px;
    opacity: 1;
    transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.25s ease;
}

.search-wrapper.search-hidden {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* about us page */
.about-us-banner {
    background: url("/uploads/about-us/banner.jpg") no-repeat bottom fixed;
}

.about-us-title {
    text-shadow: -2px 3px 3px #000000;
}

/* filters sidebar */
.filter-products::before,
.filter-products::after {
    content: "";
    position: absolute;
    right: 0;
    display: block;
    width: 100%;
    height: 48px;
    pointer-events: none;
}

.filter-products::before {
    top: 0;
    background: linear-gradient( to bottom, rgb(255 255 255 / 70%) 0%, rgb(255 255 255 / 0%) 100% );
    border-start-start-radius: .5rem;
    border-start-end-radius: .5rem;
}

.filter-products::after {
    bottom: 0;
    background: linear-gradient( to top, rgb(255 255 255 / 70%) 0%, rgb(255 255 255 / 0%) 100% );
    border-end-start-radius: .5rem;
    border-end-end-radius: .5rem;
}

@media (max-width: 1023px) {
    .filter-products::before,
    .filter-products::after {
        display: none;
    }
}

/* Brands logo marquee */
.brands-marquee {
    overflow: hidden;
    padding: .5rem 0;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}

.brands-track {
    display: flex;
    width: max-content;
    animation: brands-scroll var(--brands-duration, 40s) linear infinite;
    will-change: transform;
}

.brands-group {
    display: flex;
    flex-shrink: 0;
    align-items: center;
}

.brands-item {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 8.5rem;
    padding: 0 .75rem;
}

.brands-item img {
    max-width: 100%;
    height: auto;
    transition: transform .3s ease;
}

.brands-item:hover img {
    transform: scale(1.08);
}

.brands-marquee:hover .brands-track,
.brands-marquee:focus-within .brands-track {
    animation-play-state: paused;
}

/* Moves to the right (the reading direction of the RTL site). Use 0 -> -50% to flip it. */
@keyframes brands-scroll {
    from {
        transform: translate3d(-50%, 0, 0);
    }

    to {
        transform: translate3d(0, 0, 0);
    }
}

@media (min-width: 1024px) {
    .brands-item {
        width: 10rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .brands-track {
        animation: none;
    }

    .brands-marquee {
        overflow-x: auto;
    }
}