@import url('//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css');

/* =============================================
   MAIN CONTAINER
   ============================================= */
.cfpd-main-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* =============================================
   FILTER PILLS
   ============================================= */
.cfpd-main-content .filter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.cfpd-main-content .filter-dropdown {
    position: relative;
    border: none;
}

.cfpd-main-content .filter-dropdown a.js-link {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 50px;
    border: 1.5px solid #d5d5d5;
    background-color: #fff;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cfpd-main-content .filter-dropdown a.js-link:hover {
    border-color: #999;
    background-color: #f5f5f5;
}

.cfpd-main-content .filter-dropdown a.js-link.active {
    background-color: #ce171e;
    border-color: #ce171e;
    color: #fff;
}

.cfpd-main-content .filter-dropdown .fa {
    margin-left: 6px;
    font-size: 12px;
}

/* Dropdown list */
.cfpd-main-content .filter-dropdown ul {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 220px;
    z-index: 9999;
    background: #fff;
    list-style-type: none;
    padding: 6px 0;
    margin: 0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border: 1px solid #e2e2e2;
}

.cfpd-main-content .filter-dropdown li {
    padding: 10px 18px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.15s ease;
}

.cfpd-main-content .filter-dropdown li:hover {
    background: #f5f5f5;
}

/* =============================================
   PRODUCT GRID — 3 columns
   ============================================= */
.cfpd-main-content .product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    position: relative;
}

@media (max-width: 960px) {
    .cfpd-main-content .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .cfpd-main-content .product-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   PRODUCT CARD
   ============================================= */
.cfpd-main-content .product-card {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border-radius: 6px;
    border: 1px solid #e8e8e8;
    cursor: pointer;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.cfpd-main-content .product-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.cfpd-main-content .product-card .product-img {
    width: 100%;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #f9f9f9;
    position: relative;
}

.cfpd-main-content .product-card .product-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease-in-out;
}

.cfpd-main-content .product-card:hover .product-img img {
    transform: scale(1.05);
}

.cfpd-main-content .sale-label {
    display: inline-block;
    padding: 5px 14px;
    line-height: normal;
    background-color: #ce171e;
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
}

.cfpd-main-content .product-card .product-content {
    padding: 16px 18px 20px;
    text-align: left;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.cfpd-main-content .product-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #1a1a1a;
    font-style: normal;
    line-height: 1.3;
}

.cfpd-main-content .product-card p {
    font-size: 14px;
    color: #555;
    margin: 0 0 4px 0;
    padding: 0;
    line-height: 1.5;
}

.cfpd-main-content .product-card .price {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-top: auto;
    padding-top: 8px;
}

.cfpd-main-content .product-card .price .old-price {
    color: #999;
    font-weight: 400;
    text-decoration: line-through;
}

.cfpd-main-content .product-card .price .discount-price {
    color: #ce171e;
    font-weight: 700;
    margin-left: 6px;
}

/* =============================================
   PAGINATION
   ============================================= */
.cfpd-main-content .product-pagination {
    margin-top: 32px;
}

.cfpd-main-content .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 0;
}

.cfpd-main-content .page-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 6px 14px;
    background-color: #f1f1f1;
    border: 1.5px solid #d5d5d5;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.cfpd-main-content .page-number:hover {
    border-color: #999;
    background-color: #e8e8e8;
    color: #333;
}

.cfpd-main-content .page-number.active {
    background-color: #ce171e;
    border-color: #ce171e;
    color: #fff;
}

.cfpd-main-content .pagination span {
    padding: 0 4px;
    color: #999;
    font-size: 14px;
}

/* =============================================
   LOADER & OVERLAY
   ============================================= */
.cfpd-loader {
    display: none;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    border: 4px solid #e8e8e8;
    border-radius: 50%;
    border-top: 4px solid #ce171e;
    width: 44px;
    height: 44px;
    animation: spin 0.8s linear infinite;
}

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

.cfpd-overlay {
    display: none;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    z-index: 9998;
}


/* =============================================
   FULLSCREEN MODAL
   ============================================= */
.cfpd-main-content #product-modal,
body > #product-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: #fff;
    z-index: 2147483647;
    overflow-y: auto;
    transform: none;
}

/* Modal inner wrapper */
.cfpd-modal {
    width: 100%;
    min-height: 100vh;
    position: relative;
    background: #fff;
}

