/*static/custom.css*/
/* =========================================
   Imports & Base Styles
========================================= */
@import url("bootstrap.min.css");
@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css");
@import url("../fonts/fonts.css");
@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css");

/* =========================================
   Root Variables
========================================= */
:root {
    --primary-color: {{ site_settings.primary_color|default:"#0d6efd" }};
    --secondary-color: {{ site_settings.secondary_color|default:"#198754" }};
    --background-color: {{ site_settings.background_color|default:"#ffffff" }};
    --text-color: {{ site_settings.text_color|default:"#000000" }};
    --heading-color: {{ site_settings.heading_color|default:"#222222" }};
    --link-color: {{ site_settings.link_color|default:"#0d6efd" }};
    --button-color: {{ site_settings.button_color|default:"#0d6efd" }};
    --icon-color: {{ site_settings.icon_color|default:"#000000" }};
    --card-background-color: {{ site_settings.card_background_color|default:"#ffffff" }};
    --card-text-color: {{ site_settings.card_text_color|default:"#000000" }};
    --card-border-color: {{ site_settings.card_border_color|default:"#e0e0e0" }};
    --radius: 12px;
    --shadow-light: 0 4px 15px rgba(0,0,0,0.05);
    --shadow-hover: 0 6px 25px rgba(0,0,0,0.1);
}

/* Smooth transitions for all elements */
/* فقط عناصر عادی transition داشته باشند */
html, body, div, span, p, a, img, button, .card, .product-card {
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}


/* =========================================
   Navbar Custom Styles
========================================= */
.hero-section {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

html, body {
    overflow-x: hidden !important;
    margin: 0 !important;
}

.cool-link {
    position: relative;
    color: var(--primary-color);
    font-weight: 500;
    transition: color 0.3s ease;
}
.cool-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}
.cool-link:hover {
    color: var(--secondary-color);
}
.cool-link:hover::after {
    width: 100%;
}

.navbar {
    background-color: var(--background-color);
    color: var(--text-color);
}
.navbar .btn {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.navbar .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.nav-search input { min-width: 200px; }
.user-avatar {
    width: 35px;
    height: 35px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid var(--secondary-color);
}

/* =========================================
   Product Carousel
========================================= */
.product-carousel {
    overflow: hidden;
    position: relative;
    width: 100%;
}
.product-track {
    display: flex;
    flex-wrap: nowrap;
    transition: transform 0.6s ease-in-out;
}
.product-card {
    flex: 0 0 auto;
    width: 220px;
    margin: 0 10px;
    background: var(--background-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-light);
    text-align: center;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.product-card img {
    width: 100%;
    border-radius: 6px;
    margin-bottom: 8px;
}
.product-card:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
}
.product-card:hover::after {
    content: 'مشاهده جزئیات';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: var(--radius);
    pointer-events: none;
}
/* 🟦 استایل عمومی کارت‌ها */
.product-card,
.card {
    background-color: var(--card-background-color);
    color: var(--card-text-color);
    border: 1px solid var(--card-border-color);
    border-radius: 1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover,
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.product-card p {
    color: var(--card-text-color);
}
/* Carousel Buttons */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s ease;
}
.carousel-btn:hover {
    background: var(--secondary-color);
}
.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }

/* =========================================
   Product Cards & Animations
========================================= */

.product-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.product-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--icon-color);
    color: #fff;
    padding: 2px 6px;
    font-size: 0.8rem;
    border-radius: 4px;
    font-weight: bold;
}
.product-img {
    width: 220px;
    height: 220px;
    object-fit: cover;
    border-radius: 8px;
}

/* =========================================
   Notification Slider
========================================= */
.notification-slider-wrapper {
    overflow: hidden;
    position: relative;
    border-radius: 6px;
    background-color: var(--background-color) !important;
    color: var(--text-color);
    padding: 10px 20px;
    display: flex;
    align-items: center;
}
.notification-slider {
    display: flex;
    gap: 30px;
    background-color: var(--background-color) !important;
}
.notification-slider .slide {
    flex: 0 0 auto;
    padding: 5px 10px;
    background-color: var(--background-color) !important;
    color: var(--text-color);
    border-radius: 4px;
    font-weight: bold;
    transition: transform 0.6s ease-in-out;
}
.notification-slider .slide:hover {
    transform: scale(1.05);
    color: var(--primary-color);
}

/* =========================================
   Miscellaneous
========================================= */
.main-image { transition: transform 0.3s ease; }
.main-image:hover { transform: scale(1.05); }

/* =========================================
   Rating Stars
========================================= */
/* ستاره‌ها */
.stars-outer {
    position: relative;
    display: inline-block;
    color: #ccc; /* رنگ ستاره خاکستری */
    font-size: 14px; /* اندازه ستاره‌ها */
}
.stars-inner {
    position: absolute;
    top: 0;
    left: 0;
    white-space: nowrap;
    overflow: hidden;
    color: #f8ce0b; /* رنگ ستاره طلایی */
}
.stars-outer::before {
    content: "★★★★★";
}
.stars-inner::before {
    content: "★★★★★";
}


/* =========================================
   Buttons
========================================= */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    transition: all 0.3s ease-in-out;
    color: #fff;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* =========================================
   Dark Mode
