/* TAB.MD Main Stylesheet */

/* ============================================
   LOGIN PAGE STYLES - FROM auth/login.blade.php
   ============================================ */

/* Auth page specific styles using app layout variables */

/* Auth container - combines typography and layout styles */
.auth-container {
    font-size: 14px;
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin: 3rem auto;
    max-width: 400px;
    box-shadow: var(--shadow-soft);
    border: 1px solid #e9ecef;
}

.auth-title {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-title h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--primary-color);
}

.auth-title p {
    margin: 0;
    color: var(--secondary-color);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 500;
    color: #212529;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-control {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    border-color: #636e72;
    box-shadow: 0 0 0 4px rgba(99, 110, 114, 0.1);
    outline: none;
    transform: translateY(-1px);
}

.btn-auth {
    background: #2d3436;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    width: 100%;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-auth:hover {
    background: #636e72;
    transform: translateY(-1px);
}

.divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e9ecef;
}

.divider span {
    background: white;
    padding: 0 1rem;
    color: #6c757d;
    font-size: 0.85rem;
}

.social-login {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn-social {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #212529;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-social:hover {
    border-color: #636e72;
    color: #2d3436;
    transform: translateY(-1px);
    text-decoration: none;
    background: #f8f9fa;
}

.btn-google:hover {
    border-color: #db4437;
    color: #db4437;
}

.btn-facebook:hover {
    border-color: #4267b2;
    color: #4267b2;
}

.auth-links {
    text-align: center;
}

.auth-links p {
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.auth-links a {
    color: #0984e3;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-links a:hover {
    color: #2d3436;
    text-decoration: underline;
}

/* Responsive for auth pages */
@media (max-width: 576px) {
    .auth-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .social-login {
        flex-direction: column;
    }
}

/* Password strength indicator for register page */
.password-strength {
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.strength-weak { 
    color: var(--danger-color); 
}

.strength-medium { 
    color: #b8860b; 
}

.strength-strong { 
    color: var(--success-color); 
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.form-check-input {
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.form-check-label {
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.4;
}

.form-check-label a {
    color: var(--accent-color);
    text-decoration: none;
}

.form-check-label a:hover {
    text-decoration: underline;
}

/* ============================================
   END LOGIN PAGE STYLES
   ============================================ */

/* CSS Variables */
:root {
    --primary-color: #2d3436;
    --secondary-color: #636e72;
    --accent-color: #0984e3;
    --success-color: #00b894;
    --warning-color: #fdcb6e;
    --danger-color: #e17055;
    --dark-color: #2d3436;
    --light-color: #ddd;
    --border-color: #e9ecef;
    --border-light: #f0f0f0;
    --shadow-soft: 0 8px 32px rgba(0,0,0,0.08);
    --shadow-hover: 0 16px 48px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
    --border-radius: 16px;
    --border-radius-lg: 24px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --white: #ffffff;
}

/* Base Styles */
body, html, h1, h2, h3, h4, h5, h6, p, span, div, a, button {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}


body {
    overflow-x: hidden;
    background-color: #f8f9fa;
}

/* Premium Header */
.premium-header {
    background: white;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    position: relative;
    z-index: 1045;
    transition: all 0.3s ease;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    color: #6c757d;
    letter-spacing: -1px;
}

/* Catalog button - prevent text wrapping */
.catalog-btn {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0.375rem 1rem;
}

/* Mobile Header 3-Row Layout */
.mobile-header-rows {
    display: none;
}

@media (max-width: 767px) {
    .mobile-header-rows {
        display: block !important;
        position: relative;
        z-index: 1050;
    }
    
    .mobile-header-row-1,
    .mobile-header-row-2,
    .mobile-header-row-3 {
        border-bottom: 1px solid #f0f0f0;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    .mobile-header-row-1 {
        padding-top: 0.75rem;
    }
    
    .mobile-header-row-3 {
        border-bottom: none;
        padding-bottom: 0.75rem;
    }
    
    .mobile-header-rows .logo {
        font-size: 1.5rem;
    }
    
    .mobile-header-rows .catalog-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Action buttons styling - circular */
    .mobile-header-rows .mobile-header-row-2 a.btn {
        padding: 0.5rem;
        border: 1px solid #dee2e6;
        background: white;
        border-radius: 50%;
        width: 42px;
        height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin: 0 2px;
        transition: all 0.2s ease;
    }
    
    .mobile-header-rows .mobile-header-row-2 a.btn:hover {
        background: #f8f9fa;
        border-color: #adb5bd;
        transform: scale(1.05);
    }
    
    /* Dropdown buttons - circular */
    .mobile-header-rows .dropdown button.btn {
        padding: 0.5rem;
        border: 1px solid #dee2e6;
        background: white;
        border-radius: 50%;
        width: 42px;
        height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
    }
    
    .mobile-header-rows .dropdown button.btn:hover {
        background: #f8f9fa;
        border-color: #adb5bd;
        transform: scale(1.05);
    }
    
    /* Fix dropdown z-index on mobile */
    .mobile-header-rows .dropdown-menu {
        z-index: 10000 !important;
        position: absolute !important;
    }
    
    /* Ensure dropdowns stay on top */
    .mobile-header-rows .dropdown {
        position: relative;
        z-index: 1060;
    }
    
    .mobile-header-rows .badge-notification {
        position: absolute;
        top: -5px;
        right: -5px;
        background: var(--danger-color);
        color: white;
        border-radius: 50%;
        width: 18px;
        height: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        font-weight: bold;
    }
    
    .mobile-header-rows .search-container {
        display: block !important;
        max-width: 100%;
    }
    
    .mobile-header-rows .premium-search {
        padding: 10px 20px 10px 45px;
        font-size: 14px;
    }
    
    .mobile-header-rows .search-icon {
        left: 15px;
        font-size: 16px;
    }
}

/* Search Container */
.search-container {
    position: relative;
    max-width: 500px;
}

.premium-search {
    border: 2px solid #e9ecef;
    border-radius: 50px;
    padding: 12px 24px 12px 55px;
    font-size: 16px;
    transition: all 0.3s ease;
    width: 100%;
}

.premium-search:focus {
    border-color: #6c757d;
    box-shadow: 0 0 0 4px rgba(108, 117, 125, 0.1);
    transform: translateY(-1px);
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 5;
    pointer-events: none;
    font-size: 18px;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: 5px;
}

.search-suggestions.show {
    display: block;
}

/* Search Suggestion Items */
.search-suggestion,
.search-suggestion-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.search-suggestion:hover,
.search-suggestion-item:hover {
    background-color: #f8f9fa;
}

.search-suggestion:last-child,
.search-suggestion-item:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

.search-suggestion.highlighted {
    background-color: #e9ecef;
}

.search-suggestion-item img {
    border-radius: 6px;
}

.search-suggestion-item .fw-medium {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.search-suggestion-item .text-muted {
    font-size: 12px;
}

.search-suggestion-item .fw-bold {
    font-size: 14px;
}

.search-suggestion-item .text-decoration-line-through {
    text-decoration: line-through;
}

/* Action Buttons (Cart, Compare, Favorites) */
/* Header action buttons - enforce consistent spacing */
header .action-buttons,
.premium-header .action-buttons {
    gap: 0.5rem !important; /* Bootstrap gap-2 = 8px */
}

header .action-buttons .btn,
.premium-header .action-buttons .btn {
    margin: 0 !important; /* Remove any margins, let gap handle spacing */
}

.action-buttons .btn {
    border-radius: 50px;
    padding: 12px 18px;
    margin: 0 6px;
    position: relative;
    overflow: visible;
    transition: all 0.3s ease;
    border: 2px solid #e9ecef;
    background: white;
    color: #6c757d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    background: #f8f9fa;
    border-color: #6c757d;
    color: #6c757d;
}

.action-buttons .btn-primary {
    border: 2px solid #6c757d;
    background: #6c757d;
    color: white;
}

.action-buttons .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
    background: #5a6268;
    border-color: #5a6268;
    color: white;
}

/* User and Language Dropdown Buttons */
.user-dropdown .btn.dropdown-toggle,
.dropdown .btn.dropdown-toggle {
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    color: #6c757d;
    transition: all 0.2s ease;
}

.user-dropdown .btn.dropdown-toggle:hover,
.dropdown .btn.dropdown-toggle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Badge Notifications */
.badge-notification,
.cart-count,
.favorites-count,
.compare-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    z-index: 10;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Categories Sidebar */
.categories-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: white;
    border-right: 1px solid #e9ecef;
    z-index: 1060;
    transition: left 0.3s ease;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.categories-sidebar.show {
    left: 0;
}

/* Sidebar Header */
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h5 {
    margin: 0;
    font-weight: 600;
    color: #6c757d;
    flex: 1;
}

.sidebar-content {
    padding: 0;
}

/* Category List Styles */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    border-bottom: 1px solid #f1f3f4;
}

.category-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    text-decoration: none;
    color: #6c757d;
    transition: all 0.3s ease;
    font-weight: 500;
    cursor: pointer;
}

.category-link:hover {
    background: linear-gradient(to right, #f8f9fa, transparent);
    color: #2d3436;
    transform: translateX(5px);
}

.category-arrow {
    font-size: 0.8rem;
    margin-right: 10px;
    transition: transform 0.3s ease;
}

.category-item.expanded .category-arrow {
    transform: rotate(90deg);
}

.category-icon {
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.expand-arrow {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.category-item.expanded .expand-arrow {
    transform: rotate(180deg);
}

/* Subcategory Styles */
.subcategory-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: none;
    background: #fafbfc;
    animation: slideDown 0.3s ease;
}

.category-item.expanded .subcategory-list {
    display: block;
}

.subcategory-item {
    border-bottom: 1px solid #f1f3f4;
}

.subcategory-link {
    display: block;
    padding: 12px 20px 12px 45px;
    color: #6c757d;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.subcategory-link:hover {
    background: #fff;
    color: #2d3436;
    padding-left: 50px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile backdrop for sidebar */
@media (max-width: 768px) {
    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1055;
        display: none;
    }
    
    .sidebar-backdrop.show {
        display: block;
    }
}

/* Filter Sidebar */
.filter-sidebar {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

/* Mobile filter collapse styles */
@media (max-width: 767px) {
    .filter-sidebar {
        padding: 0;
        margin-bottom: 1rem;
        overflow: hidden;
    }
    
    #filterToggle {
        padding: 1rem;
        margin: 0;
        cursor: pointer;
        border-bottom: 1px solid var(--border-color);
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: var(--light-color);
        font-weight: 600;
        user-select: none;
    }
    
    .filter-toggle-icon {
        transition: transform 0.3s ease;
        font-size: 1.2rem;
    }
    
    .filter-sidebar.expanded .filter-toggle-icon {
        transform: rotate(180deg);
    }
    
    .filter-form {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
        padding: 0;
    }
    
    .filter-sidebar.expanded .filter-form {
        max-height: 3000px;
        padding: 1rem;
        overflow-y: auto;
    }
    
    .filter-section {
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border-light);
    }
    
    .filter-section:last-child {
        border-bottom: none;
    }
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.product-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

/* ============================================
   FAVORITES PAGE STYLES
   ============================================ */

.favorites-container {
    min-height: 400px;
    padding: 2rem 0;
}

.empty-favorites {
    text-align: center;
    padding: 4rem 0;
}

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.favorite-item {
    position: relative;
}

.favorite-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.favorite-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.card-image-wrapper {
    position: relative;
    padding-top: 75%;
    background: #f8f9fa;
    overflow: hidden;
}

.card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
}

.btn-remove-favorite {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--danger-color);
}

.btn-remove-favorite:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.favorite-card .card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.favorite-card .product-title {
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.favorite-card .product-brand {
    color: #6c757d;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.favorite-card .price-section {
    margin-top: auto;
    padding-top: 0.75rem;
}

.favorite-card .old-price {
    text-decoration: line-through;
    color: #6c757d;
    font-size: 0.875rem;
    margin-right: 0.5rem;
}

.favorite-card .current-price {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 600;
}

.favorite-card .action-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.favorite-card .action-buttons .btn {
    flex: 1;
}

@media (max-width: 768px) {
    .favorites-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }
    
    .favorite-card .product-title {
        font-size: 0.9rem;
    }
    
    .favorite-card .current-price {
        font-size: 1.1rem;
    }
}

/* ============================================
   END FAVORITES PAGE STYLES
   ============================================ */

/* Premium Footer */
.premium-footer {
    background: #1a202c;
    color: white;
    padding: 60px 0 30px;
}

.footer-section h5 {
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #e2e8f0;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 0.8rem;
}

.footer-section ul li a {
    color: #a0aec0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--secondary-color);
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icon {
    width: 45px;
    height: 45px;
    background: #6c757d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.social-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(45, 52, 54, 0.3);
}

.footer-bottom {
    border-top: 1px solid #2d3748;
    padding-top: 30px;
    margin-top: 40px;
    text-align: center;
    color: #a0aec0;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.25rem;
    }
}

@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1rem;
    }
    
    .filter-sidebar {
        margin-bottom: 2rem;
        padding: 1.25rem;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 0.75rem;
    }
    
    .filter-sidebar, .main-content {
        border-radius: var(--radius-md);
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .product-card {
        padding: 1rem;
    }
}