/* =========================================
   SHARED COMPONENTS
   ========================================= */


/* =========================================
   BUTTONS
   ========================================= */

.app-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);

    min-height: 44px;
    padding: 0 var(--space-lg);

    border: 0;
    border-radius: var(--radius-md);

    font-size: 14px;
    font-weight: 600;

    text-decoration: none;

    transition:
        background-color var(--transition-fast),
        color var(--transition-fast),
        transform var(--transition-fast);
}

.app-button:active {
    transform: scale(0.98);
}


/* Primary */

.app-button-primary {
    background-color: var(--color-primary);
    color: #ffffff;
}

.app-button-primary:hover {
    background-color: var(--color-primary-light);
    color: #ffffff;
}


/* Secondary */

.app-button-secondary {
    background-color: #f1f1f1;
    color: var(--color-text);
}

.app-button-secondary:hover {
    background-color: #e7e7e7;
}


/* Outline */

.app-button-outline {
    background-color: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.app-button-outline:hover {
    background-color: var(--color-background);
}


/* =========================================
   DEAL BADGE
   ========================================= */

.deal-badge-shared {
    display: inline-flex;
    align-items: center;

    padding: 5px 9px;

    border-radius: var(--radius-sm);

    background-color: var(--color-primary);
    color: #ffffff;

    font-size: 11px;
    font-weight: 700;

    white-space: nowrap;
}


/* =========================================
   DEAL CARD
   ========================================= */

.shared-deal-card {
    display: flex;
    align-items: stretch;
    gap: var(--space-md);

    width: 100%;
    padding: var(--space-sm);

    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);

    overflow: hidden;

    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
}

.shared-deal-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}


/* Deal image */

.shared-deal-card-image {
    width: 110px;
    min-width: 110px;
    height: 120px;

    overflow: hidden;

    border-radius: var(--radius-md);
    background-color: #eeeeee;
}

.shared-deal-card-image img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}


/* Deal content */

.shared-deal-card-content {
    display: flex;
    flex-direction: column;

    min-width: 0;
    flex: 1;

    padding: 2px 0;
}


/* Deal title */

.shared-deal-card-title {
    margin: var(--space-sm) 0 4px;

    color: var(--color-text);

    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
}


/* Business */

.shared-deal-card-business {
    margin: 0;

    color: var(--color-text-secondary);

    font-size: 14px;
}


/* Meta */

.shared-deal-card-meta {
    display: flex;
    align-items: center;
    gap: 5px;

    margin-top: auto;

    color: var(--color-text-muted);

    font-size: 11px;
}


/* =========================================
   SAVE BUTTON
   ========================================= */

.save-button-shared {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;

    flex-shrink: 0;

    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);

    background-color: var(--color-surface);
    color: var(--color-text);

    font-size: 20px;

    transition:
        background-color var(--transition-fast),
        color var(--transition-fast),
        transform var(--transition-fast);
}

.save-button-shared:hover {
    background-color: var(--color-background);
}

.save-button-shared:active {
    transform: scale(0.95);
}

.save-button-shared.saved {
    color: var(--color-danger);
}


/* =========================================
   ICON BUTTON
   ========================================= */

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;

    padding: 0;

    border: 0;
    border-radius: var(--radius-md);

    background-color: var(--color-surface);
    color: var(--color-text);

    box-shadow: var(--shadow-sm);

    transition:
        background-color var(--transition-fast),
        transform var(--transition-fast);
}

.icon-button:hover {
    background-color: var(--color-background);
}

.icon-button:active {
    transform: scale(0.95);
}


/* =========================================
   LOADING
   ========================================= */

.app-loading {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 120px;

    color: var(--color-text-secondary);

    font-size: 13px;
}

.app-loading-spinner {
    width: 24px;
    height: 24px;

    margin-inline-end: var(--space-sm);

    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;

    animation: app-spin 0.8s linear infinite;
}

@keyframes app-spin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================================
   EMPTY STATE
   ========================================= */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-height: 220px;

    padding: var(--space-xl);

    text-align: center;
}

.empty-state-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 64px;
    height: 64px;

    margin-bottom: var(--space-lg);

    border-radius: 50%;

    background-color: #f1f1f1;

    font-size: 28px;
}