========================================= */
body.dark-mode {
    background-color: #121212 !important;
    color: #eee;
}
body.dark-mode a { color: #90caf9; }
body.dark-mode .navbar,
body.dark-mode footer {
    background-color: #1e1e1e !important;
    color: #eee;
}
body.dark-mode .product-card {
    background: linear-gradient(145deg, #1b1b1b, #111111) !important;
    color: #ffd700;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
}
body.dark-mode .product-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.6);
}
body.dark-mode .discount-badge {
    background: linear-gradient(45deg, #ffd700, #ffcc00);
    color: #0d0d0d;
}

/* =========================================
   Profile & User Elements
========================================= */
.nav-profile-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}
.nav-profile-img:hover { transform: scale(1.05); }

/* =========================================
   Profile Page Styles
========================================= */
.profile-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    background-color: var(--background-color);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow-light);
}
.profile-header:hover { box-shadow: var(--shadow-hover); }

.profile-header img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--secondary-color);
}
.profile-header img:hover { transform: scale(1.1); }

.profile-header .user-info h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--heading-color);
}
.profile-header .user-info p {
    margin: 2px 0;
    color: var(--text-color);
    font-size: 0.9rem;
}

.profile-header .edit-btn {
    font-size: 0.9rem;
    padding: 6px 18px;
    border-radius: 25px;
}

.section-title {
    color: var(--primary-color);
}

.group-title {
    color: var(--secondary-color);
}

.alert-custom {
    background-color: rgba(0, 123, 255, 0.05);
    border: 1px solid var(--primary-color);
    color: var(--text-color);
}

/* ======= Info Cards ======= */
.info-card {
    background-color: var(--background-color);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.info-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}
.info-card h5 {
    font-weight: 600;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    color: var(--heading-color);
}
.info-card p {
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: var(--text-color);
}
.info-card strong { color: var(--primary-color); }

/* ======= Wishlist Table ======= */
.wishlist-table table {
    background-color: var(--background-color);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
}
.wishlist-table tr:hover {
    background-color: rgba(0,123,255,0.05);
}
.wishlist-table img { border-radius: 8px; }

/* ======== Shipment Pages ======== */
.shipment-wrapper {
    background: var(--background-color);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-light);
}
.shipment-header h2 {
    font-weight: 700;
    color: var(--heading-color);
}
.shipment-card {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 3px 6px rgba(0,0,0,0.05);
}
.shipment-card h5 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}
.table thead { background: #f7f7f7; }
.table th, .table td { vertical-align: middle; }

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: #fff !important;
    border-color: var(--primary-color);
}
.alert-info {
    background-color: rgba(13, 110, 253, 0.1);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.product-card {
    border: 1px solid var(--card-border-color) !important;
}

.product-main-image {
    border: 1px solid var(--icon-color);
    border-radius: 10px;
    overflow: hidden; /* باعث میشه تصویر از گوشه‌ها بیرون نزنه */
}

.list-group-item p {
  max-height: 200px;
  overflow-y: auto;
}

.section-title {
  display: inline-block;
  position: relative;
  padding-bottom: 6px;
  transition: color 0.3s ease;
}
.section-title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 3px;
  background-color: var(--primary-color);
  transition: all 0.4s ease;
  transform: translateX(-50%);
}
.section-title:hover {
  color: var(--primary-color);
}
.section-title:hover::after {
  width: 60%;
}

body {
  background-color: var(--background-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}
.banner-card {
  aspect-ratio: 16 / 9;
  background: #f5f5f5;
  transition: transform 0.4s ease, box-shadow 0.3s ease;
}
.banner-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 18px rgba(0,0,0,0.15);
}
.banner-img {
  object-fit: cover;
  width: 100%;
  height: 100%;
  border-radius: 1rem;
}
.banner-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 1rem;
}
.banner-card:hover .banner-overlay {
  opacity: 1;
}

.chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
}

#chat-box {
    animation: fadeInUp 0.3s ease forwards;
}


/* ==== Product Card Modern Upgrade ==== */
.product-card {
    border-radius: 16px !important;
    background: var(--card-background-color);
    border: 1px solid var(--card-border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    padding: 12px;
    overflow: hidden;
    position: relative;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border-color: rgba(0,0,0,0.15);
}

/* تصویر محصول */
.product-card img,
.product-card .product-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 14px;
    transition: transform .35s ease, opacity .25s ease;
}

.product-card:hover img,
.product-card:hover .product-img {
    transform: scale(1.04);
    opacity: .95;
}

/* متن */
.product-card p {
    font-weight: 600;
    font-size: 15px;
    margin-top: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--card-text-color);
}

/* Badge تخفیف */
.discount-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #ff0033, #ff5555);
    color: #fff;
    font-size: 12px;
    padding: 4px 11px;
    border-radius: 12px;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
    backdrop-filter: blur(4px);
    z-index: 10;
}

/* Hover overlay برای حس لایه بالایی */
.product-card:hover::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: rgba(255,255,255,0.08);
    pointer-events: none;
}


body {
    padding-top: 80px !important;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}


/* =========================================
   Responsive Design
========================================= */
/* Responsive کوچک شدن ستاره‌ها */
@media (max-width: 768px) {
    .rating { font-size: 0.9rem; }
}
@media (max-width: 480px) {
    .rating { font-size: 0.8rem; }
}
@media (max-width: 992px) {
    .profile-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .profile-header img {
        width: 80px;
        height: 80px;
    }
}
@media (max-width: 576px) {
    .profile-header img {
        width: 70px;
        height: 70px;
    }
    .info-card { padding: 15px; }
}
@media (max-width: 1200px) { .product-card { width: 180px; } }
@media (max-width: 768px) { .product-card { width: 150px; } }
@media (max-width: 480px) { .product-card { width: 100%; margin: 0 5px; } }
