/* ============================================
   public/css/common.css
   Shared styles used across all pages
   ============================================ */

/* ---- Base Reset & Font ---- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    overflow-x: clip;
    width: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    color: #1d1d1f;
}

/* ---- Typography Utilities ---- */
.fw-600 {
    font-weight: 600 !important;
}

.fw-700 {
    font-weight: 700 !important;
}

.fw-800 {
    font-weight: 800 !important;
}

.fs-sm {
    font-size: 0.875rem !important;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    background: #fff !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    min-height: 70px;
}

.navbar .container {
    min-height: 70px;
    display: flex;
    align-items: center;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.05em;
    color: #000 !important;
    text-decoration: none;
}

.navbar-brand:hover {
    color: #1d1d1f !important;
}

/* ---- Nav Links (Desktop) ---- */
.navbar-nav .nav-link {
    font-weight: 500;
    color: #1d1d1f !important;
    padding: 0.5rem 1rem !important;
    transition: color 0.15s ease;
    font-size: 0.95rem;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: #000 !important;
    font-weight: 600;
}

/* ---- Search Bar ---- */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
    background: #f5f5f7;
    border-radius: 24px;
    padding: 8px 16px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    min-width: 200px;
}

.search-container:focus-within {
    border-color: #d2d2d7;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.9rem;
    color: #1d1d1f;
    width: 160px;
    font-family: inherit;
}

.search-input::placeholder {
    color: #86868b;
}

/* ---- Search Suggestions ---- */
.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    min-width: 280px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
    z-index: 1050;
    display: none;
    animation: slideDownFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideDownFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.search-suggestions.show {
    display: block;
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

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

.suggestion-item:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.suggestion-image {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    background-color: #f5f5f7;
    flex-shrink: 0;
}

.suggestion-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
}

.suggestion-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1d1d1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.suggestion-category {
    font-size: 0.7rem;
    color: #86868b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.suggestion-price-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

.suggestion-price {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1d1d1f;
}

.suggestion-original-price {
    font-size: 0.75rem;
    color: #86868b;
    text-decoration: line-through;
}

/* Search Suggestions Dropdown */
.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    min-width: 260px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.02);
    max-height: 380px;
    overflow-y: auto;
    z-index: 1050;
    display: none;
    padding: 8px;
}

.search-suggestions.show {
    display: block;
    animation: slideDownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDownFade {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
}

.suggestion-item:hover {
    background: #f5f5f7;
    color: inherit;
}

.suggestion-image {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background: #f5f5f7;
    flex-shrink: 0;
}

.suggestion-info {
    flex-grow: 1;
    min-width: 0;
}

.suggestion-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-category {
    font-size: 0.75rem;
    color: #86868b;
    margin: 2px 0 0 0;
}

.suggestion-price-wrap {
    text-align: right;
    flex-shrink: 0;
}

.suggestion-price {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1d1d1f;
}

.suggestion-price-original {
    font-size: 0.75rem;
    color: #86868b;
    text-decoration: line-through;
    margin-right: 4px;
}

.suggestion-price-discounted {
    color: #ff3b30;
}

.suggestions-empty,
.suggestions-loading {
    padding: 16px;
    text-align: center;
    color: #86868b;
    font-size: 0.85rem;
}


/* ---- Icon Buttons (Cart, Wishlist, Profile) ---- */
.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #f5f5f7;
    color: #1d1d1f;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: none;
    flex-shrink: 0;
    text-decoration: none;
}

.icon-btn i {
    font-size: 1.2rem;
    line-height: 1;
}

.icon-btn:hover {
    background: #e8e8ed;
    color: #000;
}

.icon-btn.active-nav-icon {
    background: #f5f5f7;
    color: #000;
    border: 1.5px solid #1d1d1f;
}

/* ---- Badge (Cart/Wishlist) ---- */
.cart-badge, .wishlist-badge {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(25%, -25%);
    background: #ff3b30;
    color: white;
    font-size: 0.7rem;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-weight: 700;
    border: 2px solid #fff;
    display: none; /* hidden by default, shown via AuthGuard */
}

/* ============================================
   NAVBAR TOGGLER (hamburger — all pages)
   ============================================ */
.navbar-toggler {
    border: none !important;
    box-shadow: none !important;
    padding: 0.25rem !important;
}

.navbar-toggler:focus {
    box-shadow: none !important;
}

