/* --- Google Fonts for a Balanced Look --- */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* --- General & Core Layout --- */
:root {
    /* Color Palette (Balanced) */
    --primary-blue: #007BFF;
    --primary-red: #E74C3C;
    --primary-green: #2ECC71;
    --text-dark: #212529;
    --text-secondary: #6c757d;
    --background-main: #F1F3F6;
    --background-card: #FFFFFF;
    --border-subtle: #E9ECEF;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --box-shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.15);

    /* Font Families */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Roboto', sans-serif;

    /* Spacing Scale */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    margin: 0;
    background-color: var(--background-main);
    color: var(--text-dark);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-xl);
}

/* --- Header & Navigation --- */
.main-header {
    background-color: var(--background-card);
    border-bottom: 1px solid var(--border-subtle);
    padding: var(--space-md) 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-header .main-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* HIDE ANY ADS IN HEADER */
.main-header .adsbygoogle {
    display: none !important;
}

.logo a {
    text-decoration: none;
    transition: opacity 0.3s ease; /* Transition for the image hover */
}
.logo a:hover {
    opacity: 0.8; /* Subtle opacity change on hover */
}

.logo a img {
    max-height: 50px; /* Set a maximum height for the logo */
    width: auto; /* Maintain aspect ratio */
    vertical-align: middle; /* Align the image vertically */
}

.logo a:hover {
    color: var(--text-dark);
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.main-nav ul li {
    margin-left: var(--space-lg);
}

.main-nav ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95em;
    position: relative;
    transition: color 0.3s ease;
}

.main-nav ul li a:hover {
    color: var(--primary-blue);
}
.main-nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--primary-blue);
    left: 0;
    bottom: -5px;
    transition: width 0.3s ease;
}
.main-nav ul li a:hover::after {
    width: 100%;
}

/* --- Main Content Layout --- */
.main-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--space-xl);
    padding: var(--space-xl) 0;
    flex-grow: 1;
}

.page-title {
    grid-column: 1 / -1;
    font-family: var(--font-heading);
    font-size: 2em;
    font-weight: 700;
    color: var(--primary-blue);
    margin: 0 0 var(--space-lg) 0;
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--border-subtle);
    display: inline-block;
}

/* --- Deals Grid --- */
.deals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-xl);
}

.deal-card {
    background-color: var(--background-card);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.deal-card:hover {
    box-shadow: var(--box-shadow-hover);
    transform: translateY(-5px);
}

.deal-card a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.deal-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background-color: #FDFDFD;
    border-bottom: 1px solid var(--border-subtle);
    padding: var(--space-md);
    box-sizing: border-box;
}

