/* =========================
   GLOBAL
========================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f3f3f3;
    color: #222;
    line-height: 1.5;
}


/* =========================
   HEADER
   LOGO LEFT + BANNER RIGHT
========================= */

header {
    width: 100%;
    margin: 0;
    padding: 0;
    background: #ffffff;
    border-bottom: 1px solid #ddd;
    overflow: hidden;
}

.header-content {
    width: 100%;
    height: 210px;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: row;
    align-items: stretch;
}


/* =========================
   LOGO AREA
========================= */

.logo-area {
    width: 250px;
    min-width: 250px;
    height: 210px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #ffffff;

    padding: 8px;

    overflow: hidden;
}

.logo-link {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    text-decoration: none;
}

.site-logo {
    width: 275px;
    height: 275px;
    max-width: none;
    max-height: none;
    object-fit: contain;
    transform: scale(1.25);
}




/* =========================
   BANNER AREA
========================= */

.banner-area {
    flex: 1;
    min-width: 0;

    height: 210px;

    overflow: hidden;

    background: #ffffff;
}

.site-banner {
    display: block;

    width: 100%;
    height: 210px;

    margin: 0;
    padding: 0;

    /*
     * Cover fills the entire available
     * banner area and gives the image
     * the larger/zoomed appearance.
     */
    object-fit: cover;

    /*
     * Center keeps the important middle
     * portion of the banner visible.
     */
    object-position: center center;
}


/* =========================
   AMAZON DISCLOSURE
========================= */

.disclosure {
    max-width: 1100px;

    margin: 14px auto 0;

    padding: 12px 18px;

    text-align: center;

    color: #333;

    background: #fff8e8;

    border: 1px solid #f0d99a;

    border-radius: 6px;

    font-size: 14px;
}


/* =========================
   SITE INTRO
========================= */

.site-intro {
    max-width: 1100px;

    margin: 30px auto 0;

    padding: 0 15px;

    text-align: center;

    color: #555;

    font-size: 14px;
}


/* =========================
   DEAL TABS
========================= */

.deal-tabs {
    max-width: 1100px;

    margin: 25px auto 0;

    padding: 0 15px;

    display: flex;

    gap: 10px;

    border-bottom: 1px solid #ddd;

    overflow-x: auto;
}

.deal-tab {
    border: none;

    background: transparent;

    color: #555;

    padding: 12px 18px;

    font-size: 15px;

    font-weight: bold;

    cursor: pointer;

    border-bottom: 3px solid transparent;

    transition:
        color 0.2s ease,
        border-color 0.2s ease;

    white-space: nowrap;
}

.deal-tab:hover {
    color: #111;
}

.deal-tab.active {
    color: #111;

    border-bottom-color: #ff9900;
}


/* =========================
   CONTROLS
========================= */

.controls {
    max-width: 1100px;

    margin: 25px auto 10px;

    padding: 0 15px;
}

.search-row {
    display: flex;

    gap: 10px;

    margin-bottom: 15px;
}

#searchInput {
    flex: 1;

    padding: 13px 15px;

    border: 1px solid #ccc;

    border-radius: 6px;

    font-size: 15px;

    outline: none;
}

#searchInput:focus {
    border-color: #ff9900;

    box-shadow:
        0 0 0 2px
        rgba(255, 153, 0, 0.15);
}

#sortSelect {
    width: 190px;

    padding: 13px 12px;

    border: 1px solid #ccc;

    border-radius: 6px;

    background: white;

    font-size: 14px;

    cursor: pointer;
}


/* =========================
   CATEGORY BUTTONS
========================= */

.categories {
    display: flex;

    flex-wrap: wrap;

    gap: 8px;
}

