/* ==================================================
   RESPONSIVE DESIGN - MODERN COOPERATIVE WEBSITE
   ================================================== */

/* Variables CSS para consistencia */
:root {
    --primary-color: #2c5aa0;
    --secondary-color: #1a2947;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --shadow-light: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-medium: 0 10px 30px rgba(0,0,0,0.1);
    --shadow-heavy: 0 20px 40px rgba(0,0,0,0.15);
    --border-radius: 10px;
    --transition: all 0.3s ease;
}

/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    overflow-x: hidden;
}

/* ==================================================
   NAVBAR RESPONSIVE
   ================================================== */
.navbar {
    background: var(--white);
    padding: 15px 0;
    box-shadow: var(--shadow-light);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    height: 50px;
    width: auto;
    transition: var(--transition);
    max-width: 200px;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-menu a:hover::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Estilos para iconos de navegación */
.search-toggle,
.cart-icon {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-color);
}

.search-toggle:hover,
.cart-icon:hover {
    background-color: var(--light-bg);
    color: var(--primary-color);
}

.search-toggle svg,
.cart-icon svg {
    transition: var(--transition);
}

.cart-icon #cartCount {
    font-size: 14px;
    font-weight: 500;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-color);
    margin: 3px 0;
    transition: var(--transition);
}

/* ==================================================
   BUSCADOR EXPANDIBLE
   ================================================== */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 120px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 20px;
}

.search-input {
    width: 100%;
    padding: 20px 60px 20px 20px;
    font-size: 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    outline: none;
    background: var(--white);
    color: var(--text-color);
    box-shadow: var(--shadow-heavy);
}

.search-input::placeholder {
    color: #999;
}

.search-close {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: var(--text-color);
    transition: var(--transition);
}

.search-close:hover {
    color: var(--primary-color);
}

.search-results {
    width: 100%;
    max-width: 600px;
    margin: 20px;
    background: var(--white);
    border-radius: var(--border-radius);
    max-height: 400px;
    overflow-y: auto;
    box-shadow: var(--shadow-heavy);
    display: none;
}

.search-results.show {
    display: block;
}

.search-result-item {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: var(--light-bg);
}

.search-result-image {
    width: 50px;
    height: 50px;
    border-radius: 5px;
    object-fit: cover;
}

.search-result-content {
    flex: 1;
}

.search-result-title {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 5px;
}

.search-result-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.search-result-type {
    background: var(--primary-color);
    color: var(--white);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.no-results {
    padding: 30px 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* ==================================================
   HERO SECTION RESPONSIVE
   ================================================== */
.hero {
    height: 100vh;
    min-height: 600px;
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('../img/hero-fishing.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    margin-top: 80px;
}

.hero-content {
    max-width: 800px;
    padding: 0 20px;
}

.hero-content h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 20px;
    font-weight: 300;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    animation: fadeInUp 1s ease-out;
}

.hero-content p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    animation: fadeInUp 1s ease-out 0.2s both;
}

/* ==================================================
   PRODUCTS SECTION RESPONSIVE
   ================================================== */
.products-section {
    padding: 80px 20px;
    background: var(--light-bg);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: 60px;
    color: var(--text-color);
    font-weight: 300;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.product-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    transition: var(--transition);
    text-align: center;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-heavy);
}

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-info {
    padding: 30px 20px;
}

.product-name {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 15px;
}

.ver-mas-btn {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    font-size: 1rem;
    display: block;
    margin: 30px auto 0;
}

.ver-mas-btn:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

/* ==================================================
   ARTICLE SECTIONS RESPONSIVE
   ================================================== */
.article-section {
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    color: var(--white);
    overflow: hidden;
}

.article-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1;
}

.article-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px;
    width: 100%;
}

