/* ============================================
   PETPALACE - Modern Pet E-Commerce
   ============================================ */

:root {
    --primary: #1a3c5a;
    --primary-light: #2d5a7b;
    --primary-dark: #0f2538;
    --accent: #e07a5f;
    --accent-hover: #c85e42;
    --accent-light: #fdf0ec;
    --secondary: #7fb069;
    --secondary-light: #e8f5e3;
    --bg: #faf9f7;
    --card-bg: #ffffff;
    --text: #1f2937;
    --text-light: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow: 0 4px 20px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1.2;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
img { max-width: 100%; height: auto; display: block; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 4px; }

/* NAVBAR */
.navbar {
    padding: 0.8rem 0;
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    font-family: 'Playfair Display', serif;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--primary) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand i { color: var(--accent); font-size: 1.4rem; }

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text) !important;
    padding: 0.5rem 1rem !important;
    border-radius: 50px;
    transition: var(--transition);
    margin: 0 0.15rem;
}

.nav-link:hover { color: var(--primary) !important; background: var(--border-light); }
.nav-link.active { color: var(--primary) !important; background: var(--accent-light); }

.cart-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.2rem;
    background: var(--primary);
    color: white !important;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.cart-icon-wrap:hover { background: var(--primary-light); transform: translateY(-2px); }

.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.navbar-toggler {
    border: 2px solid var(--border);
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    color: var(--primary);
    font-size: 1.2rem;
    background: transparent;
    transition: var(--transition);
}

.navbar-toggler:focus { box-shadow: 0 0 0 0.2rem rgba(26,60,90,0.15); }
.navbar-toggler-icon { display: none; }

/* HERO */
.hero {
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
}

.hero-img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.35;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15,37,56,0.9) 0%, rgba(15,37,56,0.4) 60%, transparent 100%);
}

.hero-content { position: relative; z-index: 2; padding: 4rem 0; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: white;
    margin-bottom: 1.2rem;
    line-height: 1.1;
}

.hero h1 span { color: var(--accent); }

.hero p {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.8);
    max-width: 500px;
    margin-bottom: 2rem;
}

.btn-primary-custom {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    color: white;
    padding: 1rem 2.2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    transition: var(--transition);
    box-shadow: 0 8px 25px rgba(224,122,95,0.35);
    cursor: pointer;
}

.btn-primary-custom:hover {
    background: var(--accent-hover);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(224,122,95,0.45);
    color: white;
}

.btn-outline-custom {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: white;
    padding: 1rem 2.2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    border: 2px solid rgba(255,255,255,0.3);
    transition: var(--transition);
    cursor: pointer;
}

.btn-outline-custom:hover { background: white; color: var(--primary); transform: translateY(-3px); }

/* SECTIONS */
.section-padding { padding: 5rem 0; }
.section-header { text-align: center; max-width: 600px; margin: 0 auto 3rem; }

.section-header h6 {
    font-family: 'Inter', sans-serif;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.8rem;
}

.section-header h2 {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    margin-bottom: 1rem;
}

.section-header p { color: var(--text-light); font-size: 1.05rem; }

/* CATEGORY CARDS */
.category-card {
    display: block;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-light);
    text-align: center;
    padding-bottom: 1.5rem;
}

.category-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }

.category-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: var(--transition);
}

.category-card:hover img { transform: scale(1.05); }

.category-card h4 { font-size: 1.2rem; margin: 1.2rem 0 0.3rem; color: var(--primary-dark); }
.category-card p { color: var(--text-light); font-size: 0.9rem; margin: 0; }

/* PRODUCT CARDS */
.product-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-light);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

.product-img-wrap { position: relative; overflow: hidden; height: 240px; }

.product-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.product-card:hover .product-img-wrap img { transform: scale(1.08); }

.product-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--accent);
    color: white;
    padding: 0.25rem 0.8rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-badge.new { background: var(--secondary); }

