/* FILE: /assets/css/style.css (Global Frontend Stylesheet) */

:root {
    --primary-color: #e60000;
    --secondary-color: #333;
    --light-bg: #f5f5f5;
    --dark-text: #333;
    --border-color: #ddd;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
}

body {
    font-family: 'Roboto', sans-serif;
    color: var(--dark-text);
    background-color: var(--light-bg);
    margin: 0;
    padding: 0;
}

/* Header, Nav, Footer, and other general styles */
.main-header {
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
}

.header-top {
    padding: 8px 0;
    background-color: #f8f8f8;
    border-bottom: 1px solid #eee;
}

.header-top .container, .header-main .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-top-left a {
    color: #666;
    font-size: 13px;
    margin-right: 15px;
    text-decoration: none;
}

.header-top-left a:hover {
    color: var(--primary-color);
}

.header-main {
    padding: 15px 0;
}

.logo img {
    max-height: 50px;
    max-width: 250px; /* --- LOGO WIDTH UPDATED HERE --- */
    width: auto;
    vertical-align: middle;
}

.main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding-left: 0;
}

.main-nav ul li a {
    color: var(--secondary-color);
    font-weight: 500;
    padding: 8px 15px;
    text-transform: uppercase;
    font-size: 14px;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
}

.main-nav ul li a:hover {
    background-color: var(--primary-color);
    color: white;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-action-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.navbar-toggler {
    border: none;
    background: transparent;
    color: var(--secondary-color);
    font-size: 20px;
    margin-left: 10px; /* Added padding */
}

.search-box {
    position: relative;
    margin-right: 15px;
}

.search-box input {
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 6px 35px 6px 15px;
    width: 200px;
    font-size: 13px;
}

.search-box button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
}

.header-actions a {
    color: #666;
    font-size: 14px;
    text-decoration: none;
}

.header-actions a:hover {
    color: var(--primary-color);
}

.red-nav {
    background-color: var(--primary-color);
    padding: 0;
}

.red-nav .navbar-nav {
    display: flex;
    width: 100%;
}

.red-nav .nav-item {
    flex: 1;
    text-align: center;
}

.red-nav .nav-link {
    color: white;
    font-weight: 500;
    padding: 12px 0;
    text-transform: uppercase;
    font-size: 14px;
    border-right: 1px solid rgba(255,255,255,0.2);
    text-decoration: none;
}

.red-nav .nav-item:last-child .nav-link {
    border-right: none;
}

.red-nav .nav-link:hover {
    background-color: rgba(0,0,0,0.1);
}

.main-container {
    margin-top: 20px;
}

.content-card {
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

/* Breadcrumb */
.breadcrumb {
    background-color: transparent;
    padding: 15px 0;
    margin-bottom: 0;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: #666;
}

.breadcrumb-item.active {
    color: var(--primary-color);
}

/* Home Page Styles */
.product-finder {
    background-color: white;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.product-finder h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 18px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
}

.finder-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.finder-tab {
    padding: 8px 15px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-right: 5px;
}

.finder-tab.active {
    border-bottom: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 500;
}

.finder-content {
    display: none;
}

.finder-content.active {
    display: block;
}

.finder-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.finder-form .form-select, .finder-form .form-control {
    flex: 1;
    min-width: 150px;
}

.price-range-container {
    flex: 2;
    min-width: 250px;
}

.price-range-display {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 13px;
    color: #666;
}

.finder-form button {
    background-color: var(--primary-color);
    border: none;
    color: white;
    padding: 8px 20px;
    border-radius: 3px;
    font-weight: 500;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
}

.section-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--secondary-color);
}

.section-header a {
    color: var(--primary-color);
    font-size: 14px;
    text-decoration: none;
}