.category-button {
    border: 1px solid #ddd;

    background: white;

    color: #333;

    padding: 9px 14px;

    border-radius: 20px;

    cursor: pointer;

    font-size: 14px;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.category-button:hover {
    border-color: #ff9900;
}

.category-button.active {
    background: #ff9900;

    border-color: #ff9900;

    color: #111;

    font-weight: bold;
}


/* =========================
   KEYBOARD FOCUS
========================= */

.deal-tab:focus-visible,
.category-button:focus-visible,
.amazon-button:focus-visible,
#sortSelect:focus-visible,
#searchInput:focus-visible {
    outline: 3px solid #ff9900;

    outline-offset: 2px;
}


/* =========================
   SECTION HEADER
========================= */

.section-header {
    max-width: 1100px;

    margin: 25px auto 10px;

    padding: 0 15px;
}

.section-header-top {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 10px;
}

.section-header h2 {
    margin: 0;

    font-size: 26px;
}

#dealCount {
    color: #666;

    font-size: 14px;
}


/* =========================
   DEAL GRID
========================= */

#deals {
    max-width: 1100px;

    margin: 20px auto 40px;

    padding: 0 15px;

    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(280px, 1fr)
        );

    gap: 20px;
}


/* =========================
   DEAL CARD
========================= */

.deal {
    position: relative;

    background: white;

    border-radius: 10px;

    padding: 20px;

    box-shadow:
        0 2px 8px
        rgba(0, 0, 0, 0.10);

    display: flex;

    flex-direction: column;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.deal:hover {
    transform: translateY(-3px);

    box-shadow:
        0 5px 16px
        rgba(0, 0, 0, 0.15);
}


/* =========================
   BADGE
========================= */

.badge {
    position: absolute;

    top: 15px;

    left: 15px;

    background: #067d62;

    color: white;

    padding: 6px 9px;

    border-radius: 5px;

    font-size: 12px;

    font-weight: bold;

    z-index: 2;
}


/* =========================
   PAST DEAL
========================= */

.past-deal .badge {
    background: #666;
}

.past-deal-label {
    display: inline-block;

    align-self: flex-start;

    margin-bottom: 10px;

    padding: 5px 9px;

    background: #eeeeee;

    color: #555;

    border-radius: 4px;

    font-size: 12px;

    font-weight: bold;
}

.archive-date {
    margin-top: 7px;

    margin-bottom: 12px;

    color: #777;

    font-size: 12px;
}


/* =========================
   CATEGORY
========================= */

.category-label {
    margin-bottom: 10px;

    color: #666;

    font-size: 12px;

    text-transform: uppercase;

    letter-spacing: 0.5px;
}


/* =========================
   DEAL IMAGE
========================= */

.deal-image {
    width: 100%;

    height: 220px;

    object-fit: contain;

    margin-bottom: 15px;

    background: white;
}


/* =========================
   TITLE
========================= */

.deal h3 {
    margin: 5px 0 10px;

    font-size: 20px;

    line-height: 1.35;
}

.description {
    margin: 0;

    color: #555;

    line-height: 1.5;

    flex-grow: 1;
}


/* =========================
   PRICE
========================= */

.price-area {
    margin-top: 18px;
}

.price {
    font-size: 27px;

    font-weight: bold;

    color: #b12704;
}

.original-price {
    margin-left: 8px;

    color: #777;

    text-decoration: line-through;

    font-size: 16px;
}

.discount {
    display: inline-block;

    margin-left: 8px;

    padding: 5px 8px;

    background: #067d62;

    color: white;

    border-radius: 4px;

    font-size: 13px;

    font-weight: bold;
}

.price-note {
    margin-top: 7px;

    color: #777;

    font-size: 11px;
}


/* =========================
   AMAZON BUTTON
========================= */

.amazon-button {
    display: block;

    margin-top: 18px;

    padding: 13px;

    background: #ff9900;

    color: #111;

    text-align: center;

    text-decoration: none;

    border-radius: 6px;

    font-weight: bold;

    font-size: 16px;

    transition:
        background 0.2s ease;
}

.amazon-button:hover {
    background: #ffad33;
}

.paid-link {
    display: block;

    margin-top: 5px;

    text-align: center;

    color: #777;

    font-size: 11px;
}


/* =========================
   DISABLED BUTTON
========================= */

.disabled-button {
    background: #e0e0e0;

    color: #777;

    cursor: not-allowed;

    pointer-events: none;
}

.disabled-button:hover {
    background: #e0e0e0;
}


/* =========================
   PAST DEAL BUTTON
========================= */

.past-deal .amazon-button {
    background: #e0e0e0;

    color: #333;
}

.past-deal .amazon-button:hover {
    background: #d0d0d0;
}


/* =========================
   STATES
========================= */

.loading,
.error,
.no-results {
    text-align: center;

    grid-column: 1 / -1;

    padding: 50px 20px;

    color: #666;
}

.no-results h3 {
    margin-bottom: 8px;

    color: #333;
}


/* =========================
   FOOTER
========================= */

footer {
    margin-top: 40px;

    padding: 30px 15px;

    background: #232f3e;

    color: white;

    text-align: center;

    font-size: 13px;
}

footer p {
    margin: 7px 0;
}

footer a {
    color: #ffcc80;

    text-decoration: none;

    margin: 0 4px;
}

footer a:hover {
    text-decoration: underline;
}


/* =========================
   RESPONSIVE DESIGN
========================= */

@media (max-width: 768px) {

    /*
     * Keep logo and banner SIDE BY SIDE
     * on mobile as requested.
     */

    .header-content {
        height: 130px;

        flex-direction: row;
    }

    .logo-area {
        width: 125px;

        min-width: 125px;

        height: 130px;

        padding: 5px;
    }

    .site-logo {
        width: 115px;

        height: 120px;

        max-width: 115px;

        max-height: 120px;

        object-fit: contain;
    }

    .banner-area {
        height: 130px;

        flex: 1;
    }

    .site-banner {
        width: 100%;

        height: 130px;

        object-fit: cover;

        object-position: center center;
    }


    /* TABS */

    .deal-tabs {
        overflow-x: auto;
    }

    .deal-tab {
        white-space: nowrap;
    }


    /* SEARCH */

    .search-row {
        flex-direction: column;
    }

    #sortSelect {
        width: 100%;
    }


    /* SECTION HEADER */

    .section-header-top {
        align-items: flex-start;

        flex-direction: column;
    }


    /* DEAL GRID */

    #deals {
        grid-template-columns: 1fr;
    }


    /* DEAL IMAGE */

    .deal-image {
        height: 200px;
    }


    /* CATEGORIES */

    .categories {
        overflow-x: auto;

        flex-wrap: nowrap;

        padding-bottom: 5px;

        scrollbar-width: thin;
    }

    .category-button {
        flex: 0 0 auto;

        white-space: nowrap;
    }

}