.product-wishlist {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.product-wishlist:hover, .product-wishlist.active { color: var(--accent); transform: scale(1.1); }

.product-info { padding: 1.3rem; flex: 1; display: flex; flex-direction: column; }

.product-category {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.4rem;
}

.product-info h4 { font-size: 1.1rem; margin-bottom: 0.4rem; color: var(--primary-dark); }

.product-meta { font-size: 0.85rem; color: var(--text-light); margin-bottom: 0.8rem; }

.product-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border-light);
}

.product-price { font-size: 1.3rem; font-weight: 700; color: var(--primary); }

.product-price .original {
    font-size: 0.95rem;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-left: 0.5rem;
    font-weight: 500;
}

.btn-add-cart {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

.btn-add-cart:hover { background: var(--accent); transform: scale(1.1); }

/* PRODUCT DETAIL */
.product-detail-img { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.product-detail-img img { width: 100%; border-radius: var(--radius); }

.product-detail-info h6 {
    font-family: 'Inter', sans-serif;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.product-detail-info h1 { font-size: 2.2rem; margin-bottom: 1rem; }

.detail-price { font-size: 2rem; font-weight: 700; color: var(--primary); margin-bottom: 1.2rem; }
.detail-desc { color: var(--text-light); line-height: 1.8; margin-bottom: 1.5rem; }

.detail-meta-list { list-style: none; padding: 0; margin-bottom: 1.5rem; }

.detail-meta-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.95rem;
}

.detail-meta-list li span:first-child { color: var(--text-light); }
.detail-meta-list li span:last-child { font-weight: 600; color: var(--text); }

.qty-selector { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.5rem; }

.qty-selector button {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    background: white;
    border-radius: var(--radius-xs);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
}

.qty-selector button:hover { background: var(--border-light); }

.qty-selector input {
    width: 60px;
    height: 40px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-weight: 600;
    font-size: 1rem;
}

.btn-buy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--accent);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    transition: var(--transition);
    cursor: pointer;
    width: 100%;
    max-width: 300px;
}

.btn-buy:hover { background: var(--accent-hover); transform: translateY(-2px); }

/* CART */
.cart-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.cart-item img { width: 100px; height: 100px; object-fit: cover; border-radius: var(--radius-xs); }
.cart-item-info { flex: 1; }

.cart-item-info h5 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

.cart-item-info p { color: var(--text-light); font-size: 0.9rem; margin: 0; }

.cart-item-price { font-size: 1.2rem; font-weight: 700; color: var(--primary); min-width: 100px; text-align: right; }

.cart-item-remove {
    width: 36px;
    height: 36px;
    background: var(--accent-light);
    color: var(--accent);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.cart-item-remove:hover { background: var(--accent); color: white; }

.cart-summary {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    position: sticky;
    top: 100px;
}

.cart-summary h4 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
}

.summary-row { display: flex; justify-content: space-between; padding: 0.7rem 0; font-size: 0.95rem; }

.summary-row.total {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    border-top: 2px solid var(--border-light);
    margin-top: 0.5rem;
    padding-top: 1rem;
}

.empty-cart { text-align: center; padding: 4rem 2rem; }
.empty-cart i { font-size: 4rem; color: var(--border); margin-bottom: 1.5rem; }
.empty-cart h3 { margin-bottom: 1rem; }
.empty-cart p { color: var(--text-light); margin-bottom: 2rem; }

/* CHECKOUT */
.checkout-form .form-control, .checkout-form .form-select {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    font-size: 0.95rem;
    transition: var(--transition);
}

.checkout-form .form-control:focus, .checkout-form .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.2rem rgba(26,60,90,0.1);
}

.checkout-form label { font-weight: 500; font-size: 0.9rem; color: var(--text); margin-bottom: 0.4rem; }

/* FOOTER */
.footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.7);
    padding: 4rem 0 1.5rem;
}

.footer-brand {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-brand i { color: var(--accent); }

.footer-about p { font-size: 0.9rem; line-height: 1.8; margin-bottom: 1.5rem; }

.footer-social { display: flex; gap: 0.7rem; }

.footer-social a {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--transition);
}

.footer-social a:hover { background: var(--accent); transform: translateY(-3px); }

.footer h5 { color: white; font-size: 1.05rem; margin-bottom: 1.5rem; font-family: 'Inter', sans-serif; font-weight: 600; }