.empty-state-title {
    margin: 0 0 var(--space-sm);

    font-size: 17px;
    font-weight: 700;
}

.empty-state-text {
    max-width: 300px;

    margin: 0;

    color: var(--color-text-secondary);

    font-size: 13px;
    line-height: 1.8;
}


/* =========================================
   STATUS MESSAGE
   ========================================= */

.status-message {
    padding: var(--space-md) var(--space-lg);

    border-radius: var(--radius-md);

    font-size: 13px;
    line-height: 1.7;
}

.status-message-success {
    background-color: #ecfdf3;
    color: var(--color-success);
}

.status-message-danger {
    background-color: #fef2f2;
    color: var(--color-danger);
}

.status-message-warning {
    background-color: #fffbeb;
    color: #92400e;
}


/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 575.98px) {

    .shared-deal-card-image {
        width: 95px;
        min-width: 95px;
        height: 110px;
    }

    .shared-deal-card-title {
        font-size: 14px;
    }

    .app-button {
        min-height: 42px;
        padding-inline: 14px;
        font-size: 13px;
    }
}




/* =========================================
   BOTTOM NAVIGATION
   ========================================= */

.bottom-nav {
    position: fixed;

    left: 50%;
    bottom: 16px;

    transform: translateX(-50%);

    width: min(calc(100% - 24px),
            560px);

    height: 72px;

    display: flex;
    align-items: center;
    justify-content: space-around;

    padding: 8px;

    background: rgba(255, 255, 255, 0.96);

    border: 1px solid rgba(0, 0, 0, 0.06);

    border-radius: 24px;

    box-shadow:
        0 10px 35px rgba(0, 0, 0, 0.10),
        0 2px 8px rgba(0, 0, 0, 0.04);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    z-index: 1000;
}


/* =========================================
   NAV ITEM
   ========================================= */

.bottom-nav .nav-item {

    position: relative;

    flex: 1;

    height: 56px;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 3px;

    color: #8a8a8a;

    border-radius: 18px;

    transition:
        color var(--transition-normal),
        background-color var(--transition-normal),
        transform var(--transition-fast);

    -webkit-tap-highlight-color: transparent;
}


/* =========================================
   NAV ICON
   ========================================= */

.bottom-nav .nav-icon {

    width: 23px;
    height: 23px;

    display: flex;

    align-items: center;
    justify-content: center;

    transition:
        transform var(--transition-normal);
}


.bottom-nav .nav-icon svg {

    width: 22px;
    height: 22px;

    fill: none;

    stroke: currentColor;

    stroke-width: 1.8;

    stroke-linecap: round;
    stroke-linejoin: round;

    transition:
        stroke-width var(--transition-normal),
        transform var(--transition-normal);
}


/* =========================================
   NAV LABEL
   ========================================= */

.bottom-nav .nav-label {

    font-size: 13px;

    font-weight: 600;

    line-height: 1;

    white-space: nowrap;

    transition:
        color var(--transition-normal),
        font-size var(--transition-normal);
}


/* =========================================
   HOVER
   ========================================= */

.bottom-nav .nav-item:hover {

    color: var(--color-primary);

}


/* =========================================
   ACTIVE ITEM
   ========================================= */

.bottom-nav .nav-item.active {

    color: var(--color-primary);

    background: #EEF4FF;

}


.bottom-nav .nav-item.active .nav-icon {

    transform: translateY(-1px);

}


.bottom-nav .nav-item.active .nav-icon svg {

    stroke-width: 2.2;

}


.bottom-nav .nav-item.active .nav-label {

    font-weight: 700;

}


/* =========================================
   ACTIVE INDICATOR
   ========================================= */

.bottom-nav .nav-item.active::before {

    content: "";

    position: absolute;

    top: 4px;

    left: 50%;

    width: 4px;
    height: 4px;

    transform: translateX(-50%);

    border-radius: 50%;

    background: var(--color-primary);

}


/* =========================================
   MAP ITEM
   ========================================= */

.bottom-nav .nav-item-map {

    margin-top: -14px;

}


.bottom-nav .nav-item-map .nav-icon {

    width: 48px;
    height: 48px;

    margin-bottom: 2px;

    border-radius: 16px;

    background: var(--color-primary);

    color: #ffffff;

    box-shadow:
        0 6px 16px rgba(0, 0, 0, 0.18);

}