.latest-phones, .popular-phones, .popular-brands {
    background-color: white;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.latest-phones-grid, .phone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.phone-item {
    border: 1px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
    transition: transform 0.2s;
}

.phone-item a {
    text-decoration: none;
    color: inherit;
}

.phone-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.phone-img {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
    padding: 10px;
}

.phone-img img {
    max-height: 100%;
    max-width: 100%;
}

.phone-details {
    padding: 10px;
}

.phone-name {
    font-weight: 500;
    margin-bottom: 5px;
    font-size: 14px;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.phone-price {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 16px;
}

.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.brand-item {
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 15px 10px;
    transition: all 0.2s;
}

.brand-item a {
    text-decoration: none;
    color: inherit;
}

.brand-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(230,0,0,0.3);
}

.brand-item img {
    max-height: 40px;
    margin-bottom: 8px;
    filter: grayscale(100%);
    transition: filter 0.2s;
}

.brand-item:hover img {
    filter: grayscale(0%);
}

.brand-name {
    font-size: 14px;
    font-weight: 500;
}

.sidebar {
    position: sticky;
    top: 20px;
}

.sidebar-section {
    background-color: white;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.sidebar-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--secondary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
}

.list-group-item a {
    text-decoration: none;
    color: var(--secondary-color);
}

.list-group-item a:hover {
    color: var(--primary-color);
}

.trending-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.trending-list li {
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color);
    display: flex;
    align-items: flex-start;
}

.trending-list li:last-child {
    border-bottom: none;
}

.trending-number {
    background-color: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    margin-right: 10px;
    flex-shrink: 0;
}

.trending-title {
    font-size: 14px;
    line-height: 1.4;
}

/* --- NEW ADVERTISEMENT STYLES --- */
.ad-container {
    margin-bottom: 20px;
    text-align: center;
}

.ad-container img {
    max-width: 100%;
    height: auto;
}

/* Specific styling for the after-header ad */
.ad-after-header {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
}

