/**
 * Components CSS
 * Extracted inline styles for better maintainability
 *
 * @package Mebel39
 */

/* ========================================
   MOBILE NAVIGATION
   ======================================== */

.mobile-nav {
    position: fixed;
    top: 0;
    left: -100%;
    width: 300px;
    height: 100vh;
    background: var(--color-bg-white);
    z-index: var(--z-modal);
    transition: left 0.3s ease;
    overflow-y: auto;
}

.mobile-nav.is-active {
    left: 0;
}

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
}

.mobile-nav-title {
    font-weight: var(--font-semibold);
}

.mobile-nav-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-sm);
}

.mobile-nav-content {
    padding: var(--spacing-md);
}

.mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-list li {
    border-bottom: 1px solid var(--color-border-light);
}

.mobile-nav-list a {
    display: block;
    padding: var(--spacing-md) 0;
    color: var(--color-text-dark);
    text-decoration: none;
}

.mobile-nav-list a:hover {
    color: var(--color-primary);
}

body.menu-open {
    overflow: hidden;
}

/* ========================================
   BACK TO TOP BUTTON
   ======================================== */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: var(--z-fixed);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.back-to-top:hover {
    background: var(--color-primary-hover);
    transform: translateY(-3px);
}

/* ========================================
   MODAL
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: var(--color-bg-white);
    border-radius: var(--card-radius-lg);
    padding: var(--spacing-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
}

.modal-header {
    margin-bottom: var(--spacing-lg);
}

.modal-title {
    font-size: var(--text-xl);
    margin: 0;
}

/* ========================================
   PRODUCT FEATURES (WooCommerce)
   ======================================== */

.product-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin: var(--spacing-lg) 0;
    padding: var(--spacing-lg);
    background: var(--color-bg);
    border-radius: var(--card-radius);
}

.product-feature {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.product-feature svg {
    flex-shrink: 0;
}

.product-feature span {
    font-size: var(--text-sm);
}

/* ========================================
   PRODUCT ACTIONS
   ======================================== */

.product-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.product-actions .btn {
    width: 100%;
    text-align: center;
}

/* ========================================
   CATEGORY IMAGE
   ======================================== */

.category-image {
    margin-bottom: var(--spacing-xl);
    border-radius: var(--card-radius-lg);
    overflow: hidden;
}

.category-image img {
    width: 100%;
    height: auto;
}

/* ========================================
   DELIVERY/WARRANTY TABS
   ======================================== */

.delivery-tab,
.warranty-tab {
    display: grid;
    gap: var(--spacing-md);
}

.delivery-tab h2,
.warranty-tab h2 {
    margin-bottom: var(--spacing-md);
}

.delivery-item,
.warranty-item {
    padding: var(--spacing-md);
    background: var(--color-bg);
    border-radius: var(--btn-radius);
}

.delivery-item h4,
.warranty-item h4 {
    margin-bottom: var(--spacing-sm);
}

.delivery-item p,
.warranty-item p {
    margin: 0;
    color: var(--color-text);
}

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

@media (max-width: 767px) {
    .mobile-nav {
        width: 100%;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }
    
    .product-features {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   DARK MODE
   ======================================== */

[data-theme="dark"] .mobile-nav {
    background: var(--color-bg-white);
}

[data-theme="dark"] .modal-content {
    background: var(--color-bg-white);
}

[data-theme="dark"] .product-features {
    background: var(--color-bg-dark);
}

[data-theme="dark"] .delivery-item,
[data-theme="dark"] .warranty-item {
    background: var(--color-bg-dark);
}

/* ========================================
   NOTIFICATIONS
   ======================================== */

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    color: #fff;
    border-radius: 8px;
    z-index: 9999;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.notification-success {
    background: #10b981;
}

.notification-error {
    background: #ef4444;
}

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

@media (max-width: 767px) {
    .notification {
        left: 20px;
        right: 20px;
        top: auto;
        bottom: 20px;
    }
}

/* ========================================
   PHONE INPUT WITH COUNTRY CODE
   ======================================== */

.phone-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.phone-country-code {
    width: 140px;
    flex-shrink: 0;
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: var(--input-radius, 8px);
    padding: 10px 12px;
    font-size: var(--text-sm, 14px);
    color: var(--color-text-dark);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.phone-country-code:hover {
    border-color: var(--color-primary);
}

.phone-country-code:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.phone-input {
    flex: 1;
    min-width: 0;
}

@media (max-width: 480px) {
    .phone-input-wrapper {
        flex-direction: column;
        gap: 10px;
    }
    
    .phone-country-code {
        width: 100%;
    }
}

/* ========================================
   DESIGNER-NEXT WARNINGS
   ======================================== */

#dn-warnings {
    background: #fff8e1;
    border: 1px solid #ffcc02;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    font-size: 13px;
}

#dn-warnings ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

#dn-warnings li {
    margin-bottom: 4px;
}

.dn-warn-critical {
    color: #dc2626;
    font-weight: 600;
}
