/* =========================================================
   AdultGuest Marketplace – components.css
   Supplementary component styles (navigation states, toast,
   search bar, loading states, etc.)
   ========================================================= */

/* ─── Header Scrolled State ─── */
#site-header.scrolled {
    box-shadow: 0 2px 20px rgba(0,0,0,0.6);
    border-bottom-color: rgba(255,45,117,0.2);
}

/* ─── Mobile Menu ─── */
.mobile-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11,11,11,0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 998;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.mobile-menu.open {
    transform: translateX(0);
}

.mobile-menu-inner {
    padding: 32px 24px;
}

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

.mobile-nav li a {
    display: block;
    padding: 14px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav li a:hover {
    color: var(--accent);
    background: rgba(255,45,117,0.08);
}

/* Hamburger ── active (X) */
.hamburger.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger.is-active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ─── Search Bar ─── */
.search-bar {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 0;
}

.search-bar.open {
    max-height: 80px;
    padding: 12px 0;
    border-top: 1px solid var(--border-color);
}

.search-bar .search-form {
    display: flex;
    gap: 10px;
}

.search-bar input[type="search"] {
    flex: 1;
    background: var(--bg-card);
}

.search-bar button[type="submit"] {
    padding: 12px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-btn);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.search-bar button[type="submit"]:hover {
    background: var(--accent-hover);
}

/* ─── Icon Button (search toggle) ─── */
.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.icon-btn:hover {
    color: var(--accent);
    background: rgba(255,45,117,0.1);
}

/* ─── Toast Notifications ─── */
#agm-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.agm-toast {
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #fff;
    min-width: 220px;
    max-width: 340px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    transform: translateX(120%);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    pointer-events: auto;
}

.agm-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.agm-toast--success { background: linear-gradient(135deg, #1a7a4a, #0e5e37); border-left: 4px solid #2ecc71; }
.agm-toast--error   { background: linear-gradient(135deg, #7a1a2a, #5e0e1a); border-left: 4px solid var(--accent); }
.agm-toast--info    { background: linear-gradient(135deg, #1a2a7a, #0e1a5e); border-left: 4px solid var(--highlight); }

/* ─── Loading State for Grid ─── */
.listings-grid.loading {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.listings-grid.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: agm-spin 0.8s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes agm-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* ─── Button Added State ─── */
.btn.added {
    background: linear-gradient(135deg, #1a7a4a, #0e5e37) !important;
    box-shadow: 0 4px 16px rgba(46,204,113,0.35) !important;
}

/* ─── Skip Link ─── */
.skip-link {
    position: absolute;
    top: -999px;
    left: -999px;
}
.skip-link:focus {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 99999;
    background: var(--accent);
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
}

/* ─── Posts Grid (index.php fallback) ─── */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 900px) { .posts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .posts-grid { grid-template-columns: 1fr; } }

/* ─── Steps grid responsive ─── */
@media (max-width: 768px) {
    .steps-grid { grid-template-columns: 1fr !important; }
}

/* ─── d-none-mobile ─── */
@media (max-width: 600px) {
    .d-none-mobile { display: none !important; }
}