/* Product Page Styles */
.product-container {
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.product-row-v1 {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.product-image-section-v1 {
    flex: 1;
    min-width: 300px;
    padding-right: 20px;
}

.product-image-container-v1 {
    position: relative;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
}

.product-main-image-v1 {
    width: 100%;
    display: block;
}

.product-thumbnails-v1 {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.product-thumbnail-v1 {
    width: 80px;
    height: 80px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
    overflow: hidden;
}

.product-thumbnail-v1:hover,
.product-thumbnail-v1.active {
    border-color: var(--primary-color);
}

.product-thumbnail-v1 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info-section-v1 {
    flex: 1;
    min-width: 300px;
    padding-left: 20px;
    border-left: 1px solid var(--border-color);
}

.product-title-v1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.product-meta-v1 {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.product-brand-v1 {
    font-size: 16px;
    color: #666;
    margin-right: 15px;
}

.product-rating-v1 {
    display: flex;
    align-items: center;
}

.product-rating-v1 .stars {
    color: #ffc107;
    margin-right: 5px;
}

.product-rating-v1 .rating-count {
    color: #666;
    font-size: 14px;
}

.product-price-section-v1 {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.product-price-v1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
}

.product-price-v1 .original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 20px;
    margin-left: 10px;
}

.product-price-v1 .discount-badge {
    background-color: var(--danger-color);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 14px;
    margin-left: 10px;
    font-weight: 400;
}

.product-actions-v1 {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.product-actions-v1 .btn {
    padding: 12px 20px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 16px;
}

.product-availability-v1 {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.availability-icon-v1 {
    color: var(--success-color);
    margin-right: 10px;
    font-size: 18px;
}

.availability-text-v1 {
    font-size: 16px;
}

.key-specs-v1 h5 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--secondary-color);
    font-weight: 600;
}

.specs-icons-v1 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.spec-item-v1 {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    transition: all 0.3s;
}

.spec-item-v1:hover {
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.spec-icon-v1 {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.spec-label-v1 {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.spec-value-v1 {
    font-size: 16px;
    font-weight: 600;
}

.product-tabs {
    margin-bottom: 20px;
}

.product-tabs .nav-tabs {
    border-bottom: 2px solid var(--border-color);
}

.product-tabs .nav-link {
    color: var(--secondary-color);
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 12px 20px;
    font-weight: 500;
    font-size: 16px;
}

.product-tabs .nav-link:hover {
    border-color: transparent;
    color: var(--primary-color);
}

.product-tabs .nav-link.active {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: transparent;
}

.product-tabs .tab-content {
    padding: 20px 0;
}

.spec-category {
    margin-bottom: 25px;
}

.spec-category h5 {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
}

.spec-table tr {
    border-bottom: 1px solid #f0f0f0;
}

.spec-table tr:last-child {
    border-bottom: none;
}

.spec-table td {
    padding: 12px 5px;
    vertical-align: top;
}

.spec-table td:first-child {
    width: 40%;
    font-weight: 500;
    color: #555;
}

.review-item {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.review-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.reviewer-info {
    display: flex;
    align-items: center;
}

.reviewer-name {
    font-weight: 500;
}

.review-date {
    font-size: 14px;
    color: #666;
    margin-left: 10px;
}

.review-rating {
    color: #ffc107;
}

.review-content {
    margin-bottom: 15px;
    line-height: 1.6;
}

/* Footer */
footer {
    background-color: #222;
    color: #ccc;
    padding: 30px 0 20px;
    margin-top: 30px;
}

footer h5 {
    color: white;
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: 600;
}

footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

footer ul li {
    margin-bottom: 8px;
}

footer ul li a {
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
}

footer ul li a:hover {
    color: white;
}

.copyright {
    border-top: 1px solid #444;
    padding-top: 15px;
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
}

/* --- UPDATED RELATED PRODUCTS STYLES --- */
.related-products {
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.related-products h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--secondary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
}

.related-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.related-product-item {
    border: 1px solid #e5e7eb;
    border-radius: 5px;
    overflow: hidden;
    transition: all 0.2s ease-in-out;
    background-color: #ffffff;
}

.related-product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.related-product-item a {
    text-decoration: none;
    color: inherit;
}

.related-product-img {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
    padding: 10px;
}

.related-product-img img {
    max-height: 100%;
    max-width: 100%;
}

.related-product-details {
    padding: 1rem;
}

.related-product-name {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.9rem;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: var(--secondary-color);
}

.related-product-price {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1rem;
}

.card-body a {
    text-decoration: none;
    color: inherit;
}

.card-body a:hover {
    color: var(--primary-color);
}

/* Popular Comparisons */
.popular-comparisons {
    background-color: white;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.comparison-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.comparison-item {
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 15px;
    transition: all 0.2s;
}

.comparison-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.comparison-title {
    font-weight: 500;
    margin-bottom: 10px;
    font-size: 16px;
    color: var(--primary-color);
}

.comparison-phones {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.comparison-phones img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-right: 10px;
}

.comparison-phones .vs {
    margin: 0 10px;
    font-weight: 600;
    color: #666;
}

.comparison-result {
    font-size: 14px;
    color: #666;
}

.comparison-result .winner {
    color: var(--primary-color);
    font-weight: 500;
}

/* Remove underline & default blue from Trending Topics only */
.trending-list a {
    color: inherit;         /* Inherit text color from parent */
    text-decoration: none;  /* Remove underline */
}

.trending-list a:hover {
    color: #007bff;         /* Optional: add hover color */
    text-decoration: none;  /* Optional: underline on hover */
}

/* --- NEW HEADER LINK FIXES --- */
/* Fix header links - remove underline and blue color */
.main-header a {
    text-decoration: none;
    color: inherit;
}

.main-header a:visited {
    color: inherit;
}

.main-header a:hover {
    text-decoration: none;
}

/* Ensure specific header sections maintain their intended styling */
.header-top-left a {
    color: #666;
    text-decoration: none;
}

.header-top-left a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.main-nav ul li a {
    color: var(--secondary-color);
    text-decoration: none;
}

.main-nav ul li a:hover {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
}

.header-actions a {
    color: #666;
    text-decoration: none;
}

.header-actions a:hover {
    color: var(--primary-color);
    text-decoration: none;
}


/* Add these new styles to the end of your style.css file */

/* --- Product Badges --- */
/* --- NEW: Corner Badges for Products and News --- */

/* Container for positioning badges */
/* --- REVISED CORNER BADGES FOR PRODUCTS & NEWS --- */
/* ============================================================================== */
/* --- PRODUCT & NEWS BADGES (CORRECTED VISIBILITY) --- */
/* ============================================================================== */

/* Make sure the parent item can contain the absolutely positioned badges */
.phone-item, .news-card-item, .trending-list li, .list-group-item {
    position: relative;
}

/* This container holds all badges in the top-left corner. It MUST be visible. */
.badge-container {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex; /* Arrange badges side-by-side */
    align-items: center;
    gap: 6px; /* Space between badges */
    z-index: 10;
    visibility: visible !important; /* Force visibility, overriding any hover rules */
    opacity: 1 !important;          /* Force opacity */
}

/* This is the base style for the new circular badges */
.badge-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #dc3545; /* Red background for all badges */
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 13px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.4);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    border: 2px solid white;
}

/* Specific style for the "New" badge icon */
.new-badge i {
    font-size: 1rem;
}


/* Explicitly hide any old styles that might conflict */
.discount-badge-corner, .phone-item > .new-badge, .news-card-item > .new-badge {
    display: none !important;
}