/* TDC Products - Frontend Styles v2.1 */

/* ==========================================
   VARIATION SIZE BUTTONS (like fleuristes-et-fleurs.com)
   ========================================== */

.tdc-variations-wrapper {
    margin: 15px 0;
}

.tdc-size-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 15px 0;
}

.tdc-size-btn {
    flex: 1;
    min-width: 100px;
    padding: 12px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fafafa;
    cursor: pointer;
    text-align: center;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    outline: none;
}

.tdc-size-btn:hover {
    border-color: #d30c67;
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(211, 12, 103, 0.15);
}

.tdc-size-btn.tdc-size-active {
    border-color: #d30c67;
    background: linear-gradient(135deg, #fce4ec, #fff);
    box-shadow: 0 3px 10px rgba(211, 12, 103, 0.2);
}

.tdc-size-icon {
    font-size: 1.5em;
}

.tdc-size-letter {
    font-size: 1.2em;
    font-weight: 800;
    color: #333;
}

.tdc-size-desc {
    font-size: 0.75em;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tdc-size-price {
    font-size: 1em;
    font-weight: 700;
    color: #d30c67;
    margin-top: 2px;
}

/* ==========================================
   SHOP HEADER
   ========================================== */

.tdc-shop-header {
    text-align: center;
    padding: 30px 20px 20px;
    margin-bottom: 10px;
}

.tdc-shop-title {
    font-size: 2em;
    font-weight: 800;
    color: #333;
    margin: 0 0 8px;
    letter-spacing: -0.5px;
}

.tdc-shop-subtitle {
    font-size: 1.05em;
    color: #777;
    margin: 0;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ==========================================
   CATALOGUE FILTERS (improved)
   ========================================== */

.tdc-catalogue-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

.tdc-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #fafafa;
    border-radius: 12px;
    border: 1px solid #eee;
}

.tdc-filters-toggle {
    display: none;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 4px 0;
    user-select: none;
    -webkit-user-select: none;
}

.tdc-filters-toggle-label {
    font-weight: 700;
    font-size: 0.9em;
    color: #444;
}

.tdc-filters-toggle-icon {
    font-size: 0.8em;
    transition: transform 0.3s ease;
    color: #888;
}

.tdc-filters-toggle-icon.open {
    transform: rotate(180deg);
}

.tdc-filters-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tdc-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tdc-filter-group label {
    font-weight: 600;
    color: #555;
    min-width: 85px;
    font-size: 0.8em;
    white-space: nowrap;
}

.tdc-filter-buttons,
.tdc-price-range {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tdc-filter-btn {
    padding: 5px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    font-size: 0.78em;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-weight: 500;
    color: #666;
    line-height: 1.3;
}

.tdc-filter-btn:hover {
    border-color: #d30c67;
    color: #d30c67;
    background: #fff5f8;
}

.tdc-filter-btn.active {
    background: #d30c67;
    color: #fff;
    border-color: #d30c67;
    box-shadow: 0 1px 6px rgba(211, 12, 103, 0.2);
}

.tdc-filter-count {
    font-size: 0.85em;
    opacity: 0.7;
}

/* Results bar */
.tdc-results-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 4px;
}

.tdc-results-count {
    font-size: 0.9em;
    color: #888;
    font-weight: 500;
}

.tdc-view-toggle {
    display: flex;
    gap: 6px;
}

.tdc-view-btn {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 0.75em;
    transition: all 0.2s;
    letter-spacing: 1px;
    color: #aaa;
}

.tdc-view-btn:hover {
    border-color: #d30c67;
    color: #d30c67;
}

.tdc-view-btn.active {
    background: #d30c67;
    color: #fff;
    border-color: #d30c67;
}

/* ==========================================
   PRODUCT CARDS
   ========================================== */

.tdc-products-grid {
    display: grid;
    gap: 20px;
}

.tdc-products-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.tdc-products-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.tdc-products-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.tdc-product-card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
}

.tdc-product-card:hover {
    box-shadow: 0 12px 35px rgba(211, 12, 103, 0.12);
    transform: translateY(-6px);
}

.tdc-product-card.hidden {
    display: none;
}

.tdc-product-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.tdc-product-image {
    aspect-ratio: 1;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f0f5, #f5f0f7);
    position: relative;
}

.tdc-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tdc-product-card:hover .tdc-product-image img {
    transform: scale(1.08);
}

/* Quick view overlay */
.tdc-product-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    padding: 40px 15px 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: center;
}

.tdc-product-card:hover .tdc-product-overlay {
    opacity: 1;
}

