/* 
 * Brodero - Custom Styles
 * Design minimalist și modern pentru magazin de broderie
 */

:root {
    --primary-color: #2d3748;
    --secondary-color: #4a5568;
    --accent-color: #718096;
    --dark-color: #1a202c;
    --light-color: #f7fafc;
    --text-color: #2d3748;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --success-color: #48bb78;
    --danger-color: #f56565;
    --warning-color: #ed8936;
    --background: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--background);
}

/* Navbar Styling */
.navbar {
    padding: 1.5rem 0;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    z-index: 1030;
    min-height: auto;
}

/* Fix pentru navbar sticky pe mobile */
.navbar.sticky-top {
    z-index: 1030;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-color);
    padding: 0.25rem 0;
    margin-right: 1rem;
    line-height: 1.2;
}

.navbar-brand i {
    font-size: 1.5rem;
    vertical-align: middle;
}

.navbar-brand span {
    vertical-align: middle;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 0.75rem !important;
    transition: color 0.3s ease;
    color: var(--text-color);
    line-height: 1.5;
}

.navbar-nav {
    align-items: center;
}

.navbar-toggler {
    padding: 0.5rem 0.75rem;
    font-size: 1.25rem;
    border: 1px solid rgba(0,0,0,0.1);
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(to bottom, var(--light-color) 0%, #ffffff 100%);
    color: var(--text-color);
    padding: 4rem 0;
    position: relative;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--dark-color);
    letter-spacing: -0.02em;
}

.hero-section p {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-weight: 400;
}

/* Buttons */
.btn {
    padding: 0.625rem 1.75rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    font-size: 0.9375rem;
}

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

.btn-primary:hover {
    background-color: var(--dark-color);
    border-color: var(--dark-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--border-color);
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--light-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

.btn-white:hover {
    background-color: var(--light-color);
    border-color: var(--primary-color);
}

/* Cards */
.card {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    overflow: hidden;
    background-color: white;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    border-color: var(--accent-color);
}

.card-img-top {
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card:hover .card-img-top {
    transform: scale(1.02);
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.card-text {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Product Card */
.product-card {
    position: relative;
}

.product-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background-color: var(--dark-color);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 1;
    letter-spacing: 0.025em;
}

/* Product Card Footer - Responsive Layout */
.product-card-footer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.product-price-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.product-price {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--dark-color);
}

.product-price-old {
    font-size: 1rem;
    color: var(--text-muted);
    text-decoration: line-through;
    font-weight: 400;
}

/* Product Actions - Single Line with Flexbox */
.product-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    align-items: stretch;
}

.product-actions .btn {
    flex: 1;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.product-details-btn {
    flex: 1.2;
}

.add-to-cart-btn {
    flex: 1;
}

/* Mobile Optimization */
@media (max-width: 576px) {
    .product-card-footer {
        gap: 0.5rem;
    }
    
    .product-price {
        font-size: 1.25rem;
    }
    
    .product-price-old {
        font-size: 0.875rem;
    }
    
    .product-actions .btn {
        padding: 0.5rem 0.5rem;
        font-size: 0.8125rem;
    }
    
    .product-actions .btn i {
        font-size: 0.875rem;
    }
}

/* Extra Small Devices */
@media (max-width: 400px) {
    .product-actions .btn {
        padding: 0.5rem 0.375rem;
        font-size: 0.75rem;
    }
    
    .product-price {
        font-size: 1.125rem;
    }
}

/* Section Titles */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--dark-color);
    margin-top: 1rem;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2.5rem;
    font-weight: 400;
}

/* Features */
.feature-icon {
    width: 64px;
    height: 64px;
    background: var(--light-color);
    color: var(--dark-color);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

/* Footer */
footer {
    background-color: var(--dark-color);
}

footer a {
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--primary-color) !important;
}

/* Forms */
.form-control, .form-select {
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    padding: 0.625rem 0.875rem;
    transition: all 0.2s ease;
    font-size: 0.9375rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 55, 72, 0.1);
    outline: none;
}

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

/* Pagination */
.pagination {
    gap: 0.375rem;
}

.page-link {
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
}

.page-link:hover {
    background-color: var(--light-color);
    border-color: var(--primary-color);
    color: var(--dark-color);
}

.page-item.active .page-link {
    background-color: var(--dark-color);
    border-color: var(--dark-color);
    color: white;
}

/* Badges */
.badge {
    padding: 0.375rem 0.75rem;
    font-weight: 500;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    letter-spacing: 0.025em;
}

/* Filters */
.filter-section {
    background-color: var(--light-color);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.filter-section h5 {
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Tables */
.table {
    border-radius: 0.375rem;
    overflow: hidden;
}

.table thead {
    background-color: var(--light-color);
    color: var(--text-color);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    font-size: 0.875rem;
}

/* Alerts */
.alert {
    border-radius: 0.375rem;
    border: 1px solid;
    border-left-width: 3px;
}

/* Loading Spinner */
.spinner-border {
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .product-card .card-img-top {
        height: 200px;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Utility Classes */
.text-primary-gradient {
    color: var(--dark-color);
}

.shadow-custom {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.rounded-custom {
    border-radius: 0.5rem;
}

/* Newsletter Form Validation */
.newsletter-form .form-control.is-valid {
    border-color: var(--success-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2310b981' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.newsletter-form .form-control.is-invalid {
    border-color: var(--danger-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23ef4444'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23ef4444' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.newsletter-form .invalid-feedback {
    display: none;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--danger-color);
}

.newsletter-form .form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

.newsletter-form .input-group .form-control.is-valid,
.newsletter-form .input-group .form-control.is-invalid {
    padding-right: calc(1.5em + 0.75rem);
}

/* Animație pentru butonul de submit newsletter */
.newsletter-form button[type="submit"] {
    transition: all 0.3s ease;
}

.newsletter-form button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.newsletter-form button[type="submit"]:active {
    transform: translateY(0);
}

/* Badge și elemente */
.badge {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.025em;
}

.badge.bg-dark {
    background-color: var(--dark-color) !important;
    color: white;
}

.cart-count {
    font-size: 0.65rem;
    min-width: 20px;
    height: 20px;
    padding: 0.25rem 0.5rem !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Section borders */
section.border-bottom {
    border-bottom: 1px solid var(--border-color) !important;
}

/* Header consistency */
header .dropdown-menu {
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

/* Footer */
footer {
    background-color: var(--dark-color);
}

footer a {
    color: var(--text-muted);
}

/* Fix pentru elemente sticky în pagini (ex: imagini produs) */
/* Asigură că navbar-ul rămâne deasupra elementelor sticky din conținut */
.sticky-top:not(.navbar) {
    z-index: 1020; /* Mai mic decât navbar (1030) */
}

/* Media queries pentru mobile - asigură z-index corect */
@media (max-width: 991.98px) {
    .navbar.sticky-top {
        z-index: 1030 !important;
    }
    
    /* Pe mobile, elementele sticky din conținut au z-index și mai mic */
    .sticky-top:not(.navbar) {
        z-index: 1010;
    }
}

footer a:hover {
    color: white;
}