.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.7rem; }

.footer-links a {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-links a:hover { color: var(--accent); padding-left: 5px; }

.footer-contact p { font-size: 0.9rem; margin-bottom: 0.7rem; display: flex; align-items: center; gap: 0.7rem; }
.footer-contact i { color: var(--accent); width: 20px; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 3rem;
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.4);
}

/* TOAST */
.toast-container { position: fixed; bottom: 30px; right: 30px; z-index: 9999; }

.toast-custom {
    background: var(--primary-dark);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
    margin-top: 0.5rem;
}

.toast-custom i { color: var(--accent); font-size: 1.2rem; }

@keyframes slideIn { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(100px); } }

/* BREADCRUMB */
.breadcrumb-wrap {
    background: var(--primary);
    padding: 2.5rem 0;
    color: white;
}

.breadcrumb-wrap h2 { color: white; font-size: 2rem; margin-bottom: 0.5rem; }
.breadcrumb-wrap .breadcrumb { background: none; padding: 0; margin: 0; }
.breadcrumb-wrap .breadcrumb-item a { color: rgba(255,255,255,0.7); }
.breadcrumb-wrap .breadcrumb-item a:hover { color: var(--accent); }
.breadcrumb-wrap .breadcrumb-item.active { color: white; }
.breadcrumb-wrap .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,0.5); }

/* FILTER BAR */
.filter-bar {
    background: var(--card-bg);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-bar select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    background: white;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .hero { min-height: 70vh; }
    .hero h1 { font-size: 2.2rem; }
    .section-padding { padding: 3rem 0; }
    .cart-item { flex-direction: column; text-align: center; }
    .cart-item-price { text-align: center; }
    .product-img-wrap { height: 200px; }
}

@media (max-width: 991px) {
    .navbar-collapse {
        background: var(--card-bg);
        border-radius: var(--radius-sm);
        padding: 1rem;
        margin-top: 0.8rem;
        box-shadow: var(--shadow);
    }
    .cart-icon-wrap { margin-top: 0.5rem; }
}


/* ============================================
   NAVBAR DROPDOWN & SEARCH
   ============================================ */

/* Dropdown */
.nav-item.dropdown .nav-link::after {
    display: inline-block;
    margin-left: 0.3rem;
    vertical-align: middle;
    content: "\f107";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.75rem;
    border: none;
}

.dropdown-menu {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    min-width: 220px;
    margin-top: 0.5rem;
    animation: dropdownFade 0.2s ease;
}

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

.dropdown-item {
    padding: 0.7rem 1rem;
    border-radius: var(--radius-xs);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.7rem;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.dropdown-item i {
    width: 22px;
    text-align: center;
    color: var(--primary-light);
    font-size: 0.9rem;
}

.dropdown-item:hover i { color: var(--accent); }

.dropdown-divider { margin: 0.4rem 0.5rem; border-color: var(--border-light); }

/* Search */
.search-wrap {
    position: relative;
    margin-right: 1rem;
}

.search-wrap input {
    width: 260px;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.9rem;
    background: var(--bg);
    transition: var(--transition);
    outline: none;
}

.search-wrap input:focus {
    border-color: var(--primary-light);
    background: white;
    box-shadow: 0 0 0 0.2rem rgba(26,60,90,0.08);
    width: 300px;
}

.search-wrap i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

/* Search Results Dropdown */
.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    max-height: 360px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
}

.search-results.active { display: block; }

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-light);
}

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

.search-result-item:hover { background: var(--accent-light); }

.search-result-item img {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.search-result-item .sr-info { flex: 1; min-width: 0; }

.search-result-item .sr-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-item .sr-cat {
    font-size: 0.8rem;
    color: var(--text-light);
}

.search-result-item .sr-price {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.95rem;
    white-space: nowrap;
}

.search-no-results {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Mobile search */
@media (max-width: 991px) {
    .search-wrap { margin: 0.5rem 0; width: 100%; }
    .search-wrap input { width: 100% !important; }
    .search-wrap input:focus { width: 100% !important; }
    .dropdown-menu { box-shadow: none; border: none; padding-left: 1rem; }
}
