/**
 * Luna - CSS Part 2: Components & Pages
 */

/* ================================
   HERO SECTION
   ================================ */
.hero {
    position: relative;
    height: 100vh;
    max-height: 100vh;
    margin-top: 0;
    overflow: hidden;
}

.hero__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1s ease;
}

.hero__slide.active {
    opacity: 1;
}

.hero__image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.05);
    transition: transform 8s ease;
}

.hero__slide.active .hero__image {
    transform: scale(1);
}

.hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(250, 249, 247, 0.3) 0%, rgba(250, 249, 247, 0.1) 50%, rgba(250, 249, 247, 0.5) 100%);
}

.hero__content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: var(--space-xl);
}

.hero__subtitle {
    font-family: var(--font-accent);
    font-size: var(--text-lg);
    font-style: italic;
    color: var(--color-text-primary);
    margin-bottom: var(--space-md);
    letter-spacing: 0.1em;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.hero__title {
    font-size: clamp(var(--text-4xl), 8vw, var(--text-6xl));
    font-weight: 400;
    margin-bottom: var(--space-lg);
    max-width: 800px;
    color: var(--color-text-primary);
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.6);
}

.hero__description {
    font-size: var(--text-lg);
    color: var(--color-text-primary);
    max-width: 500px;
    margin-bottom: var(--space-xl);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.hero__dots {
    position: absolute;
    bottom: var(--space-2xl);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--space-sm);
}

.hero__dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background-color: var(--color-text-muted);
    opacity: 0.5;
    cursor: pointer;
    transition: all var(--transition-base);
}

.hero__dot.active {
    width: 24px;
    background-color: var(--color-accent);
    opacity: 1;
}

/* ================================
   BUTTONS
   ================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
    cursor: pointer;
}

.btn--primary {
    background-color: var(--color-text-primary);
    color: white;
    border: 2px solid var(--color-text-primary);
}

.btn--primary:hover {
    background-color: transparent;
    color: var(--color-text-primary);
}

.btn--secondary {
    background-color: transparent;
    color: var(--color-text-primary);
    border: 2px solid var(--color-text-primary);
}

.btn--secondary:hover {
    background-color: var(--color-text-primary);
    color: white;
}

.btn--accent {
    background-color: var(--color-accent);
    color: white;
    border: 2px solid var(--color-accent);
}

.btn--accent:hover {
    background-color: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
}

.btn--lg {
    padding: var(--space-lg) var(--space-2xl);
    font-size: var(--text-base);
}

.btn--sm {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-xs);
}

.btn--full {
    width: 100%;
}

/* ================================
   SECTION HEADERS
   ================================ */
.section-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.section-header__subtitle {
    font-family: var(--font-accent);
    font-size: var(--text-base);
    font-style: italic;
    color: var(--color-accent);
    margin-bottom: var(--space-sm);
}

.section-header__title {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-md);
}

.section-header__description {
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ================================
   PRODUCT GRID
   ================================ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-xl);
}

.product-card {
    background-color: var(--color-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-base);
}

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

.product-card__image {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: var(--color-background-alt);
}

.product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.product-card__badges {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    z-index: 5;
}

.product-card__badge {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.05em;
    border-radius: var(--radius-sm);
    text-align: center;
}

.product-card__badge--featured {
    background-color: var(--color-accent);
    color: white;
}

.product-card__badge--sold-out {
    background-color: var(--color-text-secondary);
    color: white;
}

.product-card__badge--sale {
    background-color: var(--color-error);
    color: white;
}

.product-card__actions {
    position: absolute;
    bottom: var(--space-md);
    right: var(--space-md);
    display: flex;
    gap: var(--space-sm);
    opacity: 1;
    transform: translateY(0);
    transition: all var(--transition-base);
}

.product-card:hover .product-card__actions {
    opacity: 1;
    transform: translateY(0);
}

.product-card__action {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    color: var(--color-text-primary);
    transition: all var(--transition-fast);
}

.product-card__action:hover {
    background-color: var(--color-accent);
    color: white;
}

.product-card__action svg {
    width: 18px;
    height: 18px;
}

.product-card__content {
    padding: var(--space-lg);
    text-align: center;
}

.product-card__category {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-xs);
}

.product-card__title {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 500;
    margin-bottom: var(--space-sm);
}

