.fabrics-header {
    margin-top: 10px;
    padding: 80px 0 60px;
    background: linear-gradient(135deg, #ffffff, var(--pink-light));
    position: relative;
    overflow: hidden;
}

.fabrics-header .header-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.fabrics-header .header-subtitle {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--crimson);
    margin-bottom: 15px;
    position: relative;
    padding: 0 15px;
}

.fabrics-header .header-subtitle::before,
.fabrics-header .header-subtitle::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30px;
    height: 1px;
    background: var(--crimson);
    opacity: 0.3;
}

.fabrics-header .header-subtitle::before {
    left: -30px;
}

.fabrics-header .header-subtitle::after {
    right: -30px;
}

.fabrics-header .header-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--dark-main);
}

.fabrics-header .header-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 25px;
}

.fabrics-header .header-divider span {
    height: 2px;
    background: var(--crimson);
}

.fabrics-header .header-divider span:nth-child(1),
.fabrics-header .header-divider span:nth-child(3) {
    width: 60px;
    opacity: 0.2;
}

.fabrics-header .header-divider span:nth-child(2) {
    width: 30px;
    opacity: 0.5;
}

.fabrics-header .header-description {
    font-size: 1.1rem;
    color: var(--dark-soft);
    line-height: 1.6;
    max-width: 700px;
    margin: 0 auto;
}

/* Knitting Navigation */
.knitting-nav-section {
    padding: 30px 0;
    background: white;
    border-bottom: 1px solid rgba(223, 34, 41, 0.1);
    position: sticky;
    top: 10px;
    z-index: 90;
}

.nav-pills-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.nav-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    background: #f5f5f5;
    color: var(--dark-soft);
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.nav-pill i {
    font-size: 1rem;
    color: var(--crimson);
    transition: all 0.25s ease;
}

.nav-pill:hover {
    background: #e9e9e9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.nav-pill.active {
    background: var(--crimson);
    color: white;
    box-shadow: 0 5px 15px rgba(223, 34, 41, 0.2);
}

.nav-pill.active i {
    color: white;
}

/* Main Fabrics Grid */
.fabrics-main-section {
    padding: 60px 0;
    background: white;
}

.fabrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.fabric-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(223, 34, 41, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    opacity: 1;
}

.fabric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(223, 34, 41, 0.08);
    border-color: rgba(223, 34, 41, 0.2);
}

.fabric-image {
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
}

.fabric-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.fabric-card:hover .fabric-image img {
    transform: scale(1.03);
}

.fabric-details {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.fabric-details h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark-main);
    margin-bottom: 8px;
    font-family: 'Playfair Display', serif;
}

.fabric-desc {
    color: var(--dark-soft);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 15px;
    opacity: 0.8;
}

.fabric-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}

.fabric-tags span {
    background: var(--pink-light);
    color: var(--crimson);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 500;
    border: 1px solid rgba(223, 34, 41, 0.1);
}

.sample-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--crimson);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 8px;
    margin-top: auto;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 10px rgba(223, 34, 41, 0.15);
}

.sample-link i {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.sample-link:hover {
    background: var(--dark-main);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    gap: 10px;
}

.sample-link:hover i {
    transform: translateX(3px);
}

/* Quick Specs */
.specs-section {
    padding: 40px 0;
    background: #fafafa;
    border-top: 1px solid rgba(223, 34, 41, 0.05);
    border-bottom: 1px solid rgba(223, 34, 41, 0.05);
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.spec-item i {
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--crimson);
    font-size: 1.2rem;
    border: 1px solid rgba(223, 34, 41, 0.1);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.02);
}

.spec-item strong {
    display: block;
    font-size: 0.9rem;
    color: var(--dark-main);
    margin-bottom: 3px;
}

.spec-item span {
    font-size: 0.8rem;
    color: var(--dark-soft);
    opacity: 0.8;
}

/* CTA Section */
.fabric-cta-section {
    padding: 60px 0 80px;
    background: white;
}