/* Close button */
.cfpd-modal-close {
    position: fixed;
    top: 20px;
    right: 24px;
    z-index: 2147483647;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #ce171e;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    padding: 0;
}

.cfpd-modal-close:hover {
    background: #a81215;
    transform: scale(1.1);
}

/* Modal layout: image left, details right */
.cfpd-modal-inner {
    display: flex;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
}

/* Image section — left half */
.cfpd-modal-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7f7f7;
    padding: 60px 40px;
    position: relative;
    min-height: 100vh;
}

.cfpd-modal-image img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.cfpd-modal-badge {
    position: absolute;
    top: 24px;
    left: 24px;
    background: #ce171e;
    color: #fff;
    padding: 6px 18px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Details section — right half */
.cfpd-modal-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 50px;
    max-width: 600px;
}

.cfpd-modal-details-inner {
    margin-bottom: 40px;
}

/* Category label */
.cfpd-modal-category {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ce171e;
    margin: 0 0 8px 0;
    padding: 0;
}

/* Product title */
.cfpd-modal-title {
    font-size: 28px;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.25;
    margin: 0 0 20px 0;
    font-style: normal;
}

/* Price */
.cfpd-modal-price {
    margin-bottom: 24px;
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.cfpd-modal-price-old {
    font-size: 18px;
    color: #999;
    text-decoration: line-through;
    font-weight: 400;
}

.cfpd-modal-price-current {
    font-size: 24px;
    font-weight: 800;
    color: #1a1a1a;
}

/* Specs */
.cfpd-modal-specs {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
    padding: 20px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.cfpd-modal-spec {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.cfpd-modal-spec-label {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    min-width: 120px;
}

.cfpd-modal-spec-value {
    font-size: 15px;
    color: #555;
}

/* Availability */
.cfpd-modal-availability {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.cfpd-modal-availability svg {
    flex-shrink: 0;
}

/* Phone */
.cfpd-modal-phone {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #ce171e;
    text-decoration: none;
    transition: opacity 0.2s;
}

.cfpd-modal-phone:hover {
    opacity: 0.8;
}

/* =============================================
   MODAL CONTACT FORM
   ============================================= */
.cfpd-modal-form {
    border-top: 1px solid #eee;
    padding-top: 28px;
}

.cfpd-modal-form h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 16px 0;
}

.cfpd-modal-form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.cfpd-modal-form input[type="text"],
.cfpd-modal-form input[type="email"] {
    flex: 1;
    padding: 12px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    font-size: 15px;
    background: #fafafa;
    color: #333;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
}

.cfpd-modal-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    font-size: 15px;
    background: #fafafa;
    color: #333;
    height: 100px;
    resize: none;
    margin-bottom: 16px;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
}

.cfpd-modal-form input:focus,
.cfpd-modal-form textarea:focus {
    outline: none;
    border-color: #ce171e;
    background: #fff;
}

.cfpd-modal-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 36px;
    background: #ce171e;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    float: right;
}

.cfpd-modal-submit:hover {
    background: #a81215;
}


/* =============================================
   MODAL RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
    .cfpd-modal-inner {
        flex-direction: column;
        min-height: auto;
    }

    .cfpd-modal-image {
        min-height: auto;
        padding: 40px 20px;
        max-height: 50vh;
    }

    .cfpd-modal-image img {
        max-height: 40vh;
    }

    .cfpd-modal-details {
        max-width: 100%;
        padding: 30px 24px 40px;
    }

    .cfpd-modal-close {
        top: 12px;
        right: 12px;
        width: 38px;
        height: 38px;
        font-size: 24px;
    }

    .cfpd-modal-title {
        font-size: 22px;
    }

    .cfpd-modal-form-row {
        flex-direction: column;
        gap: 0;
    }

    .cfpd-modal-form input[type="text"],
    .cfpd-modal-form input[type="email"] {
        margin-bottom: 12px;
    }

    .cfpd-modal-submit {
        width: 100%;
        float: none;
    }
}

/* =============================================
   FILTER RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    .cfpd-main-content .filter-grid {
        gap: 8px;
    }

    .cfpd-main-content .filter-dropdown a.js-link {
        padding: 8px 16px;
        font-size: 14px;
    }
}
