/**
 * Duritti Materials - Frontend Product Grid Shortcode Styles
 * 
 * Premium, minimalist aesthetic matching the main homepage design.
 */

.dmp-product-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    margin: 60px 0;
    font-family: inherit;
}

.dmp-product-card {
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s ease;
    width: 100%;
    max-width: 300px; /* Constrain max width per item to match grid behavior */
    flex: 1 1 300px;  /* Grow and shrink but base width is 300px */
}

.dmp-product-card-link {
    text-decoration: none !important;
    color: inherit !important;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.dmp-product-card-link:hover,
.dmp-product-card-link:focus {
    color: inherit;
    text-decoration: none;
}

/* Image Wrapper (1:1 Aspect Ratio) */
.dmp-product-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%;
    /* Square format */
    overflow: hidden;
    background-color: #f7f7f7;
    margin-bottom: 0;
}

.dmp-product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    /* Prevents image dragging issues */
}

/* Hover Effect - Subtle Zoom */
.dmp-product-card:hover .dmp-product-image {
    transform: scale(1.05);
}

/* Product Info Container */
.dmp-product-info {
    padding: 24px 10px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-grow: 1;
}

/* Product Title */
.dmp-product-title {
    font-size: 15px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0 0 20px 0;
    line-height: 1.4;
    color: #111;
}

/* Premium Button (like "VER COLECCIÓN") */
.dmp-product-button {
    display: inline-block;
    padding: 12px 28px;
    background-color: transparent;
    border: 1px solid #111;
    color: #111;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    line-height: 1;
    margin-top: auto;
}

/* Button Hover State */
.dmp-product-card:hover .dmp-product-button {
    background-color: #111;
    color: #fff;
    border-color: #111;
}

/* No Products Message */
.dmp-no-products {
    text-align: center;
    padding: 60px 20px;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    background: #fdfdfd;
    border: 1px dashed #eaeaea;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .dmp-product-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
        margin: 40px 0;
    }

    .dmp-product-info {
        padding: 18px 5px 5px;
    }

    .dmp-product-title {
        font-size: 14px;
        margin-bottom: 16px;
    }

    .dmp-product-button {
        padding: 10px 20px;
        font-size: 10px;
    }
}

/* Single Product Wrapper */
.dmp-single-product-wrapper {
    max-width: 500px;
    margin: 40px auto;
}

/* Product Specs (Technical Details) */
.dmp-product-specs {
    margin: 60px auto;
    max-width: 900px;
    font-family: inherit;
    background: transparent;
    padding: 0;
}

.dmp-specs-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0 0 30px 0;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
    color: #111;
    text-align: left;
}

.dmp-specs-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    /* Remove gap so borders touch nicely */
}

@media (min-width: 768px) {
    .dmp-specs-grid {
        grid-template-columns: 1fr 1fr;
        column-gap: 60px;
    }
}

.dmp-spec-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f2f2f2;
}

.dmp-spec-item:last-child {
    border-bottom: none;
}

.dmp-spec-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #666;
    width: 40%;
}

.dmp-spec-value {
    font-size: 12px;
    font-weight: 400;
    color: #111;
    text-align: left;
    width: 60%;
}

/* Premium Search Form */
.dmp-search-container {
    max-width: 600px;
    margin: 30px auto;
}

.dmp-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    border-bottom: 2px solid #111;
    padding-bottom: 5px;
    transition: border-color 0.3s ease;
}

.dmp-search-input-wrapper:focus-within {
    border-bottom-color: #A11A33;
    /* Duritti brand color */
}

.dmp-search-field {
    width: 100%;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 16px;
    padding: 10px 50px 10px 0;
    color: #111;
    outline: none;
    box-shadow: none;
    line-height: 1.5;
}

.dmp-search-field::placeholder {
    color: #999;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
}

.dmp-search-submit {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 10px;
    cursor: pointer;
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.dmp-search-submit:hover {
    color: #A11A33;
}

/* AJAX Search Results Dropdown */
.dmp-ajax-search-form {
    position: relative;
}

.dmp-search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #eaeaea;
    border-top: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    z-index: 9999;
    max-height: 400px;
    overflow-y: auto;
}