.tdc-quick-view-btn {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 0.82em;
    font-weight: 600;
    transform: translateY(10px);
    transition: transform 0.3s ease;
    white-space: nowrap;
}

.tdc-product-card:hover .tdc-quick-view-btn {
    transform: translateY(0);
}

.tdc-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 2em;
    color: #d30c67;
    text-align: center;
    line-height: 1.4;
}

.tdc-product-info {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.tdc-product-name {
    font-size: 0.98em;
    font-weight: 700;
    margin: 0 0 4px;
    color: #333;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.tdc-product-excerpt {
    font-size: 0.82em;
    color: #999;
    margin: 0 0 10px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.13em;
}

.tdc-product-price {
    font-size: 1em;
    margin-bottom: 8px;
}

.tdc-from {
    font-size: 0.8em;
    color: #999;
}

.tdc-amount {
    font-weight: 700;
    color: #d30c67;
    font-size: 1.15em;
}

.tdc-card-cta {
    display: inline-block;
    font-size: 0.82em;
    font-weight: 600;
    color: #d30c67;
    border: 1.5px solid #d30c67;
    padding: 6px 16px;
    border-radius: 25px;
    transition: all 0.25s ease;
    margin-top: 4px;
}

.tdc-product-card:hover .tdc-card-cta {
    background: #d30c67;
    color: #fff;
}

/* ==========================================
   CARD SIZE BUTTONS (catalogue listing)
   ========================================== */

.tdc-product-name-link {
    text-decoration: none;
    color: inherit;
}

.tdc-product-name-link:hover .tdc-product-name {
    color: #d30c67;
}

.tdc-card-sizes {
    display: flex;
    gap: 5px;
    margin: 8px 0;
    margin-top: auto;
}

.tdc-card-size-btn {
    flex: 1;
    padding: 6px 4px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    outline: none;
    min-width: 0;
}

.tdc-card-size-btn:hover {
    border-color: #d30c67;
    background: #fff;
}

.tdc-card-size-btn.tdc-card-size-active {
    border-color: #d30c67;
    background: linear-gradient(135deg, #fce4ec, #fff);
    box-shadow: 0 2px 8px rgba(211, 12, 103, 0.15);
}

.tdc-card-size-label {
    font-size: 0.85em;
    font-weight: 800;
    color: #333;
    line-height: 1;
}

.tdc-card-size-active .tdc-card-size-label {
    color: #d30c67;
}

.tdc-card-size-sep {
    font-size: 0.65em;
    color: #ccc;
    line-height: 1;
}

.tdc-card-size-active .tdc-card-size-sep {
    color: #d30c67;
}

.tdc-card-size-price {
    font-size: 0.7em;
    font-weight: 600;
    color: #888;
    line-height: 1;
    white-space: nowrap;
}

.tdc-card-size-active .tdc-card-size-price {
    color: #d30c67;
}

/* ==========================================
   CARD ADD TO CART BUTTON
   ========================================== */

.tdc-card-add-to-cart {
    display: block;
    width: 100%;
    padding: 9px 12px;
    background: #d30c67;
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 0.82em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    margin-top: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tdc-card-add-to-cart:hover {
    background: #b00a56;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(211, 12, 103, 0.3);
}

.tdc-card-add-to-cart.tdc-adding {
    background: #999;
    cursor: wait;
    pointer-events: none;
}

.tdc-card-add-to-cart.tdc-added {
    background: #2e7d32;
}

/* Spinner */
.tdc-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tdc-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}

@keyframes tdc-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================
   FLOATING CART NOTIFICATION
   ========================================== */

.tdc-cart-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15), 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 16px 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 320px;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-left: 4px solid #2e7d32;
}

.tdc-cart-notification.tdc-notif-visible {
    transform: translateX(0);
}

.tdc-notif-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tdc-notif-icon {
    font-size: 1.3em;
    cursor: pointer;
    flex-shrink: 0;
}

.tdc-notif-text {
    font-size: 0.9em;
    font-weight: 500;
    color: #333;
    line-height: 1.3;
}

.tdc-notif-cart-btn {
    display: block;
    text-align: center;
    background: #d30c67;
    color: #fff !important;
    padding: 10px 16px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.2s ease;
}

.tdc-notif-cart-btn:hover {
    background: #b00a56;
    transform: translateY(-1px);
}

.tdc-no-products,
.tdc-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    color: #888;
    font-size: 1.05em;
    background: #f9f9f9;
    border-radius: 12px;
}