.article-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 20px;
    font-weight: 300;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.article-text {
    font-size: clamp(1rem, 2vw, 1.1rem);
    line-height: 1.8;
    max-width: 600px;
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.abulon-section {
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('../img/Abulon.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.oyster-section {
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('../img/Ostion.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* ==================================================
   AWARDS SECTION RESPONSIVE
   ================================================== */
.awards-section {
    padding: 80px 20px;
    background: var(--light-bg);
    text-align: center;
}

.award-content {
    max-width: 800px;
    margin: 0 auto;
}

.award-title {
    font-size: clamp(1.8rem, 4vw, 2.2rem);
    margin-bottom: 30px;
    color: var(--text-color);
    font-weight: 400;
}

.award-description {
    font-size: clamp(1rem, 2vw, 1.1rem);
    line-height: 1.8;
    color: #666;
}

/* ==================================================
   GALLERY RESPONSIVE
   ================================================== */
.gallery-section {
    padding: 80px 20px;
    background: var(--white);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
    aspect-ratio: 1;
    box-shadow: var(--shadow-medium);
    transition: var(--transition);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-item:hover .gallery-image {
    transform: scale(1.1);
}

/* ==================================================
   FOOTER RESPONSIVE
   ================================================== */
.footer {
    background: var(--secondary-color);
    color: var(--white);
    padding: 60px 20px 30px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-section h3 {
    margin-bottom: 20px;
    font-size: 1.3rem;
    color: var(--white);
}

.footer-section img {
    max-width: 150px;
    height: auto;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

.footer-section img:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.footer-section h4 {
    margin: 20px 0 10px 0;
    font-size: 1.1rem;
    color: var(--white);
}

.footer-section p,
.footer-section a {
    color: #ccc;
    text-decoration: none;
    line-height: 1.8;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--white);
}

.footer-description {
    font-style: italic;
    margin-top: 15px;
    font-size: 0.9rem;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--white);
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 40px;
    padding-top: 20px;
    text-align: center;
}

.footer-legal {
    margin-top: 10px;
    font-size: 0.9rem;
}

.footer-legal a {
    color: #ccc;
    text-decoration: none;
    transition: var(--transition);
}

.footer-legal a:hover {
    color: var(--white);
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: var(--transition);
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.social-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.4);
}

.social-icon svg {
    width: 20px;
    height: 20px;
    fill: #ccc;
    transition: var(--transition);
}

.social-icon:hover svg {
    fill: var(--white);
}

/* Specific social network colors on hover */
.social-icon.instagram:hover {
    background: linear-gradient(45deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d);
}

.social-icon.facebook:hover {
    background: #1877f2;
}

/* Hero content improvements */
.hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    margin-bottom: 15px;
    font-weight: 400;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.hero-description {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    max-width: 700px;
    margin: 0 auto;
}

/* Section descriptions */
.section-description {
    text-align: center;
    font-size: 1.1rem;
    color: #666;
    max-width: 800px;
    margin: 0 auto 40px;
    line-height: 1.6;
}

/* Product descriptions */
.product-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    margin-top: 10px;
}

/* Sustainability features */
.sustainability-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature {
    text-align: center;
    padding: 20px;
    background: rgba(44, 90, 160, 0.1);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.feature:hover {
    background: rgba(44, 90, 160, 0.15);
    transform: translateY(-5px);
}

.feature h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.feature p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

/* ==================================================
   ANIMATIONS
   ================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ==================================================
   RESPONSIVE BREAKPOINTS
   ================================================== */

/* Large tablets and small desktops */
@media (max-width: 1024px) {
    .nav-container {
        padding: 0 15px;
    }
    
    .hero {
        background-attachment: scroll;
    }
    
    .article-section {
        background-attachment: scroll;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 25px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* Tablets */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow-medium);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Buscador en tablets */
    .search-overlay {
        padding-top: 100px;
    }
    
    .search-input {
        font-size: 1.3rem;
        padding: 18px 50px 18px 18px;
    }
    
    .search-results {
        margin: 15px;
        max-height: 350px;
    }
    
    .hero {
        min-height: 500px;
        padding: 0 15px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
        margin-bottom: 15px;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 40px;
    }
    
    .article-title {
        font-size: 2rem;
    }
    
    .article-content {
        padding: 60px 20px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-card {
        max-width: 400px;
        margin: 0 auto;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .awards-section,
    .products-section,
    .gallery-section {
        padding: 60px 15px;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .nav-container {
        padding: 0 10px;
    }
    
    .logo {
        height: 40px;
        max-width: 150px;
    }
    
    .hero {
        min-height: 400px;
        margin-top: 70px;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    .hero-content p {
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 30px;
    }
    
    .article-title {
        font-size: 1.5rem;
        line-height: 1.2;
    }
    
    .article-text {
        font-size: 0.9rem;
    }
    
    .article-content {
        padding: 40px 15px;
    }
    
    .product-info {
        padding: 20px 15px;
    }
    
    .product-name {
        font-size: 1.3rem;
    }
    
    .ver-mas-btn {
        padding: 10px 25px;
        font-size: 0.9rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .award-title {
        font-size: 1.4rem;
    }
    
    .award-description {
        font-size: 0.9rem;
    }
    
    .footer {
        padding: 40px 15px 20px;
    }
    
    .footer-section h3 {
        font-size: 1.1rem;
    }
    
    .footer-section p {
        font-size: 0.9rem;
    }
    
    .awards-section,
    .products-section,
    .gallery-section {
        padding: 40px 10px;
    }
    
    /* Buscador en móviles */
    .search-overlay {
        padding-top: 80px;
    }
    
    .search-container {
        margin: 0 10px;
    }
    
    .search-input {
        font-size: 1.1rem;
        padding: 15px 45px 15px 15px;
    }
    
    .search-results {
        margin: 10px;
        max-height: 300px;
    }
    
    .search-result-item {
        padding: 12px 15px;
        gap: 10px;
    }
    
    .search-result-image {
        width: 40px;
        height: 40px;
    }
    
    .search-result-title {
        font-size: 0.9rem;
    }
    
    .search-result-description {
        font-size: 0.8rem;
    }
    
    .search-result-type {
        font-size: 0.7rem;
        padding: 1px 6px;
    }
    
    /* Cart sidebar responsive */
    .cart-sidebar {
        width: 100vw;
        right: -100vw;
    }
    
    .cart-content {
        padding: 70px 15px 20px;
    }
    
    /* Footer responsive improvements */
    .footer-section img {
        max-width: 120px;
        padding: 12px;
    }
    
    .social-icons {
        justify-content: center;
    }
    
    .social-icon {
        width: 35px;
        height: 35px;
    }
    
    .social-icon svg {
        width: 18px;
        height: 18px;
    }
}

/* Extra small devices */
@media (max-width: 320px) {
    .nav-container {
        padding: 0 5px;
    }
    
    .hero-content h1 {
        font-size: 1.3rem;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .article-title {
        font-size: 1.3rem;
    }
    
    .products-grid {
        gap: 20px;
    }
    
    .gallery-grid {
        gap: 10px;
    }
    
    /* Buscador en dispositivos muy pequeños */
    .search-overlay {
        padding-top: 70px;
    }
    
    .search-container {
        margin: 0 5px;
    }
    
    .search-input {
        font-size: 1rem;
        padding: 12px 40px 12px 12px;
    }
    
    .search-results {
        margin: 5px;
        max-height: 250px;
    }
    
    .search-result-item {
        padding: 10px 12px;
        gap: 8px;
        flex-direction: column;
        text-align: center;
    }
    
    .search-result-image {
        width: 35px;
        height: 35px;
        align-self: center;
    }
    
    .search-result-title {
        font-size: 0.85rem;
    }
    
    .search-result-description {
        font-size: 0.75rem;
        display: none; /* Ocultar descripción en pantallas muy pequeñas */
    }
    
    .no-results {
        padding: 20px 15px;
    }
}

/* ==================================================
   CART SIDEBAR
   ================================================== */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--white);
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    z-index: 2000;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.cart-sidebar:not(.hidden) {
    right: 0;
}

.cart-content {
    padding: 80px 20px 20px;
}

.cart-content h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-color);
    border-bottom: 2px solid var(--light-bg);
    padding-bottom: 10px;
}

.cart-total {
    border-top: 2px solid var(--light-bg);
    padding-top: 20px;
    margin-top: 20px;
}

.cart-total p {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.checkout-btn {
    width: 100%;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 15px;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.checkout-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* ==================================================
   UTILITY CLASSES
   ================================================== */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mt-4 { margin-top: 40px; }

.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.mb-4 { margin-bottom: 40px; }

.hidden {
    display: none;
}

.visible {
    display: block;
}

/* ==================================================
   PERFORMANCE OPTIMIZATIONS
   ================================================== */
.product-image,
.gallery-image {
    will-change: transform;
}

.product-card,
.gallery-item {
    will-change: transform, box-shadow;
}

/* Preload critical images */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../img/hero-fishing.jpg') center/cover;
    z-index: -1;
}