.deal-info {
    padding: var(--space-lg);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.deal-store {
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    font-weight: 500;
}

.deal-title {
    font-family: var(--font-heading);
    font-size: 1.2em;
    margin: 0 0 var(--space-md) 0;
    line-height: 1.4;
    min-height: 55px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: var(--text-dark);
    font-weight: 700;
}

.price-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-top: auto;
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.discount-price {
    font-family: var(--font-heading);
    font-size: 1.8em;
    font-weight: 700;
    color: var(--primary-red);
    line-height: 1;
}

.original-price {
    font-size: 1em;
    color: var(--text-secondary);
    text-decoration: line-through;
    font-weight: 400;
}

.discount-off {
    background-color: var(--primary-green);
    color: var(--background-card);
    padding: var(--space-xs) var(--space-sm);
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
}

.deal-time {
    font-size: 0.75em;
    color: var(--text-secondary);
    text-align: right;
    margin-top: var(--space-sm);
}

/* --- Pagination --- */
.pagination {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: var(--space-xl);
    padding: var(--space-md) 0;
    background-color: var(--background-card);
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}


.page-link {
    display: block;
    padding: var(--space-sm) var(--space-md);
    margin: 0 var(--space-xs);
    text-decoration: none;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-weight: 500;
}

.page-link:hover:not(.active) {
    background-color: var(--primary-blue);
    color: var(--background-card);
    border-color: var(--primary-blue);
}

.page-link.active {
    background-color: var(--primary-blue);
    color: var(--background-card);
    border-color: var(--primary-blue);
    font-weight: 600;
    cursor: default;
}

.page-link.ellipsis {
    background-color: transparent;
    border-color: transparent;
    color: var(--text-secondary);
    cursor: default;
    padding: var(--space-sm) var(--space-xs);
}

.page-link.ellipsis:hover {
    background-color: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

/* --- Sidebar --- */
.sidebar {
    background-color: var(--background-card);
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    padding: var(--space-xl);
    align-self: flex-start;
    position: sticky;
    top: 100px;
}

.ad-section {
    margin-bottom: var(--space-xl);
    text-align: center;
}

.ad-section h3 {
    font-family: var(--font-heading);
    color: var(--primary-dark);
    font-size: 1.4em;
    font-weight: 700;
    margin-bottom: var(--space-md);
    border-bottom: 2px solid var(--border-subtle);
    padding-bottom: var(--space-sm);
    display: inline-block;
}

.ad-banner {
    background-color: var(--background-main);
    border: 1px solid var(--border-subtle);
    padding: var(--space-md);
    border-radius: 8px;
}

.ad-banner img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: var(--space-sm);
}

.ad-banner p {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li {
    margin-bottom: var(--space-md);
}

.sidebar ul li a {
    text-decoration: none;
    color: var(--primary-blue);
    font-size: 1em;
    font-weight: 500;
    transition: color 0.3s ease;
    display: block;
    padding: var(--space-xs) 0;
}

.sidebar ul li a:hover {
    color: var(--text-dark);
    text-decoration: underline;
}

/* --- Responsive Adjustments for Sidebar --- */
@media (max-width: 1024px) {
    .sidebar {
        display: none; /* Hides the sidebar on tablets and mobile phones */
    }
}

/* --- Footer --- */
.main-footer {
    background-color: var(--primary-blue);
    color: var(--background-card);
    padding: var(--space-xl) 0;
    text-align: center;
    margin-top: auto;
}

.main-footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-links {
    margin-bottom: var(--space-md);
}

.footer-links a {
    color: var(--background-card);
    text-decoration: none;
    margin: 0 var(--space-md);
    font-size: 0.9em;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary-green);
}

.social-media {
    margin-top: var(--space-lg);
    margin-bottom: var(--space-md);
}

.social-media a {
    color: var(--border-subtle);
    font-size: 1.8em;
    margin: 0 var(--space-sm);
    transition: color 0.3s ease;
}

.social-media a:hover {
    color: var(--primary-blue);
}

.main-footer p {
    font-size: 0.85em;
    margin: 0;
    color: var(--border-subtle);
}

/* --- DEAL DETAIL PAGE --- */
.deal-detail-page {
    grid-column: 1 / span 1;
    background-color: var(--background-card);
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.deal-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.deal-title-main {
    font-family: var(--font-heading);
    font-size: 2.8em;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1.25;
    margin-bottom: var(--space-sm);
}

.deal-store-detail {
    font-size: 1.15em;
    color: var(--text-secondary);
    font-weight: 500;
}

.deal-store-detail .store-name {
    color: var(--primary-dark);
    font-weight: 700;
}

.deal-content {
    display: flex;
    gap: var(--space-xl);
    margin: 0 auto var(--space-xl) auto;
    max-width: 1000px;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
}

.deal-image-large {
    flex: 1;
    min-width: 350px;
    max-width: 50%;
    text-align: center;
    padding: var(--space-xl);
    background-color: var(--background-main);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.deal-image-large img {
    max-width: 100%;
    max-height: 450px;
    object-fit: contain;
    border-radius: 8px;
}

.deal-details-box {
    flex: 1;
    min-width: 350px;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.price-section {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
    background-color: var(--background-main);
    padding: var(--space-lg);
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
}

.price-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.discount-price-large {
    font-family: var(--font-heading);
    font-size: 2.8em;
    font-weight: 700;
    color: var(--primary-red);
    line-height: 1;
}

.original-price-large {
    font-size: 1.3em;
    color: var(--text-secondary);
    text-decoration: line-through;
    font-weight: 500;
}

.discount-off-large {
    background-color: var(--primary-green);
    color: var(--background-card);
    padding: var(--space-sm) var(--space-md);
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-left: auto;
}

.buy-now-button {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    padding: var(--space-md) var(--space-xl);
    background-color: var(--primary-blue);
    color: var(--background-card);
    text-align: center;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 700;
    border-radius: 8px;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.2);
}

.buy-now-button:hover {
    background-color: var(--text-dark);
    color: var(--background-card);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.buy-now-button i {
    margin-right: var(--space-sm);
    font-size: 1em;
}

.deal-meta {
    font-size: 0.9em;
    color: var(--text-secondary);
    text-align: center;
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px dashed var(--border-subtle);
}

.deal-description-placeholder {
    margin-top: var(--space-xl);
    background-color: var(--background-card);
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    padding: var(--space-xl);
    width: 100%;
}

.deal-description-placeholder h3 {
    font-family: var(--font-heading);
    color: var(--primary-dark);
    font-size: 1.5em;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--border-subtle);
    display: inline-block;
}

.deal-description-placeholder p {
    font-size: 1em;
    color: var(--text-secondary);
    line-height: 1.7;
}

.why-hot-section {
    background-color: var(--background-main);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: var(--space-md) var(--space-lg);
    margin-top: var(--space-lg);
    text-align: left;
}

.why-hot-section h4 {
    font-family: var(--font-heading);
    font-size: 1.2em;
    color: var(--primary-dark);
    font-weight: 700;
    margin-top: 0;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
}

.why-hot-section h4 i {
    margin-right: var(--space-sm);
    font-size: 1.2em;
    color: var(--primary-red);
}

.hot-features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hot-features-list li {
    font-size: 0.95em;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    line-height: 1.6;
}

.hot-features-list li strong {
    color: var(--primary-dark);
}

.related-deals-section {
    grid-column: 1 / span 1;
    margin-top: var(--space-xl);
    padding: var(--space-xl);
    background-color: var(--background-card);
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}

.related-deals-section h2 {
    font-family: var(--font-heading);
    text-align: center;
    font-size: 2em;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: var(--space-xl);
    border-bottom: 2px solid var(--border-subtle);
    padding-bottom: var(--space-md);
    display: inline-block;
}

.related-deals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-lg);
}

.deal-card.small-card {
    box-shadow: none;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    transition: box-shadow 0.3s ease;
}

.deal-card.small-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.deal-card.small-card img {
    height: 160px;
    padding: var(--space-sm);
}

.deal-card.small-card .deal-info {
    padding: var(--space-md);
}

.deal-card.small-card .deal-store {
    font-size: 0.7em;
}

.deal-card.small-card .deal-title {
    font-size: 1em;
    min-height: 40px;
    margin-bottom: var(--space-sm);
}

.deal-card.small-card .discount-price {
    font-size: 1.6em;
}

.deal-card.small-card .original-price {
    font-size: 0.9em;
}

.deal-card.small-card .discount-off {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.7em;
}

/* --- Responsive Adjustments --- */
@media (max-width: 1024px) {
    .main-content-wrapper {
        grid-template-columns: 1fr;
        padding: var(--space-lg) 0;
        gap: var(--space-xl);
    }
    .page-title {
        text-align: center;
        margin: 0 var(--space-lg) var(--space-lg) var(--space-lg);
        max-width: unset;
        font-size: 2em;
    }
    .deal-detail-page {
        padding: var(--space-lg);
    }
    .deal-title-main {
        font-size: 2.2em;
    }
    .deal-content {
        flex-direction: column;
        align-items: center;
        max-width: 700px;
    }
    .deal-details-box {
        min-width: unset;
        width: 100%;
    }
    .discount-price-large {
        font-size: 2.8em;
    }
    .related-deals-section {
        margin-top: var(--space-xl);
        padding: var(--space-lg);
    }
    .sidebar {
        order: -1;
        position: static;
        margin-bottom: var(--space-lg);
        padding: var(--space-lg);
    }
    .main-header .main-header-content {
        flex-direction: column;
    }
    .main-nav {
        margin-top: var(--space-md);
    }
    .deals-grid {
        gap: var(--space-md);
    }
}

@media (max-width: 768px) {
    .deals-grid {
        grid-template-columns: 1fr;
    }
    .page-title {
        font-size: 1.8em;
        margin-bottom: var(--space-md);
    }
    .deal-card img {
        height: 180px;
    }
    .deal-info {
        padding: var(--space-md);
    }
    .deal-title {
        font-size: 1.1em;
        min-height: auto;
    }
    .deal-card.small-card {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }
    .deal-card.small-card:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    .pagination {
        padding: var(--space-sm) 0;
    }
    .page-link {
        padding: var(--space-xs) var(--space-sm);
        margin: var(--space-xs);
        font-size: 0.9em;
    }
    .deal-title-main {
        font-size: 2.2em;
    }
    .deal-content {
        gap: var(--space-lg);
    }
    .deal-image-large {
        min-width: unset;
        padding: var(--space-md);
    }
    .deal-details-box {
        gap: var(--space-md);
    }
    .price-section {
        flex-direction: column;
        align-items: center;
        gap: var(--space-md);
        padding: var(--space-md);
    }
    .discount-price-large {
        font-size: 2.8em;
    }
    .original-price-large {
        font-size: 1.2em;
    }
    .discount-off-large {
        font-size: 1em;
        padding: var(--space-sm) var(--space-md);
        margin-left: unset;
        width: fit-content;
    }
   /* --- Buy Now Button Styles --- */
.buy-now-button {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    padding: var(--space-md) var(--space-xl);
    background-color: var(--primary-blue);
    color: var(--background-card);
    text-align: center;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 700;
    border-radius: 8px;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.2);
}

.buy-now-button:hover {
    background-color: var(--text-dark);
    color: var(--background-card);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.buy-now-button i {
    margin-right: var(--space-sm);
    font-size: 1em;
}

.buy-now-button .button-text {
    display: flex;
    flex-direction: column; /* Stacks the text vertically */
    align-items: center;
    line-height: 1.2;
}

.buy-now-button .button-text span {
    font-size: 1em; /* Main button text size */
}

.buy-now-button .button-text .redirect-text {
    font-size: 0.7em; /* Smaller text for the redirection message */
    font-weight: 400;
    opacity: 0.8;
}
    .deal-meta {
        font-size: 0.9em;
        padding-top: var(--space-sm);
        margin-top: var(--space-sm);
    }
    .related-deals-section {
        padding: var(--space-lg);
        margin-top: var(--space-xl);
    }
    .related-deals-section h2 {
        font-size: 1.8em;
        margin-bottom: var(--space-lg);
    }
    .related-deals-grid {
        grid-template-columns: 1fr;
    }
    .footer-links a {
        font-size: 0.85em;
        margin: 0 var(--space-sm);
    }
}
/* --- Utility Classes & Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--background-main);
}
::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #95A5A6;
}
/* --- Two-line Button Styles --- */
.buy-now-button .button-text {
    display: flex;
    flex-direction: column; /* Stacks the text vertically */
    align-items: center;
    line-height: 1.2;
}

.buy-now-button .button-text span {
    font-size: 1em; /* Main button text size */
}

.buy-now-button .button-text .redirect-text {
    font-size: 0.7em; /* Smaller text for the redirection message */
    font-weight: 400;
    opacity: 0.8;
}