/* ==========================================
   DELIVERY TAB
   ========================================== */

.tdc-delivery-zones-tab {
    display: grid;
    gap: 8px;
    margin: 15px 0;
}

.tdc-zone-item {
    padding: 10px 15px;
    background: #f5f5f5;
    border-radius: 6px;
    border-left: 3px solid #d30c67;
}

.tdc-zone-item strong {
    color: #d30c67;
}

/* ==========================================
   ARCHIVE PRICE DISPLAY
   ========================================== */

.tdc-price-from {
    font-size: 0.8em;
    color: #888;
    font-weight: 400;
}

.tdc-price-amount {
    font-size: 1.1em;
    font-weight: 700;
    color: #d30c67;
}

.tdc-product-badge {
    text-align: center;
    margin-top: 5px;
}

.tdc-delivery-badge {
    display: inline-block;
    padding: 3px 10px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
}

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

@media (max-width: 1024px) {
    .tdc-shop-title {
        font-size: 1.6em;
    }

    .tdc-products-grid.columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .tdc-products-grid.columns-3,
    .tdc-products-grid.columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .tdc-size-buttons {
        flex-wrap: wrap;
    }

    .tdc-size-btn {
        min-width: 70px;
    }

    .tdc-filters {
        padding: 10px 12px;
        gap: 0;
    }

    .tdc-filters-toggle {
        display: flex;
    }

    .tdc-filters-body {
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        transition: max-height 0.35s ease, opacity 0.25s ease, margin 0.3s ease;
        margin-top: 0;
    }

    .tdc-filters-body.tdc-filters-open {
        max-height: 500px;
        opacity: 1;
        margin-top: 10px;
    }

    .tdc-filter-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        padding: 6px 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .tdc-filter-group:last-child {
        border-bottom: none;
    }

    .tdc-filter-group label {
        min-width: auto;
        font-size: 0.75em;
    }

    .tdc-filter-btn {
        padding: 4px 10px;
        font-size: 0.72em;
    }

    .tdc-shop-header {
        padding: 20px 15px 12px;
    }

    .tdc-shop-title {
        font-size: 1.4em;
    }

    .tdc-shop-subtitle {
        font-size: 0.85em;
    }

    .tdc-view-toggle {
        display: none;
    }

    .tdc-product-overlay {
        display: none;
    }

    .tdc-product-info {
        padding: 12px 14px 14px;
        align-items: center;
        text-align: center;
    }

    .tdc-product-name {
        font-size: 0.88em;
        min-height: 2.3em;
    }

    .tdc-product-excerpt {
        font-size: 0.76em;
    }

    .tdc-card-sizes {
        gap: 3px;
        margin: 6px 0;
        flex-wrap: wrap;
        align-self: stretch;
    }

    .tdc-card-size-btn {
        flex: 1 1 calc(50% - 2px);
        padding: 5px 4px;
        flex-direction: row;
        gap: 3px;
        justify-content: center;
        border-radius: 6px;
        border-width: 1px;
    }

    .tdc-card-size-label {
        font-size: 0.78em;
        font-weight: 700;
    }

    .tdc-card-size-sep {
        display: none;
    }

    .tdc-card-size-price {
        font-size: 0.65em;
    }

    .tdc-card-add-to-cart {
        font-size: 0.76em;
        padding: 7px 8px;
        margin-top: 4px;
        align-self: stretch;
    }

    .tdc-cart-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .tdc-products-grid.columns-2,
    .tdc-products-grid.columns-3,
    .tdc-products-grid.columns-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .tdc-product-info {
        padding: 10px 10px 12px;
    }

    .tdc-product-name {
        font-size: 0.78em;
        min-height: 2em;
    }

    .tdc-product-excerpt {
        display: none;
    }

    .tdc-card-sizes {
        gap: 2px;
        margin: 4px 0;
        flex-wrap: wrap;
        align-self: stretch;
    }

    .tdc-card-size-btn {
        flex: 1 1 calc(50% - 1px);
        padding: 4px 2px;
        border-radius: 5px;
        flex-direction: row;
        gap: 2px;
        justify-content: center;
        border-width: 1px;
    }

    .tdc-card-size-label {
        font-size: 0.72em;
        font-weight: 700;
    }

    .tdc-card-size-sep {
        display: none;
    }

    .tdc-card-size-price {
        font-size: 0.58em;
    }

    .tdc-card-add-to-cart {
        font-size: 0.72em;
        padding: 5px 6px;
        margin-top: 4px;
        align-self: stretch;
    }
}