.product-card__title a:hover {
    color: var(--color-accent);
}

.product-card__price {
    font-size: var(--text-lg);
    font-weight: 500;
    color: var(--color-text-primary);
}

.product-card__price-original {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    text-decoration: line-through;
    margin-right: var(--space-sm);
}

.product-card__price-sale {
    color: var(--color-error);
}

/* ================================
   FEATURES SECTION
   ================================ */
.features {
    background-color: var(--color-surface);
}

.features__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-2xl);
}

.feature-card {
    text-align: center;
    padding: var(--space-xl);
}

.feature-card__icon {
    width: 60px;
    height: 60px;
    margin: 0 auto var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-accent-light);
    border-radius: var(--radius-full);
    color: var(--color-accent);
}

.feature-card__icon svg {
    width: 28px;
    height: 28px;
}

.feature-card__title {
    font-size: var(--text-lg);
    margin-bottom: var(--space-sm);
}

.feature-card__description {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-bottom: 0;
}

/* ================================
   NEWSLETTER
   ================================ */
.newsletter {
    background-color: var(--color-background-alt);
    text-align: center;
}

.newsletter__form {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    gap: var(--space-sm);
}

.newsletter__input {
    flex: 1;
    padding: var(--space-md) var(--space-lg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background-color: var(--color-surface);
    font-size: var(--text-base);
}

.newsletter__input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.newsletter__input::placeholder {
    color: var(--color-text-muted);
}

/* ================================
   LANGUAGE SELECTOR
   ================================ */
.lang-selector {
    position: relative;
    display: flex;
    align-items: center;
}

.lang-selector__toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--color-text-primary);
}

.lang-selector__toggle:hover {
    background: var(--color-surface);
    border-color: var(--color-accent);
}

.lang-selector__flag {
    font-size: 1.1em;
    line-height: 1;
    display: flex;
    align-items: center;
}

.lang-selector__flag-svg {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    display: block;
}

.lang-selector__code {
    font-weight: 500;
    letter-spacing: 0.05em;
}

.lang-selector__arrow {
    transition: transform var(--transition-fast);
}

.lang-selector.active .lang-selector__arrow {
    transform: rotate(180deg);
}

.lang-selector__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 1000;
    overflow: hidden;
}

.lang-selector.active .lang-selector__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-selector__option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    text-align: left;
    transition: all var(--transition-fast);
}

.lang-selector__option:hover {
    background: var(--color-background-alt);
    color: var(--color-text-primary);
}

.lang-selector__option.active {
    background: var(--color-accent-light);
    color: var(--color-accent);
    font-weight: 500;
}

.lang-selector__option .lang-selector__flag {
    font-size: 1.3em;
}

.lang-selector__name {
    flex: 1;
}

.lang-selector__check {
    color: var(--color-accent);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .lang-selector__toggle {
        padding: 6px 8px;
    }

    .lang-selector__code {
        display: none;
    }

    .lang-selector__dropdown {
        right: -10px;
        min-width: 160px;
    }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-primary);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.pagination__link:hover {
    background-color: var(--color-surface);
    border-color: var(--color-text-secondary);
}

.pagination__link.active {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* ================================
   PRODUCT CARD ENHANCEMENTS
   ================================ */

/* Subtitle (short_description) */
.product-card__subtitle {
    font-family: var(--font-accent, Georgia, serif);
    font-style: italic;
    font-size: var(--text-xs, 0.75rem);
    color: var(--color-text-muted, #9B8F85);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hover second image from gallery */
.product-card__image {
    position: relative;
    overflow: hidden;
}

.product-card__img--hover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.product-card:hover .product-card__img--hover {
    opacity: 1;
}

.product-card__image > img:first-child,
.product-card__image > a > img:first-child {
    transition: opacity 0.5s ease;
}

/* Only hide first image on hover when a hover image exists */
.product-card__image:has(.product-card__img--hover) > img:first-child,
.product-card__image:has(.product-card__img--hover) > a > img:first-child {
    transition: opacity 0.5s ease;
}

.product-card:hover .product-card__image:has(.product-card__img--hover) > img:first-child,
.product-card:hover .product-card__image:has(.product-card__img--hover) > a > img:first-child {
    opacity: 0;
}

/* Collection badge */
.product-card__badge--collection {
    background-color: var(--color-accent, #C4A77D);
    color: white;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}