:root {
    --cc-blue-dark: #3E6DB2;
    --cc-blue-light: #99B9E3;
    --cc-blue-med: #7895C9;
    --cc-blue-gray: #AEBED5;
    --cc-card-gray: #DEE4ED;
    --cc-white: #FDFDFD;
    --cc-green: #429289;
    --cc-text-main: #333333;
    --cc-text-muted: #777777;
    --cc-radius-lg: 16px;
    --cc-radius-md: 10px;
    --cc-shadow-soft: 0 14px 40px rgba(0, 0, 0, 0.08);
}

/* Page background */
html {
    height: 100%;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f3f5f9;
    color: var(--cc-text-main);
    height: 100%;
}

.cc-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Hero header */
.cc-hero {
    background: linear-gradient(180deg, var(--cc-blue-light), var(--cc-blue-dark));
    padding: 24px 16px 64px;
}

.cc-hero-inner {
    max-width: 460px;
    margin: 0 auto;
}

/* Brand row */
.cc-brand {
    display: flex;
    align-items: center;
    color: #ffffff;
    margin-bottom: 18px;
}

/* Search card */
.cc-search-card {
    background: var(--cc-white);
    border-radius: var(--cc-radius-lg);
    box-shadow: var(--cc-shadow-soft);
    min-width: unset;
    width: 100%;
    padding: 16px;
    margin-bottom: 18px;
}

/* Modern search wrapper */
.cc-search-wrapper {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

/* Modern rounded input */
.cc-search-input-modern {
    width: 100%;
    padding: 14px 60px 14px 18px;
    border-radius: 999px;
    border: none;
    background: #fff;
    font-size: 16px;
    color: #333;
    outline: none;
    box-shadow: 0 4px 18px rgba(0,0,0,0.08);
    box-sizing: border-box;
}

.cc-search-input-modern::placeholder {
    color: #bbb;
}

/* Dark circular search button */
.cc-search-btn-modern {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--cc-blue-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.cc-search-btn-modern:hover {
    filter: brightness(1.08);
}

/* Search icon */
.cc-search-icon-modern {
    width: 25px;
    height: 25px;
    fill: #fff;
    transform-origin: center;
}

/* Autocomplete dropdown container */
.cc-autocomplete-list {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--cc-white);
    border: 1px solid var(--cc-blue-gray);
    border-radius: var(--cc-radius-md);
    box-shadow: var(--cc-shadow-soft);
    max-height: 260px;
    overflow-y: auto;
    z-index: 50;
    display: none;
}

/* Autocomplete items (dynamic, used by JS) */
.cc-autocomplete-item {
    display: flex;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.cc-autocomplete-item:last-child {
    border-bottom: none;
}

.cc-autocomplete-item.active {
    background: #eef3ff;
}

.cc-autocomplete-logo {
    width: 32px;
    height: 18px;
    object-fit: contain;
    margin-right: 10px;
}

.cc-autocomplete-name {
    font-size: 14px;
    color: var(--cc-text-main);
}

/* Shop card */
.cc-shop-card {
    min-width: unset;
    width: 100%;
    background: var(--cc-white);
    border-radius: var(--cc-radius-lg);
    box-shadow: var(--cc-shadow-soft);
    padding: 18px 16px;
}

/* Top row of shop card: left (logo+meta) + right (badge) */
.cc-shop-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Left side: logo + text */
.cc-shop-left {
    display: flex;
    align-items: center;
}

/* Logo */
.cc-shop-logo {
    flex: 0 0 auto;
    margin-right: 10px;
}

.cc-shop-logo-img {
    max-width: 90px;
    max-height: 36px;
    object-fit: contain;
    display: inline-block;
}

.cc-shop-logo-img[style*="display: none"] {
    width: 0 !important;
    height: 0 !important;
}

/* Meta (name + domain) */
.cc-shop-meta {
    flex: 1 1 auto;
}

.cc-shop-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 2px;
}

.cc-shop-domain {
    font-size: 11px;
    color: var(--cc-blue-dark);
    text-decoration: none;
}

.cc-shop-domain:hover {
    text-decoration: underline;
}

/* Badge on the right */
.cc-shop-badge {
    flex: 0 0 auto;
    margin-left: 8px;
}

.cc-badge-count {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: var(--cc-blue-med);
    color: #ffffff;
}

/* Description below the whole top area */
.cc-shop-desc {
    margin-top: 10px;
    font-size: 12px;
    color: var(--cc-text-muted);
    line-height: 1.45;
    display: block;
    width: 100%;
}

/* Categories container (full width under description) */
.cc-shop-cats {
    margin-top: 10px;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Category badge */
.cc-shop-cat-badge {
    background: var(--cc-green);
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}

/* Main content */
.cc-main {
    max-width: 460px;
    min-width: unset;
    width: 100%;
    margin: -32px auto 32px;
    padding: 0 16px 16px;
    flex: 1 0 auto;
}

.cc-section {
    background: var(--cc-white);
    border-radius: var(--cc-radius-lg);
    padding: 18px 16px 20px;
    box-shadow: var(--cc-shadow-soft);
}

.cc-section-title {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--cc-text-main);
}

.cc-empty {
    font-size: 13px;
    color: var(--cc-text-muted);
}

/* Coupon card wrapper */
.cc-coupon-card {
    padding: 0;
    margin: 24px 0;
    border: none;
    background: none;
    box-shadow: none;
}


/* Modern coupon layout (vertical) */
.cc-coupon-modern {
    background: #ffffff;
    border-radius: var(--cc-radius-md);
    box-shadow: var(--cc-shadow-soft);
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0;   
    transition: transform 0.15s ease, box-shadow 0.15s ease; 
}


.cc-coupon-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(0,0,0,0.1);
}