.fabric-cta-section .cta-card {
    background: linear-gradient(135deg, var(--dark-main), #2a2a2a);
    border-radius: 24px;
    padding: 45px;
    color: white;
}

.fabric-cta-section .cta-card h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.fabric-cta-section .cta-card p {
    font-size: 1rem;
    opacity: 0.8;
    margin-bottom: 0;
}

.fabric-cta-section .cta-btn {
    background: white;
    color: var(--crimson);
    border: none;
    padding: 14px 32px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.25s ease;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.fabric-cta-section .cta-btn:hover {
    background: var(--crimson);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(223, 34, 41, 0.3);
}

/* ===== SAMPLE REQUEST MODAL STYLES ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: modalFadeIn 0.3s ease;
}

/* Modal ARIA states */
.modal[aria-hidden="true"] {
    display: none !important;
}

.modal[aria-hidden="false"] {
    display: block !important;
}

.modal-content {
    background: white;
    margin: 30px auto;
    padding: 0;
    width: 90%;
    max-width: 550px;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 25px;
    background: linear-gradient(135deg, var(--crimson), var(--orchid));
    color: white;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header h3 {
    font-size: 1.3rem;
    margin: 0;
    color: white;
    font-family: 'Playfair Display', serif;
}

.close-modal {
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.close-modal:hover {
    transform: scale(1.2);
}

.modal-body {
    padding: 25px;
}

.selected-fabric-info {
    background: var(--pink-light);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px solid var(--crimson);
}

.selected-fabric-info h4 {
    font-size: 1.1rem;
    margin: 0 0 5px 0;
    color: var(--dark-main);
}

.selected-fabric-info p {
    margin: 5px 0;
    font-size: 0.9rem;
    color: var(--dark-soft);
}

.selected-fabric-info .fabric-tags {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.selected-fabric-info .fabric-tags span {
    background: white;
    color: var(--crimson);
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    border: 1px solid rgba(223, 34, 41, 0.2);
}

/* Type badges in modal */
.type-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin: 0 4px 4px 0;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.type-warp {
    background-color: #4a6fa5;
}

.type-circular {
    background-color: #6b8c42;
}

.type-flat {
    background-color: #b5654b;
}

/* Form Styles */
#sampleForm .form-group {
    margin-bottom: 18px;
}

#sampleForm label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--dark-main);
}

#sampleForm input,
#sampleForm textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #fafafa;
}

#sampleForm input:focus,
#sampleForm textarea:focus {
    outline: none;
    border-color: var(--crimson);
    background: white;
    box-shadow: 0 5px 15px rgba(223, 34, 41, 0.05);
}

#sampleForm input.error,
#sampleForm textarea.error {
    border-color: #ff4444;
    background: #fff8f8;
}

.submit-btn {
    width: 100%;
    padding: 14px 20px;
    background: var(--crimson);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.submit-btn:hover {
    background: var(--dark-main);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(223, 34, 41, 0.2);
}

.submit-btn i {
    font-size: 0.9rem;
}

.submit-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.submit-btn.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.form-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 10px;
    font-size: 0.9rem;
    display: none;
}

.form-message.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ===== ANIMATIONS ===== */

/* Fade-in animation for cards */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* Modal animations */
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Offline notification animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* Offline notification */
.offline-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #ff9800;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 10000;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease;
}

.offline-notification.fade-out {
    animation: slideOut 0.3s ease forwards;
}

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

@media (max-width: 1200px) {
    .fabrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 992px) {
    .knitting-nav-section {
        top: 65px;
        padding: 20px 0;
    }
    
    .nav-pill {
        padding: 10px 22px;
        font-size: 0.9rem;
    }
    
    .specs-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .type-badge {
        font-size: 0.65rem;
        padding: 2px 6px;
    }
}

@media (max-width: 768px) {
    .fabrics-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .fabric-image {
        height: 220px;
    }
    
    .fabric-cta-section .cta-card {
        padding: 30px 25px;
        text-align: center;
    }
    
    .fabric-cta-section .col-lg-4 {
        text-align: center !important;
        margin-top: 20px;
    }
    
    .fabric-cta-section .cta-btn {
        width: 100%;
        justify-content: center;
    }
    
    .offline-notification {
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        text-align: center;
        animation: slideInUp 0.3s ease;
    }
    
    @keyframes slideInUp {
        from {
            transform: translateY(100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
}

@media (max-width: 576px) {
    .fabrics-header {
        margin-top: 65px;
        padding: 60px 0 40px;
    }
    
    .fabrics-header .header-subtitle::before,
    .fabrics-header .header-subtitle::after {
        display: none;
    }
    
    .fabrics-header .header-title {
        font-size: 2rem;
    }
    
    .nav-pill {
        padding: 8px 16px;
        font-size: 0.8rem;
        border-radius: 8px;
    }
    
    .nav-pill i {
        font-size: 0.85rem;
    }
    
    .specs-grid {
        grid-template-columns: 1fr;
    }
    
    .spec-item {
        justify-content: center;
    }
    
    .sample-link {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
    
    .modal-content {
        margin: 15px auto;
        width: 95%;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    #sampleForm input,
    #sampleForm textarea {
        padding: 10px 12px;
    }
    
    .selected-fabric-info .fabric-tags span {
        font-size: 0.7rem;
        padding: 2px 8px;
    }
    
    .type-badge {
        font-size: 0.6rem;
        padding: 2px 5px;
        margin: 0 2px 2px 0;
    }
}