.bottom-nav .nav-item-map .nav-icon svg {

    width: 23px;
    height: 23px;

}


.bottom-nav .nav-item-map .nav-label {

    position: absolute;

    top: 58px;

    color: #8a8a8a;

}


.bottom-nav .nav-item-map.active .nav-icon {

    background: #111111;

    color: #ffffff;

    transform: translateY(-2px) scale(1.03);

}


.bottom-nav .nav-item-map.active .nav-label {

    color: var(--color-primary);

    font-weight: 700;

}


/* =========================================
   DISABLE ACTIVE INDICATOR FOR MAP
   ========================================= */

.bottom-nav .nav-item-map.active::before {

    display: none;

}


/* =========================================
   MOBILE
   ========================================= */

@media (max-width: 767.98px) {

    .bottom-nav {

        bottom: 10px;

        width: calc(100% - 20px);

        height: 68px;

        padding: 7px;

        border-radius: 22px;

    }


    .bottom-nav .nav-item {

        height: 54px;

        border-radius: 16px;

    }


    .bottom-nav .nav-icon {

        width: 22px;
        height: 22px;

    }


    .bottom-nav .nav-icon svg {

        width: 21px;
        height: 21px;

    }


    .bottom-nav .nav-label {

        font-size: 9px;

    }


    .bottom-nav .nav-item-map {

        margin-top: -12px;

    }


    .bottom-nav .nav-item-map .nav-icon {

        width: 44px;
        height: 44px;

        border-radius: 14px;

    }


    .bottom-nav .nav-item-map .nav-label {

        top: 54px;

    }

}


/* =========================================
   VERY SMALL SCREENS
   ========================================= */

@media (max-width: 360px) {

    .bottom-nav {

        width: calc(100% - 12px);

        bottom: 6px;

    }


    .bottom-nav .nav-label {

        font-size: 8px;

    }

}

/* =========================================
   REFINED BOTTOM NAVIGATION
   ========================================= */

.bottom-nav {
    z-index: 1000;
    width: min(560px, calc(100% - 32px));
    min-height: 76px;
    padding: 8px;
    gap: 5px;
    border: 1px solid rgba(17, 17, 17, 0.08);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 16px 38px rgba(17, 17, 17, 0.14);
    backdrop-filter: blur(18px);
}

.bottom-nav .nav-item {
    z-index: 1;
    height: 60px;
    border-radius: 19px;
    color: #8a8a8a;
    transition: color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
}

.bottom-nav .nav-item:hover {
    color: #111;
    background: rgba(17, 17, 17, 0.04);
}

.bottom-nav .nav-item.active {
    color: #111;
    background: #f2f2f2;
}

.bottom-nav .nav-item.active::before {
    top: 7px;
    width: 18px;
    height: 3px;
    border-radius: 10px;
    background: #111;
}

.bottom-nav .nav-item.active .nav-icon {
    transform: translateY(1px);
}

.bottom-nav .nav-label {
    margin-top: 2px;
    font-size: 10px;
    font-weight: 600;
}

.bottom-nav .nav-item-map {
    margin-top: -24px;
}

.bottom-nav .nav-item-map .nav-icon {
    width: 54px;
    height: 54px;
    border: 5px solid var(--color-surface);
    border-radius: 19px;
    background: #111;
    color: #fff;
    box-shadow: 0 10px 22px rgba(17, 17, 17, 0.22);
}

.bottom-nav .nav-item-map .nav-label {
    top: 62px;
    color: #777;
}

.bottom-nav .nav-item-map.active .nav-icon {
    background: #111;
    color: #fff;
    transform: translateY(-2px) scale(1.04);
}

@media (max-width: 767.98px) {
    .bottom-nav {
        bottom: 12px;
        width: calc(100% - 24px);
        min-height: 70px;
        border-radius: 24px;
    }

    .bottom-nav .nav-item {
        height: 54px;
        border-radius: 16px;
    }

    .bottom-nav .nav-item-map {
        margin-top: -20px;
    }

    .bottom-nav .nav-item-map .nav-icon {
        width: 48px;
        height: 48px;
    }
}
