/* 
 * MenWear - Modern Men's Fashion Store
 * Main Stylesheet
 */

/* ===== CSS Variables ===== */
:root {
    --primary-color: #1a1a1a;
    --secondary-color: #2d2d2d;
    --accent-color: #d4af37;
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --text-light: #999;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
    --border-radius: 8px;
    --font-primary: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    color: var(--text-primary);
    background-color: var(--bg-white);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul, ol {
    list-style: none;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

input, textarea, select {
    font-family: inherit;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    width: 100%;
    transition: var(--transition);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.1);
}

/* ===== Container & Layout ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col {
    padding: 0 15px;
}

/* ===== Header ===== */
.header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background: var(--primary-color);
    color: var(--bg-white);
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-top a {
    color: var(--bg-white);
    margin: 0 0.75rem;
}

.header-top a:hover {
    color: var(--accent-color);
}

.header-main {
    padding: 1.25rem 0;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 200px;
    overflow: hidden;
    opacity: 1;
    will-change: max-height, opacity;
}

.header-main.hide-on-scroll {
    max-height: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 1px;
}

.logo span {
    color: var(--accent-color);
}

.search-bar {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-bar input {
    padding-right: 3rem;
    border-radius: 50px;
}

.search-bar button {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    padding: 0 1.5rem;
    background: var(--primary-color);
    color: var(--bg-white);
    border-radius: 0 50px 50px 0;
}

.search-bar button:hover {
    background: var(--secondary-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-action {
    position: relative;
    padding: 0.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-action:hover {
    color: var(--accent-color);
}

.header-action i {
    font-size: 1.5rem;
}

.badge-count {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger-color);
    color: var(--bg-white);
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    font-weight: 600;
}

/* ===== Navigation ===== */
.nav-main {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 900;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--bg-white);
    font-size: 1.5rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.mobile-menu-toggle:hover {
    color: var(--accent-color);
}

.nav-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-menu a i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.nav-menu a:hover i {
    transform: translateY(-2px);
}

.nav-menu a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-menu a:hover::before,
.nav-menu a.active::before {
    width: 80%;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--accent-color);
    background: rgba(212, 175, 55, 0.08);
}

/* ===== Hero Section ===== */
.hero-section {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: var(--bg-white);
    padding: 4rem 0;
    margin-bottom: 3rem;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9);
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--bg-white);
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-accent {
    background: var(--accent-color);
    color: var(--primary-color);
}

.btn-accent:hover {
    background: #c4a137;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--bg-white);
}

.btn-outline.active-wishlist {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

.btn-outline.active-wishlist:hover {
    background: #c82333;
    border-color: #c82333;
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
}

/* ===== Section Titles ===== */
.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent-color);
}

.section-title p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-top: 1.5rem;
}

/* ===== Product Grid ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.product-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.product-image {
    position: relative;
    overflow: hidden;
    padding-top: 125%;
    background: var(--bg-light);
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-badges {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-sale {
    background: var(--danger-color);
    color: var(--bg-white);
}

.badge-new {
    background: var(--info-color);
    color: var(--bg-white);
}

.badge-bestseller {
    background: var(--accent-color);
    color: var(--primary-color);
}

.product-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    transform: translateX(20px);
    transition: var(--transition);
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateX(0);
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    color: var(--text-primary);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: var(--accent-color);
    color: var(--primary-color);
}

.action-btn.btn-wishlist.active {
    background: #dc3545;
    color: white;
}

.action-btn.btn-wishlist.active:hover {
    background: #c82333;
    color: white;
}

.product-info {
    padding: 1.25rem;
}

.product-category {
    font-size: 0.875rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.product-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-name:hover {
    color: var(--accent-color);
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.stars {
    color: #ffc107;
    font-size: 0.875rem;
}

.rating-count {
    font-size: 0.875rem;
    color: var(--text-light);
}

.product-price {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.current-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.original-price {
    font-size: 1.125rem;
    color: var(--text-light);
    text-decoration: line-through;
}

.discount-percent {
    background: var(--danger-color);
    color: var(--bg-white);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
}

.product-footer {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.add-to-cart {
    flex: 1;
    padding: 0.75rem;
    background: var(--primary-color);
    color: var(--bg-white);
    border-radius: var(--border-radius);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.add-to-cart:hover {
    background: var(--accent-color);
    color: var(--primary-color);
}

/* ===== Filters & Sidebar (Legacy - kept for compatibility) ===== */
.filters-sidebar {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.filter-group {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.filter-options label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    cursor: pointer;
    color: var(--text-primary);
    transition: var(--transition);
}

.filter-options label:hover {
    color: var(--accent-color);
}

.filter-options input[type="checkbox"],
.filter-options input[type="radio"] {
    width: auto;
    accent-color: var(--accent-color);
}

.price-range {
    padding: 1rem 0;
}

.price-inputs {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.price-inputs input {
    flex: 1;
}

/* ===== Footer ===== */
.footer {
    background: var(--primary-color);
    color: var(--bg-white);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
}

.footer-section ul li {
    margin-bottom: 0.75rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
}

.footer-section a:hover {
    color: var(--accent-color);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-white);
}

.social-link:hover {
    background: var(--accent-color);
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .nav-menu {
        gap: 0.25rem;
    }
    
    .nav-menu a {
        padding: 1rem 1.25rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .search-bar {
        order: 3;
        max-width: 100%;
        flex: 1 1 100%;
    }
    
    /* Mobile Navigation */
    .nav-main .container {
        position: relative;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
        flex-direction: column;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: all 0.3s ease;
        box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    }
    
    .nav-menu.show {
        max-height: 500px;
        opacity: 1;
    }
    
    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .nav-menu li:last-child {
        border-bottom: none;
    }
    
    .nav-menu a {
        width: 100%;
        padding: 1.25rem 1.5rem;
        justify-content: flex-start;
    }
    
    .nav-menu a::before {
        left: 0;
        transform: none;
        width: 3px;
        height: 100%;
    }
    
    .nav-menu a:hover::before,
    .nav-menu a.active::before {
        width: 5px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .section-title h2 {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .header-actions {
        gap: 0.75rem;
    }
    
    .header-action span {
        display: none;
    }
    
    .nav-menu a {
        font-size: 0.875rem;
        padding: 1rem 1.25rem;
    }
    
    .nav-menu a i {
        font-size: 1rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .product-info {
        padding: 1rem;
    }
    
    .product-name {
        font-size: 1rem;
    }
    
    .current-price {
        font-size: 1.25rem;
    }
}

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }
.p-5 { padding: 3rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.fw-normal { font-weight: 400; }

.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent-color); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }

/* ===== Back to Top Button ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent-color) 0%, #c29d30 100%);
    color: var(--bg-white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: linear-gradient(135deg, #c29d30 0%, var(--accent-color) 100%);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
    transform: translateY(-3px);
}

.back-to-top:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(212, 175, 55, 0.5);
}

.bg-light { background-color: var(--bg-light); }
.bg-white { background-color: var(--bg-white); }