.dmp-ajax-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dmp-ajax-result-item {
    border-bottom: 1px solid #f7f7f7;
    transition: background-color 0.2s ease;
}

.dmp-ajax-result-item:hover {
    background-color: #fcfcfc;
}

.dmp-ajax-result-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    text-decoration: none;
    color: #111;
    gap: 15px;
}

.dmp-ajax-result-img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f0f0f0;
}

.dmp-ajax-result-title {
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.4;
}

.dmp-no-results {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dmp-ajax-view-all {
    display: block;
    padding: 15px;
    text-align: center;
    background: #fafafa;
    color: #A11A33;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-decoration: none;
    border-top: 1px solid #eaeaea;
    transition: background-color 0.2s ease;
}

.dmp-ajax-view-all:hover {
    background: #f0f0f0;
}

/* Loading state for search wrapper */
.dmp-is-loading .dmp-search-submit svg {
    animation: dmp-spin 1s linear infinite;
    opacity: 0.5;
}

@keyframes dmp-spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Full Single Product View ([dmp_vista_producto]) */
.dmp-full-product-view {
    display: flex !important;
    flex-wrap: wrap !important;
    max-width: 1200px !important;
    margin: 40px auto !important;
    font-family: inherit !important;
    gap: 40px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.dmp-full-product-gallery {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

.dmp-full-product-image-wrapper {
    position: relative !important;
    width: 100% !important;
    padding-top: 100% !important;
    /* Square */
    background: #f7f7f7 !important;
    overflow: hidden !important;
    border: none !important;
}

.dmp-full-product-image {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border: none !important;
    box-shadow: none !important;
}

.dmp-full-product-details {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    text-align: left !important;
}

.dmp-full-product-title {
    font-size: 24px !important;
    font-weight: 400 !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    color: #111 !important;
    margin: 0 0 20px 0 !important;
    line-height: 1.3 !important;
    text-align: left !important;
    width: 100% !important;
}

.dmp-full-product-description {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 30px;
    width: 100%;
}

.dmp-full-product-description p {
    margin-bottom: 15px;
}

.dmp-full-product-description p:last-child {
    margin-bottom: 0;
}

.dmp-full-product-specs-container {
    margin-bottom: 40px !important;
    width: 100% !important;
}

/* Override specs margin when inside full view */
.dmp-full-product-view .dmp-product-specs {
    margin: 0;
}

.dmp-full-product-action {
    margin-top: auto;
}

.dmp-full-product-contact-btn {
    display: inline-block;
    padding: 15px 35px;
    background-color: #111 !important;
    color: #fff !important;
    text-transform: uppercase;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 2px;
    text-decoration: none !important;
    transition: all 0.3s ease;
    border: 1px solid #111 !important;
    text-align: center;
}

.dmp-full-product-contact-btn:hover {
    background-color: transparent !important;
    color: #111 !important;
}

/* Gallery Thumbnails */
.dmp-product-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.dmp-thumbnail {
    width: 60px;
    height: 60px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.6;
    transition: all 0.3s ease;
    background: #f7f7f7;
}

.dmp-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dmp-thumbnail.active, .dmp-thumbnail:hover {
    opacity: 1;
    border-color: #A11A33;
}

/* WooCommerce Add to Cart overrides */
.dmp-full-product-view form.cart {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.dmp-full-product-view form.cart .button {
    padding: 15px 35px;
    background-color: #111 !important;
    color: #fff !important;
    text-transform: uppercase;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 2px;
    border: 1px solid #111 !important;
    border-radius: 0 !important;
    transition: all 0.3s ease;
}

.dmp-full-product-view form.cart .button:hover {
    background-color: transparent !important;
    color: #111 !important;
}

@media (min-width: 992px) {
    .dmp-full-product-view {
        flex-wrap: nowrap !important;
        flex-direction: row !important;
        gap: 60px !important;
        align-items: flex-start !important;
    }

    .dmp-full-product-gallery {
        width: 50% !important;
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    .dmp-full-product-details {
        width: 50% !important;
        flex: 0 0 50% !important;
        max-width: 50% !important;
        padding-top: 20px !important;
    }
}