/* Top blue bar */
.cc-coupon-bar {
    background: var(--cc-blue-dark);
    color: #fff;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cc-coupon-discount {
    font-size: 18px;
    font-weight: 700;
}

.cc-coupon-dates {
    text-align: right;
    font-size: 11px;
    line-height: 1.3;
}

/* Applicability row */
.cc-coupon-app {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    gap: 10px;
}

.cc-applicable-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
}

.cc-applicability-text {
    font-size: 12px;
    color: var(--cc-text-muted);
}

/* Code + shop row */
.cc-coupon-action {
    padding: 10px 16px 16px;
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Modern code group (dynamic variant) */
.cc-code-group {
    display: flex;
    align-items: center;
    flex: 1;
    border: 1px solid var(--cc-blue-med);
    border-radius: 6px;
    overflow: hidden;
}

.cc-code-copy-btn {
    background: var(--cc-blue-light);
    border: none;
    padding: 0 10px;
    cursor: pointer;
    font-size: 14px;
}

.cc-code-input-modern {
    flex: 1;
    padding: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
}

/* Code image used on this page */
.cc-code-wrapper {
    position: relative;
    width: 100%;
    display: flex;           /* make it a flex container */
    align-items: center;     /* vertical centering */    
}


/* Unified explicit height for BOTH elements (in em) */
.cc-shop-button-modern,
.cc-code-image {
    height: 2.75em;        /* explicit em height */
    padding: 0 1.5em;      /* only horizontal, in em */
    display: inline-flex;
    align-items: center;   /* vertical centering */
    justify-content: center;
}

/* Shop button: horizontal padding in em, no vertical padding */
.cc-shop-button-modern {

    line-height: 2.75em;   /* ensures internal text sits centered */
    font-weight: 700;
    border-radius: 0.5em;
    background: var(--cc-green);
    color: white;
    text-decoration: none;
    white-space: nowrap;
}

/* Coupon code image — scaled properly */
.cc-code-image {
    width: auto;
    object-fit: contain;   /* avoids distortion inside fixed height */
}


/* Promo Section */
.cc-promo-section {
    margin-top: 18px;
    text-align: center;
}

.cc-promo-text {
    font-size: 13px;
    color: var(--cc-text-muted);
    margin: 0 0 16px;
}

.cc-promo-separator {
    width: 100%;
    height: 1px;
    background: rgba(174, 190, 213, 0.6);
    margin: 22px 0;
}

/* Buttons uniform size */
.cc-store-badge {
    height: 50px;
    object-fit: contain;
    transition: transform 0.15s ease;
}

.cc-store-badge:hover {
    transform: scale(1.05);
}

/* Centered column layout, responsive */
.cc-promo-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

@media (min-width: 480px) {
    .cc-promo-buttons {
        flex-direction: row;
        justify-content: center;
        gap: 20px;
    }
}

/* Footer */
.cc-footer {
    background: #333;
    color: #ffffff;
    padding: 32px 0;
    margin-top: 40px;
    flex-shrink: 0;
}

.cc-footer-inner {
    max-width: 460px;
    margin: 0 auto;
    padding: 0 16px;
    text-align: center;
}

/* Logo */
.cc-footer-brand {
    margin-bottom: 12px;
}

.cc-footer-logo {
    height: 32px;
    width: auto;
    opacity: 0.95;
}

/* Text */
.cc-footer-text {
    font-size: 12px;
    margin-bottom: 8px;
    opacity: 0.9;
}

/* Links */
.cc-footer-links {
    font-size: 12px;
}

.cc-footer-links a {
    color: #ffffff;
    text-decoration: none;
}

.cc-footer-links a:hover {
    text-decoration: underline;
}

.cc-footer-separator {
    margin: 0 6px;
    opacity: 0.6;
}


.cc-coupon-card,
.cc-shop-card,
.cc-search-card,
.cc-section {
    box-sizing: border-box;
}


/* Responsive tweaks */
@media (min-width: 480px) {
    .cc-hero-inner,
    .cc-footer-inner,
    .cc-main {
        max-width: 460px;
    }
}


@media (max-width: 480px) {

    /* ===== FIX MAIN CONTAINER WIDTH ===== */
    .cc-main {
        padding-left: 8px !important;
        padding-right: 8px !important;
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* ===== FIX HERO BACKGROUND CLIPPING ===== */
    .cc-hero {
        padding-left: 0 !important;
        padding-right: 0 !important;
        box-sizing: border-box !important;
        width: 100% !important;
    }

    .cc-hero-inner {
        padding-left: 8px !important;
        padding-right: 8px !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    /* ===== FIX FOOTER BACKGROUND CLIPPING ===== */
    .cc-footer-inner {
        padding-left: 8px !important;
        padding-right: 8px !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    /* ===== ALL CARDS FULL WIDTH ===== */
    .cc-search-card,
    .cc-shop-card,
    .cc-section,
    .cc-coupon-modern {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* ===== FIX SHOP BUTTON BEING CUT ===== */
    .cc-code-wrapper {
        flex: 1 1 auto;
        min-width: 0 !important; /* CRITICAL */
    }

    .cc-shop-button-modern {
        flex-shrink: 0;
        padding: 0 1em !important; /* reduces width on mobile */
    }

    /* ===== OPTIONAL: SHRINK CODE IMAGE TO AVOID OVERFLOW ===== */
    .cc-code-image {
        max-width: 100%;
    }
}





