/* ==========================================================================
   Cozy Centers Router Styles (WoodMart Inspired)
   ========================================================================== */

:root {
    --clr-primary: #0052B4;
    --clr-primary-hover: #00418f;
    --clr-text: #2D2A26;
    --clr-text-muted: #767676;
    --clr-bg: #FFFFFF;
    --clr-surface: #F8F9FA;
    --clr-border: #E5E5E5;

    --font-heading: 'Lexend', sans-serif;
    --font-body: 'Cabin', sans-serif;

    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--clr-text);
    background-color: var(--clr-bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 3rem 0;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../P1046667.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    filter: blur(6px);
    -webkit-filter: blur(6px);
    transform: scale(1.1);
    /* Prevents white edges from blur */
    z-index: -1;
}

.container {
    max-width: 1120px;
    width: 90%;
    margin: 2rem auto;
    padding: 3rem 2rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.router-main {
    width: 100%;
    text-align: center;
}

/* Header & Logo */
.router-header {
    margin-bottom: 3.5rem;
}

.logo {
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-logo {
    max-width: 280px;
    width: 100%;
    height: auto;
}

/* Content Area */
.status-box {
    margin-bottom: 2rem;
    transition: var(--transition);
}

.status-box.fade-out {
    opacity: 0;
    transform: translateY(-20px);
}

.loader {
    width: 40px;
    height: 40px;
    border: 3px solid var(--clr-surface);
    border-top: 3px solid var(--clr-primary);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

h1 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

/* Selection Grid */
.selection-grid {
    transition: var(--transition);
    animation: fadeIn 0.5s ease forwards;
}

.hidden {
    display: none;
    opacity: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.grid-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: var(--clr-text-muted);
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
    perspective: 1000px;
    /* Essential for 3D effect */
}

.shop-card {
    background: var(--clr-surface);
    padding: 1.75rem 1rem;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--clr-border);
    transition: var(--transition), transform 0.1s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    transform-style: preserve-3d;
}

.shop-card:hover {
    transform: translateY(-5px);
    border-color: var(--clr-primary);
    box-shadow: 0 10px 25px rgba(0, 82, 180, 0.08);
}

.flag-wrapper {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.flag-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-card h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.shop-card span {
    font-size: 0.85rem;
    color: var(--clr-text-muted);
    overflow-wrap: anywhere;
}

/* Redirect Bar */
.redirect-bar {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--clr-border);
}

.progress-container {
    width: 100%;
    max-width: 300px;
    height: 4px;
    background: var(--clr-surface);
    margin: 0 auto 1rem;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--clr-primary);
    width: 0%;
    transition: width 0.1s linear;
}

#cancel-btn {
    background: none;
    border: none;
    color: var(--clr-primary);
    text-decoration: underline;
    cursor: pointer;
    font-family: inherit;
    margin-left: 0.5rem;
}

/* Footer */
.router-footer {
    margin-top: 4rem;
    font-size: 0.85rem;
    color: var(--clr-text-muted);
}

/* Trust Signals */
.trust-signals {
    display: flex;
    justify-content: space-around;
    gap: 2rem;
    margin-top: 4rem;
    padding: 2.5rem 1rem;
    border-top: 1px solid var(--clr-border);
    border-bottom: 1px solid var(--clr-border);
    background-color: var(--clr-surface);
    border-radius: 12px;
}

.trust-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.trust-icon {
    color: var(--clr-primary);
    margin-bottom: 1rem;
}

.trust-item h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trust-item p {
    font-size: 0.8rem;
    color: var(--clr-text-muted);
}

/* Mobile Adjustments */
@media (max-width: 1024px) {
    .container {
        max-width: 900px;
    }

    .shop-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        padding: 2rem 1.5rem;
    }

    .redirect-bar {
        position: static;
        width: 100%;
        margin: 1.5rem 0;
        box-shadow: none;
        border-radius: 10px;
        background: rgba(0, 82, 180, 0.05);
        border: 1px solid rgba(0, 82, 180, 0.1);
        padding: 1.5rem;
    }

    /* Fixed redirect bar at the top or bottom usually gets in the way on mobile */
    /* So we keep it in-flow right under the logo as requested */

    .trust-signals {
        flex-direction: column;
        gap: 1.5rem;
    }

    .shop-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .trust-signals {
        flex-direction: column;
        gap: 2rem;
        margin-top: 3rem;
    }
}

@media (max-width: 560px) {
    .shop-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1.5rem;
    }

    .logo-cozy {
        font-size: 1.8rem;
    }
}
