/**
 * Dentalvarehuset Homepage Styles
 * Porsgrund-inspired premium micro-interactions
 *
 * Last Updated: 2026-03-01
 */

/* ============================================
   LUXURY MICRO-INTERACTIONS
   Slower = more premium feel
   ============================================ */

.hover-lift {
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1),
                box-shadow 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.hover-lift:hover {
    transform: translateY(-4px);
}

.image-zoom {
    transition: transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}

.group:hover .image-zoom {
    transform: scale(1.03);
}

.link-underline {
    position: relative;
    text-decoration: none;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.link-underline:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.btn-primary {
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.3);
}

/* Subtle grain texture for luxury feel */
.texture-grain {
    position: relative;
}

.texture-grain::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* ============================================
   SEARCH STYLES (for prominent header search)
   ============================================ */

.search-input {
    height: 44px;
    background: #F5F5F4;
    border: 1px solid #E7E5E4;
    border-radius: 2px;
    padding: 0 48px 0 16px;
    font-size: 14px;
    font-weight: 300;
    transition: all 0.3s ease;
    width: 100%;
}

.search-input:focus {
    background: #FFFFFF;
    border-color: #CC0062;
    box-shadow: 0 0 0 3px rgba(204, 0, 98, 0.1);
    outline: none;
}

.search-input::placeholder {
    color: #A8A29E;
    font-weight: 300;
}

.search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #78716C;
    pointer-events: none;
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid #E7E5E4;
    border-radius: 2px;
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.15);
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
}

.search-result-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-result-item:hover {
    background: #F5F5F4;
}

.search-result-item img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 1px;
}

.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.search-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #E7E5E4;
    border-top-color: #0D0D0D;
    border-radius: 50%;
    animation: searchSpin 0.6s linear infinite;
}

@keyframes searchSpin {
    to { transform: rotate(360deg); }
}

.recent-searches {
    padding: 12px 16px;
    border-top: 1px solid #E7E5E4;
}

.recent-search-tag {
    display: inline-flex;
    align-items: gap: 6px;
    padding: 4px 10px;
    background: #F5F5F4;
    border-radius: 12px;
    font-size: 13px;
    margin-right: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.recent-search-tag:hover {
    background: #E7E5E4;
}

/* ============================================
   NAVIGATION / MEGA MENU
   ============================================ */

.nav-item {
    position: relative;
}

.nav-item .group-hover\:opacity-100 {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nav-item .group {
    perspective: 2000px;
}

.nav-item ul a {
    transition: color 0.3s ease;
    padding-left: 0;
}

.nav-item ul a:hover {
    color: #CC0062;
    padding-left: 0;
}

.nav-item button {
    background: white;
}

.nav-item button:hover {
    background: white;
}

.nav-item button::before {
    content: '';
    position: absolute;
    bottom: 14px;
    left: 1.5rem;
    right: 1.5rem;
    height: 2px;
    background: transparent;
    transition: background-color 0.3s ease;
}

.nav-item button:hover::before {
    background-color: #CC0062;
}

a[target="_blank"] svg {
    transition: transform 0.3s ease, color 0.3s ease;
}

a[target="_blank"]:hover svg {
    transform: translateX(2px);
    color: #CC0062;
}

/* ============================================
   CART BADGE ANIMATIONS
   ============================================ */

.cart-badge {
    animation: badgePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes badgePop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.cart-badge-bump {
    animation: badgeBump 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes badgeBump {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ============================================
   PREMIUM CONTAINER
   Matches Porsgrund sample: max-w-[1440px] mx-auto px-6
   px-6 = 1.5rem = 24px (consistent across all breakpoints)
   ============================================ */

.premium-container {
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .premium-container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* ============================================
   SECTION PATTERNS
   ============================================ */

/* Hero stone gradient background */
.hero-stone-gradient {
    background: linear-gradient(135deg, #FAFAF9 0%, #F5F5F4 50%, rgba(204, 0, 98, 0.03) 100%);
}

/* Hero accent line */
.hero-accent-line {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, rgb(204, 0, 98) 0%, rgb(150, 0, 70) 100%);
}

/* Trust stats grid */
.trust-stat-item {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.trust-stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.1);
}

/* Product card */
.product-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -15px rgba(0,0,0,0.15);
}

.product-card-image {
    aspect-ratio: 1;
    overflow: hidden;
    background: #FAFAF9;
}

.product-card-image img {
    transition: transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}

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

/* Brand logo box */
.brand-logo-box {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: white;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    border: 1px solid #E7E5E4;
}

.brand-logo-box:hover {
    border-color: #CC0062;
    box-shadow: 0 10px 30px -10px rgba(204, 0, 98, 0.2);
}

/* Review card */
.review-card {
    background: white;
    border: 1px solid #E7E5E4;
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.review-card:hover {
    border-color: #CC0062;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.1);
}

/* Newsletter section */
.newsletter-section {
    background: #1A1A1A;
    color: white;
}

.newsletter-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    transition: all 0.3s ease;
}

.newsletter-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #CC0062;
    outline: none;
}

.newsletter-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   RESPONSIVE TYPOGRAPHY
   ============================================ */

.hero-heading {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 300;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

/* Mobile: 24px */
.hero-heading.text-responsive {
    font-size: 1.5rem;
}

/* Tablet: 36px */
@media (min-width: 768px) {
    .hero-heading.text-responsive {
        font-size: 2.25rem;
    }
}

/* Desktop: 48px */
@media (min-width: 1024px) {
    .hero-heading.text-responsive {
        font-size: 3rem;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Only show focus ring when using keyboard */
*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 2px solid #CC0062;
    outline-offset: 2px;
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-brand { color: rgb(204, 0, 98); }
.text-brand-dark { color: rgb(150, 0, 70); }
.bg-brand { background-color: rgb(204, 0, 98); }
.bg-brand-light { background-color: rgba(204, 0, 98, 0.1); }
.bg-stone-50 { background-color: #FAFAF9; }
.bg-stone-100 { background-color: #F5F5F4; }
.bg-stone-200 { background-color: #E7E5E4; }
.text-stone-400 { color: #A8A29E; }
.text-stone-500 { color: #78716C; }
.text-stone-600 { color: #57534E; }
.text-stone-700 { color: #44403C; }
.text-charcoal { color: #1A1A1A; }
.bg-charcoal { background-color: #1A1A1A; }

.border-stone-200 { border-color: #E7E5E4; }
.border-stone-300 { border-color: #D6D3D1; }
