/* ============================================
   سنگ ۲۰ - Layout Styles
   ============================================ */

/* ========== Loading State ========== */
body.loading .chat-widget { visibility: hidden; }

/* ========== User Menu ========== */
.user-menu { position: relative; display: inline-block; }
.user-dropdown-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
}
.user-dropdown-btn:hover { background: rgba(255,255,255,0.2); }
.user-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    min-width: 180px;
    z-index: 1000;
    padding: 8px 0;
}
.user-dropdown-menu a {
    display: block;
    padding: 10px 18px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: 0.2s;
}
.user-dropdown-menu a:hover { background: #f5f5f5; color: #C8956C; }
.logout-link { color: #E74C3C !important; }

/* ========== Cart ========== */
.cart-icon { position: relative; }

/* ========== Search ========== */
.nav-search-form { display: flex; align-items: center; margin-right: 5px; position: relative; }
.nav-search-input {
    width: 120px;
    padding: 6px 30px 6px 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 12px;
    outline: none;
    transition: 0.3s;
}
.nav-search-input:focus { border-color: #C8956C; width: 150px; }
.nav-search-form button {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

/* ========== Navbar ========== */
.navbar-logo { height: 50px; width: auto; margin-right: 10px; vertical-align: middle; }
.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 20px;
    font-weight: 700;
    color: #2C3E50;
}
.navbar-brand:hover { color: #C8956C; }
.navbar-toggler {
    display: none;
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
    padding: 8px 12px;
    color: #2C3E50;
    border-radius: 8px;
    line-height: 1;
}
.navbar-toggler:hover { background: #f0f0f0; }

/* ========== Chat Widget ========== */
.chat-widget {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}
.chat-notification {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 340px;
    display: none;
    animation: notifSlideUp 0.5s cubic-bezier(.16,1,.3,1);
    z-index: 10000;
}
.chat-notification.show { display: block; }
.chat-notif-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: white;
    border: 2px solid #e0e0e0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    color: #999;
    transition: .2s;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.chat-notif-close:hover { background: #E74C3C; border-color: #E74C3C; color: white; }
.chat-notif-card {
    background: white;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 12px 50px rgba(0,0,0,.18);
    border: 1px solid #eee;
    display: flex;
    gap: 14px;
    align-items: center;
    cursor: pointer;
    transition: .3s;
    position: relative;
    overflow: hidden;
}
.chat-notif-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,#27AE60,#C8956C,#27AE60);
    background-size: 200% 100%;
    animation: gradientMove 3s ease infinite;
}
.chat-notif-card:hover { transform: translateY(-2px); box-shadow: 0 16px 60px rgba(0,0,0,.22); }
.chat-notif-avatar { position: relative; width: 56px; height: 56px; flex-shrink: 0; }
.chat-notif-avatar img {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    border: 2px solid #f0f0f0;
}
.notif-fallback {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg,#C8956C,#8B7355);
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    position: absolute;
    top: 0;
    left: 0;
}
.notif-ring {
    position: absolute;
    top: -3px;
    left: -3px;
    width: 62px;
    height: 62px;
    border-radius: 19px;
    border: 2px solid transparent;
    border-top-color: #27AE60;
    animation: ringSpin 3s linear infinite;
}
.notif-online-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: #27AE60;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.chat-notif-body { flex: 1; min-width: 0; }
.notif-name-row { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.notif-name-row strong { font-size: 14px; color: #1a1a2e; font-weight: 700; }
.notif-verified {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #C8956C;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
}
.notif-role { font-size: 11px; color: #888; margin: 0 0 6px; line-height: 1.3; }
.notif-status { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #27AE60; font-weight: 600; }
.notif-dot {
    width: 7px;
    height: 7px;
    background: #27AE60;
    border-radius: 50%;
    animation: pulse 2s infinite;
}
.chat-toggle {
    background: linear-gradient(135deg,#1a1a2e,#2C3E50);
    color: #C8956C;
    border: 2px solid #C8956C;
    width: 50px;
    height: 50px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 20px rgba(200,149,108,.3);
    transition: .3s;
    position: relative;
}
.chat-toggle:hover { transform: scale(1.1); box-shadow: 0 6px 30px rgba(200,149,108,.5); }
.chat-toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: rgba(200,149,108,.15);
    border-radius: 50%;
    font-size: 22px;
}
.chat-status { width: 10px; height: 10px; border-radius: 50%; position: absolute; top: 0; right: 0; }
.chat-status.online { background: #27AE60; animation: pulse 2s infinite; border: 2px solid #1a1a2e; }
.chat-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 380px;
    height: 520px;
    background: white;
    border-radius: 18px;
    box-shadow: 0 15px 60px rgba(0,0,0,.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #e0e0e0;
}
.chat-header {
    background: linear-gradient(135deg,#1a1a2e,#2C3E50);
    color: white;
    padding: 15px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.chat-header-info { display: flex; align-items: center; gap: 12px; }
.chat-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255,255,255,.15);
    position: relative;
    flex-shrink: 0;
}
.chat-avatar img { width: 42px; height: 42px; object-fit: cover; position: absolute; top: 0; left: 0; }
.chat-header-info h6 { margin: 0; font-size: 14px; font-weight: 600; }
.chat-header-info small { font-size: 11px; opacity: .85; }
.online-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #27AE60;
    border-radius: 50%;
    margin-right: 4px;
    animation: pulse 2s infinite;
}
.chat-close {
    background: rgba(255,255,255,.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .2s;
}
.chat-close:hover { background: rgba(255,0,0,.4); }
.chat-messages { flex: 1; padding: 15px; overflow-y: auto; background: #f9fafb; }
.chat-bubble { display: flex; gap: 10px; margin-bottom: 15px; }
.bubble-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}
.bubble-avatar img { width: 35px; height: 35px; object-fit: cover; position: absolute; top: 0; left: 0; }
.bubble-content { max-width: 85%; }
.bubble-text {
    background: white;
    padding: 12px 15px;
    border-radius: 15px;
    font-size: 13px;
    line-height: 1.8;
    color: #333;
    white-space: pre-line;
    border: 1px solid #e8e8e8;
}
.bubble-time { font-size: 10px; color: #999; margin-top: 3px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.quick-btn {
    background: white;
    border: 1px solid #ddd;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: .3s;
    font-family: inherit;
    white-space: nowrap;
    color: #555;
}
.quick-btn:hover {
    background: #C8956C;
    color: white;
    border-color: #C8956C;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(200,149,108,.3);
}
.quick-btn.highlight {
    background: linear-gradient(135deg,#fff8e1,#fff3e0);
    border: 2px solid #C8956C;
    color: #8B6914;
    font-weight: bold;
    animation: gentlePulse 3s infinite;
}
.quick-btn.highlight:hover { background: #C8956C; color: white; border-color: #C8956C; }
.contact-cta-btn {
    display: inline-block;
    background: linear-gradient(135deg,#C8956C,#a67c52);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    font-size: 13px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(200,149,108,0.4);
}
.contact-cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(200,149,108,0.6);
    background: linear-gradient(135deg,#b07d56,#8B6914);
    color: white;
}
.contact-suggestion { animation: slideInUp 0.5s ease; }
.chat-footer { border-top: 1px solid #eee; background: white; }
.chat-trust-badges {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 8px 0;
    background: #f9fafb;
    border-bottom: 1px solid #eee;
}
.chat-trust-badges span { font-size: 10px; color: #888; }
.chat-input-area { display: flex; align-items: center; gap: 8px; padding: 10px 15px; }
.chat-input {
    flex: 1;
    border: 2px solid #e0e0e0;
    padding: 10px 15px;
    border-radius: 25px;
    font-size: 13px;
    outline: none;
}
.chat-input:focus { border-color: #C8956C; box-shadow: 0 0 0 3px rgba(200,149,108,.1); }
.chat-send-btn {
    background: #C8956C;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.chat-send-btn:hover { background: #b07d56; }

/* ========== Animations ========== */
@@keyframes notifSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@@keyframes ringSpin {
    from { transform: rotate(0); }
    to { transform: rotate(360deg); }
}
@@keyframes gradientMove {
    0% { background-position: 0 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}
@@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.6); opacity: .5; }
}
@@keyframes slideInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@@keyframes gentlePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(200,149,108,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(200,149,108,0); }
}

/* ========== Responsive ========== */
@@media (max-width: 991px) {
    .navbar-toggler { display: block; }
    .navbar .container { flex-wrap: wrap; }
    .navbar-collapse {
        display: none;
        width: 100%;
        flex-direction: column;
        background: white;
        border-radius: 12px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.12);
        margin-top: 12px;
        padding: 15px;
        max-height: 75vh;
        overflow-y: auto;
    }
    .navbar-collapse.show { display: flex; }
    .navbar-nav { flex-direction: column; width: 100%; padding: 0; }
    .nav-link {
        display: block !important;
        padding: 13px 16px !important;
        font-size: 15px !important;
        border-radius: 8px !important;
        margin-bottom: 3px;
        color: #2C3E50 !important;
    }
    .nav-link:hover { background: #f5f5f5; color: #C8956C !important; }
    .nav-icons {
        display: flex;
        justify-content: center;
        gap: 25px;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid #eee;
        width: 100%;
    }
    .nav-search-form { width: 100%; margin: 8px 0; }
    .nav-search-input { width: 100% !important; padding: 12px 15px !important; font-size: 14px !important; }
    .chat-window { width: 320px; }
}

@@media (max-width: 767px) {
    .navbar-brand { font-size: 17px; }
    .navbar-logo { height: 38px; }
    .chat-window { width: 92vw; right: 4vw; height: 60vh; }
}

@@media (max-width: 480px) {
    .navbar-brand { font-size: 15px; }
    .navbar-logo { height: 32px; margin-right: 5px; }
    .nav-link { font-size: 14px !important; padding: 10px 12px !important; }
    .nav-icons { gap: 18px; }
    .chat-notification { width: 280px; }
}