.wp-block-woo-gastro-partners-wrapper {
    margin: 30px 0;
}

@media (max-width: 768px) {
    .wp-block-woo-gastro-partners-wrapper {
        margin: 20px 0;
    }
}

@media (max-width: 480px) {
    .wp-block-woo-gastro-partners-wrapper {
        margin: 15px 0;
    }
}

.gastro-partners-search {
    margin-bottom: 30px;
    max-width: 600px;
}

.gastro-search-input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 0;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.gastro-search-input:focus {
    border-color: var(--primary-color, #a6892c);
}

.wp-block-woo-gastro-partners {
    display: grid !important;
    gap: 30px;
}

.wp-block-woo-gastro-partners.columns-1 { grid-template-columns: 1fr !important; }
.wp-block-woo-gastro-partners.columns-2 { grid-template-columns: repeat(2, 1fr) !important; }
.wp-block-woo-gastro-partners.columns-3 { grid-template-columns: repeat(3, 1fr) !important; }
.wp-block-woo-gastro-partners.columns-4 { grid-template-columns: repeat(4, 1fr) !important; }

@media (max-width: 1024px) {
    .wp-block-woo-gastro-partners {
        gap: 20px;
    }
    .wp-block-woo-gastro-partners.columns-4 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .wp-block-woo-gastro-partners.columns-3,
    .wp-block-woo-gastro-partners.columns-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .wp-block-woo-gastro-partners {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
}

.gastro-partner-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #f0f0f0;
    border-radius: 0;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    height: 100%;
}

.gastro-partner-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.partner-logo,
.partner-logo-placeholder {
    aspect-ratio: 1 / 1;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px; /* Slightly more padding for better consistency */
    border-bottom: 1px solid #f0f0f0;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.partner-logo a,
.partner-logo-placeholder a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.partner-logo img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.gastro-partner-card:hover .partner-logo,
.gastro-partner-card:focus-within .partner-logo,
.gastro-partner-card:hover .partner-logo-placeholder,
.gastro-partner-card:focus-within .partner-logo-placeholder {
    filter: grayscale(0%);
}

.partner-logo-placeholder .dashicons {
    font-size: clamp(32px, 50%, 64px);
    width: 1em;
    height: 1em;
    color: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.partner-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.partner-title {
    margin: 0 0 10px 0 !important;
    font-size: 1.25rem;
    line-height: 1.3;
}

.partner-title a {
    color: #333;
    text-decoration: none;
}

.partner-title a:hover {
    color: var(--primary-color, #a6892c);
}

.partner-title-link::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.partner-email-link {
    position: relative;
    z-index: 2;
}

.partner-address {
    font-size: 0.875rem;
    color: #777;
    margin-bottom: 15px;
    line-height: 1.5;
}

.partner-short-desc {
    font-size: 0.9375rem;
    color: #555;
    margin-bottom: 20px;
    line-height: 1.6;
}

.partner-website {
    margin-top: auto;
    padding-top: 10px;
}

.partner-website-link {
    display: inline-block;
    background: var(--primary-color, #a6892c);
    color: #fff !important;
    padding: 8px 20px;
    border-radius: 0;
    text-decoration: none !important;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.partner-website-link:hover {
    background: var(--link-hover-color, #8c711a);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Single Partner Detail Page Styling */
.single-gastro_partner .entry-title {
    font-size: 60px !important;
    font-family: 'Cormorant Garamond', serif !important;
    font-style: italic;
    margin-bottom: 20px;
}

.gastro-partner-detail {
    max-width: 1000px;
    margin: 40px auto;
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color, #333);
}

.gastro-back-to-list {
    margin-bottom: 25px;
}

.gastro-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background-color: #f5f5f5;
    color: #333 !important;
    text-decoration: none !important;
    border-radius: 0;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    border: 1px solid #e0e0e0;
}

.gastro-back-link:hover {
    background-color: var(--primary-color, #a6892c);
    color: #fff !important;
    border-color: var(--primary-color, #a6892c);
    transform: translateX(-3px);
}

.gastro-back-link .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.gastro-partner-header-section {
    display: flex;
    gap: 40px;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.gastro-partner-logo-large {
    flex: 0 0 300px;
    height: 300px;
    background: #f9f9f9;
    border-radius: 0;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #f0f0f0;
    overflow: hidden;
}

.gastro-partner-logo-large img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
}

.gastro-partner-logo-large .dashicons {
    font-size: 100px;
    width: 100px;
    height: 100px;
    color: #ccc;
}

.gastro-partner-quick-info {
    flex: 1;
}

/* Editor Specific Styles */
.woo-gastro-block-preview-banner {
    background: #333 !important;
    border: 1px solid #000;
    border-radius: 0;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff !important;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    margin-bottom: 0;
    z-index: 10;
    position: relative;
}

.woo-gastro-block-preview-banner .dashicons {
    color: var(--primary-color, #a6892c) !important;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.woo-gastro-block-preview-banner .banner-text {
    color: #fff !important;
    font-size: 14px;
    line-height: 1;
}


/* Ensure grid works in editor even if container is narrow */
.is-editor-preview .wp-block-woo-gastro-partners,
.block-editor-block-list__block .wp-block-woo-gastro-partners {
    display: grid !important;
}

.gastro-partner-short-description {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 30px;
    font-style: italic;
}

.gastro-partner-meta-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.gastro-meta-column h4 {
    margin: 0 0 10px 0 !important;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-color, #a6892c);
}

.gastro-meta-column p {
    margin: 0;
    font-size: 0.95rem;
    color: #444;
}

.gastro-partner-taxonomies {
    margin-top: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.gastro-terms {
    font-size: 0.85rem;
    color: #666;
}

.gastro-terms a {
    color: var(--primary-color, #a6892c);
    text-decoration: none;
}

.gastro-terms a:hover {
    text-decoration: underline;
}

.gastro-meta-column .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    margin-right: 5px;
    vertical-align: middle;
    color: #888;
}

.gastro-partner-content {
    margin-bottom: 60px;
    font-size: 1.05rem;
}

.gastro-partner-linked-products {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #eee;
}

.gastro-partner-linked-products h3 {
    margin-bottom: 30px !important;
}

.gastro-products-display-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
}

.gastro-product-display-card {
    border: 1px solid #eee;
    border-radius: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #fff;
}

.gastro-product-display-card:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    transform: translateY(-5px);
}

.gastro-product-display-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.gastro-product-display-card .product-img {
    height: 180px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gastro-product-display-card .product-img img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

.gastro-product-display-card .product-details {
    padding: 15px;
}

.gastro-product-display-card h4 {
    margin: 0 0 5px 0 !important;
    font-size: 1rem;
    color: #333;
}

.gastro-product-display-card .product-price {
    font-weight: 700;
    color: var(--primary-color, #a6892c);
}

.gastro-partner-contact-section {
    margin-top: 60px;
    background: rgba(var(--primary-color-rgb, 166, 137, 44), 0.05);
    padding: 30px;
    border-radius: 0;
    border: 1px solid rgba(var(--primary-color-rgb, 166, 137, 44), 0.1);
}

.gastro-partner-contact-section h3 {
    margin-top: 0 !important;
    margin-bottom: 20px !important;
}

.gastro-contact-card {
    display: flex;
    align-items: center;
    gap: 20px;
}

.gastro-contact-card .contact-avatar img {
    border-radius: 0;
    border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.gastro-contact-card .contact-details strong {
    font-size: 1.2rem;
    display: block;
    margin-bottom: 5px;
}

.gastro-contact-card .contact-details p {
    margin: 0;
}

.gastro-contact-card .contact-details .dashicons {
    color: var(--primary-color, #a6892c);
    margin-right: 5px;
}

@media (max-width: 768px) {
    .gastro-partner-header-section {
        flex-direction: column;
    }
    
    .gastro-partner-logo-large {
        flex: 0 0 auto;
        width: 100%;
        height: 250px;
    }
    
    .gastro-partner-meta-info {
        grid-template-columns: 1fr;
    }
}

/* Partner Carousel */
.woo-gastro-partner-carousel-wrapper {
    position: relative;
    padding: 10px 0;
    margin: 20px 0;
}

.woo-gastro-carousel-container {
    overflow: hidden;
    width: 100%;
    padding: 30px 0;
}

.woo-gastro-carousel-track {
    display: flex;
    transition: transform 0.5s ease;
}

.woo-gastro-carousel-track.is-static {
    flex-wrap: wrap;
    justify-content: center;
    transition: none;
}

.woo-gastro-carousel-track.is-static .gastro-partner-carousel-item {
    margin-bottom: 20px;
}

.woo-gastro-carousel-track.animate-continuous {
    transition: none !important;
    animation: woo-gastro-marquee var(--marquee-speed, 20s) linear infinite;
}

.woo-gastro-carousel-track.animate-continuous:hover {
    animation-play-state: paused;
}

@keyframes woo-gastro-marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(var(--marquee-width, -100%)); }
}

.gastro-partner-carousel-item {
    padding: 0 10px;
    box-sizing: border-box;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.woo-gastro-partner-carousel-wrapper.is-loaded .gastro-partner-carousel-item {
    opacity: 1;
    transform: translateY(0);
}

.gastro-partner-carousel-item .gastro-partner-card {
    height: 100%;
    margin-bottom: 0;
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    width: 100%;
    background: #fff;
}

.gastro-partner-carousel-item .partner-logo,
.gastro-partner-carousel-item .partner-logo-placeholder {
    /* Maintain square even in carousel */
    aspect-ratio: 1 / 1;
    width: 100%;
}

/* Only Logo State */
.gastro-partner-card.only-logo {
    justify-content: center;
    aspect-ratio: 1 / 1;
}

.gastro-partner-card.only-logo .partner-logo,
.gastro-partner-card.only-logo .partner-logo-placeholder {
    flex-grow: 1;
    height: 100%;
    width: 100%;
    display: flex;
    background: transparent !important;
    border-bottom: none;
    padding: 30px; /* More padding when it's only the logo */
}

.gastro-partner-card.only-logo .partner-logo a,
.gastro-partner-card.only-logo .partner-logo-placeholder a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.gastro-partner-card.only-logo img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.gastro-partner-card.only-logo .partner-logo-placeholder .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
}

.woo-gastro-carousel-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

.woo-gastro-carousel-controls button {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #ddd;
    border-radius: 0;
    width: 40px;
    height: 40px;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    line-height: 1;
}

.woo-gastro-carousel-controls button:hover {
    background: #fff;
    color: var(--primary-color, #a6892c);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.woo-carousel-prev {
    margin-left: -20px;
}

.woo-carousel-next {
    margin-right: -20px;
}

@media (max-width: 768px) {
    .woo-carousel-prev {
        margin-left: 0;
    }

    .woo-carousel-next {
        margin-right: 0;
    }
}
