/* 
 * Modern Premium OpenCart Overhaul
 * Replaces outdated Bootstrap 3 aesthetics with a breathtaking, modern design
 * Font: Inter (Google Fonts)
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #4F46E5; /* Indigo 600 */
    --primary-hover: #4338CA;
    --secondary-color: #10B981; /* Emerald 500 */
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --bg-main: #F9FAFB;
    --surface: #FFFFFF;
    --border-color: #E5E7EB;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Typography & Body */
body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.025em;
}

a {
    color: var(--primary-color);
    transition: color var(--transition-fast);
}

a:hover, a:focus {
    color: var(--primary-hover);
    text-decoration: none;
}

/* Base Overrides for Bootstrap 3 */
.container {
    max-width: 1280px;
}

/* Header */
header {
    background: var(--surface);
    padding: 20px 0;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

#logo { margin: 0; }
#logo a { font-size: 28px; font-weight: 800; color: var(--text-main); text-decoration: none; letter-spacing: -1px; }

/* Search Bar */
#search { margin-bottom: 0; position: relative; }
#search .form-control {
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    box-shadow: none;
    padding: 12px 24px;
    height: auto;
    font-size: 15px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
#search .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
#search .btn-default {
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0 24px;
    transition: background var(--transition-fast);
}
#search .btn-default:hover { background: var(--primary-hover); }

/* Cart Button */
#cart > .btn {
    border-radius: var(--radius-full);
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-weight: 600;
    padding: 10px 20px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}
#cart > .btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: var(--shadow-md);
}
#cart .cart-total { display: inline-block; margin-left: 8px; }

/* Menus */
#menu {
    border: none;
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    margin-top: 15px;
}
#menu .nav > li > a {
    color: var(--text-main);
    font-weight: 600;
    padding: 15px 20px;
    transition: color var(--transition-fast);
}
#menu .nav > li > a:hover { color: var(--primary-color); background: transparent; }

/* Product Cards */
.product-layout {
    margin-bottom: 30px;
}
.product-thumb {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid transparent; /* Allows inner shadow on hover without shifting layout */
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    overflow: hidden;
    position: relative;
    padding: 0;
}
.product-thumb:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--border-color);
}
.product-thumb .image {
    padding: 20px;
    position: relative;
    background: #fff;
}
.product-thumb .image img {
    border-radius: var(--radius-sm);
    transition: transform var(--transition-normal);
}
.product-thumb:hover .image img { transform: scale(1.05); }

.product-thumb .caption {
    padding: 0 20px 20px;
    min-height: auto;
}
.product-thumb .caption h4 { margin-top: 15px; }
.product-thumb .caption h4 a {
    color: var(--text-main);
    font-weight: 700;
    font-size: 16px;
}
.product-thumb .caption h4 a:hover { color: var(--primary-color); }
.product-thumb .price {
    color: var(--text-main);
    font-weight: 800;
    font-size: 18px;
    margin-top: 10px;
}
.product-thumb .price-new { color: var(--secondary-color); font-weight: 800; }
.product-thumb .price-old { color: var(--text-muted); text-decoration: line-through; margin-left: 10px; font-weight: 500;}
.product-thumb .button-group {
    background: #fdfdfd;
    border-top: 1px solid var(--border-color);
    display: flex;
}
.product-thumb .button-group button {
    border: none;
    background: transparent;
    padding: 15px 0;
    color: var(--text-muted);
    font-weight: 600;
    transition: all var(--transition-fast);
}
.product-thumb .button-group button:hover {
    color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}
.product-thumb .button-group button i { margin-right: 5px; }

/* Buttons Global Overrides */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    letter-spacing: 0.025em;
    padding: 10px 20px;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.btn-primary:hover, .btn-primary:active, .btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

/* Badges */
.badge.sale-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--secondary-color);
    color: white;
    font-size: 12px;
    padding: 5px 10px;
    border-radius: var(--radius-full);
    font-weight: 700;
    z-index: 2;
}

/* Product Page Specifics */
#product-product h1 { font-size: 32px; font-weight: 800; margin-bottom: 20px; }
#product-product .thumbnails .thumbnail { border: none; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); transition: transform var(--transition-normal); }
#product-product .thumbnails .thumbnail:hover { transform: scale(1.02); box-shadow: var(--shadow-md); }
#product-product .nav-tabs { border-bottom: 2px solid var(--border-color); }
#product-product .nav-tabs > li.active > a, 
#product-product .nav-tabs > li.active > a:focus, 
#product-product .nav-tabs > li.active > a:hover { 
    border: none; border-bottom: 3px solid var(--primary-color); 
    color: var(--primary-color); font-weight: 700; background: transparent; 
}
#product-product .nav-tabs > li > a { border: none; font-weight: 600; color: var(--text-muted); }
#product-product .nav-tabs > li > a:hover { background: transparent; color: var(--text-main); }
#product-product #button-cart {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border: none;
    border-radius: var(--radius-full);
    font-size: 18px;
    font-weight: 700;
    padding: 15px 30px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}
#product-product #button-cart:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Mega Menu Overrides */
#menu {
    border: none;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-md);
    margin: 20px 0;
}
#menu .nav > li > a {
    color: var(--text-main);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}
#menu .nav > li.dropdown:hover > .dropdown-menu {
    display: flex !important;
    flex-direction: column;
    padding: 30px;
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-lg);
    background: var(--surface);
    top: 100%;
    margin-top: 0;
    opacity: 0;
    animation: fadeInMenu 0.3s forwards;
    min-width: 600px;
}

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

#menu .dropdown-inner {
    display: flex;
    gap: 30px;
    width: 100%;
}
#menu .dropdown-inner > ul {
    flex: 1;
}

#menu .dropdown-menu a {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: color var(--transition-fast);
}
#menu .dropdown-menu > .dropdown-inner > ul > li > a {
    font-weight: 700;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 10px;
}
#menu .dropdown-menu a:hover {
    color: var(--primary-color);
    background: transparent;
}
#menu .dropdown-menu img {
    border-radius: var(--radius-sm);
    width: 24px;
    height: 24px;
    object-fit: cover;
}
#menu .dropdown-menu .see-all {
    display: block;
    margin-top: 20px;
    text-align: right;
    color: var(--primary-color);
    font-weight: 600;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

/* Footer */
footer {
    background: white;
    padding: 60px 0 30px;
    border-top: 1px solid var(--border-color);
    margin-top: 60px;
}
footer h5 {
    color: var(--text-main);
    font-weight: 700;
    margin-bottom: 20px;
}
footer ul li a {
    color: var(--text-muted);
    font-weight: 500;
}
footer ul li a:hover { color: var(--primary-color); }
footer hr { border-color: var(--border-color); }