/* =========================
   MOBILE LOGO
========================= */

@media (max-width: 768px) {

    .header-content {
        height: 130px;
        flex-direction: row;
    }

    .logo-area {
        width: 125px;
        min-width: 125px;
        height: 130px;
        padding: 0;
        overflow: hidden;
    }

    .site-logo {
        width: 155px;
        height: 140px;

        max-width: none;
        max-height: none;

        object-fit: contain;
        object-position: center;

        transform: scale(1.25);
        flex-shrink: 0;
    }

    .banner-area {
        height: 130px;
        flex: 1;
        min-width: 0;
    }

    .site-banner {
        width: 100%;
        height: 130px;

        object-fit: cover;
        object-position: center center;
    }
}


/* =========================
   VERY SMALL SCREENS
========================= */

@media (max-width: 420px) {

    .header-content {
        height: 105px;
    }

    .logo-area {
        width: 100px;
        min-width: 100px;
        height: 105px;
        padding: 0;
        overflow: hidden;
    }

    .site-logo {
        width: 155px;
        height: 140px;

        max-width: none;
        max-height: none;

        object-fit: contain;
        object-position: center;

        transform: scale(1.25);
        flex-shrink: 0;
    }

    .banner-area {
        height: 105px;
    }

    .site-banner {
        height: 105px;
    }
}