.navbar-toggler-icon {
    width: 22px;
    height: 22px;
}

/* ============================================
   MOBILE NAVBAR COLLAPSE (< 992px)
   ============================================ */
@media (max-width: 991px) {
    .navbar-collapse {
        position: fixed;
        top: 70px;
        right: 20px;
        left: auto;
        width: 280px;
        max-width: 320px;
        height: auto;
        background: #ffffff;
        z-index: 200;
        padding: 0.75rem;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
        border-radius: 20px;
        display: block !important;
        transform: translateY(-15px);
        opacity: 0;
        transition: transform 0.25s ease, opacity 0.2s ease;
        pointer-events: none;
        will-change: transform, opacity;
        border: 1px solid rgba(0, 0, 0, 0.05);
    }

    .navbar-collapse.show {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }

    .navbar-nav {
        flex-direction: column;
        gap: 4px;
    }

    .navbar-nav .nav-link {
        font-size: 1rem;
        padding: 14px 18px !important;
        font-weight: 500;
        border-radius: 12px;
        color: #1d1d1f !important;
    }

    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link:active {
        background: #f5f5f7;
    }

    .search-container {
        display: none !important;
    }
}

/* Nav-open backdrop overlay (applied to <html>) */
html::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.08);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    pointer-events: none;
}

html.nav-open::after {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   SHARED BUTTON STYLES
   ============================================ */
.btn-pill {
    border-radius: 50px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-black {
    background: #000 !important;
    color: #fff !important;
    border: none !important;
}

.btn-black:hover {
    background: #1d1d1f !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    color: #fff !important;
}

/* ============================================
   FOOTER UTILITIES
   ============================================ */
/* ============================================
   FOOTER
   ============================================ */
footer {
    background: #fff;
    padding: 4rem 0 2rem;
    border-top: 1px solid #f2f2f2;
}

.footer-logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: #000;
    text-decoration: none;
    letter-spacing: -0.05em;
    display: inline-block;
    margin-bottom: 0.85rem;
}

.footer-desc {
    font-size: 0.875rem;
    color: #6e6e73;
    line-height: 1.65;
    max-width: 240px;
    margin-bottom: 1.25rem;
}

.footer-social {
    display: flex;
    gap: 10px;
    margin-top: 0.5rem;
}

.social-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f5f5f7;
    color: #1d1d1f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.social-icon:hover {
    background: #1d1d1f;
    color: #fff;
}

.footer-heading {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1d1d1f;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.6rem;
}

.footer-links a {
    font-size: 0.875rem;
    color: #6e6e73;
    text-decoration: none;
    transition: color 0.15s ease;
}

.footer-links a:hover {
    color: #1d1d1f;
}

.footer-bottom {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f2f2f2;
}

.copyright {
    font-size: 0.82rem;
    color: #86868b;
}

.footer-legal a {
    font-size: 0.82rem;
    color: #86868b;
    text-decoration: none;
    transition: color 0.15s ease;
}

.footer-legal a:hover {
    color: #1d1d1f;
}

/* Mobile Footer Tweaks */
@media (max-width: 768px) {
    footer {
        padding: 3rem 0 1.5rem;
    }

    .footer-desc {
        max-width: 100%;
    }
}
/* ============================================
   TOAST NOTIFICATIONS (Enhanced)
   ============================================ */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast-notification {
    background: #ffffff;
    color: #1d1d1f;
    min-width: 320px;
    max-width: 420px;
    padding: 16px 20px;
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    gap: 16px;
    pointer-events: all;
    border-left: 5px solid #1d1d1f;
    animation: toast-in 0.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.toast-notification.toast-success { border-left-color: #34c759; }
.toast-notification.toast-error { border-left-color: #ff3b30; }
.toast-notification.toast-info { border-left-color: #007aff; }

.toast-notification i {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast-success i { color: #34c759; }
.toast-error i { color: #ff3b30; }
.toast-info i { color: #007aff; }

.toast-label {
    display: flex;
    flex-direction: column;
}

.toast-text {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.3;
}

@keyframes toast-in {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toast-out {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(50px); opacity: 0; }
}

@media (max-width: 576px) {
    .toast-container {
        top: auto;
        bottom: 24px;
        left: 20px;
        right: 20px;
    }
    .toast-notification {
        min-width: unset;
        width: 100%;
    }
}

