/* ============================================================
   CROMMELINS — Category Products WPBakery Element
   File: assets/css/category-products-element.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Reset ── */
.crommelins-cat-products *,
.crommelins-cat-products *::before,
.crommelins-cat-products *::after {
    box-sizing: border-box;
}

.crommelins-cat-products {
    font-family: 'Inter', sans-serif;
    color: #111111;
    padding: 20px 0;
}

/* ── Notice ── */
.crommelins-cp-notice {
    padding: 16px 20px;
    background: #fff8e7;
    border-left: 4px solid #F5A623;
    border-radius: 6px;
    font-size: 14px;
    color: #555;
    margin: 12px 0;
}

/* ── Section Heading ── */
.crommelins-cp-heading {
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 800;
    color: #111111;
    margin: 0 0 28px 0;
    line-height: 1.2;
    letter-spacing: -0.4px;
}

/* ============================================================
   PRODUCT GRID
   ============================================================ */
.crommelins-cp-grid {
    display: grid;
    gap: 22px;
}

.crommelins-cp-cols-2 { grid-template-columns: repeat(2, 1fr); }
.crommelins-cp-cols-3 { grid-template-columns: repeat(3, 1fr); }
.crommelins-cp-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ============================================================
   PRODUCT CARD
   ============================================================ */
.crommelins-cp-card {
    background: #fff;
    border: 1.5px solid #e8e8e0;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.22s ease;
    position: relative;
}

.crommelins-cp-card:hover {
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.11);
    border-color: #F5A623;
    transform: translateY(-4px);
}

/* ── Image ── */
.crommelins-cp-image {
    position: relative;
    background: #f7f7f4;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.crommelins-cp-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.crommelins-cp-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    padding: 14px;
    transition: transform 0.35s ease;
}

.crommelins-cp-card:hover .crommelins-cp-image img {
    transform: scale(1.06);
}

/* Sale Badge */
.crommelins-cp-badge-sale {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    z-index: 2;
}

/* ── Info Section ── */
.crommelins-cp-info {
    padding: 16px 16px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.crommelins-cp-sku {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: #aaa;
    margin-bottom: 2px;
}

.crommelins-cp-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #111111;
    text-decoration: none;
    line-height: 1.35;
    display: block;
    flex: 1;
    transition: color 0.15s;
    margin-bottom: 12px;
}

.crommelins-cp-title:hover {
    color: #F5A623;
}

/* ── Price (privileged) ── */
.crommelins-cp-price {
    margin-bottom: 10px;
}

.crommelins-cp-price .price {
    font-size: 16px;
    font-weight: 800;
    color: #111111;
}

.crommelins-cp-price .price ins {
    text-decoration: none;
}

.crommelins-cp-price .price del {
    font-size: 12px;
    color: #bbb;
    font-weight: 400;
    margin-right: 4px;
}

/* ── Actions ── */
.crommelins-cp-actions {
    margin-top: auto;
}

/* ── Buttons ── */
.crommelins-cp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    letter-spacing: 0.2px;
}

.crommelins-cp-btn svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
    flex-shrink: 0;
}

/* View Details button */
.crommelins-cp-btn--view {
    background: #111111;
    color: #fff;
}

.crommelins-cp-btn--view:hover {
    background: #111111;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(26, 26, 46, 0.25);
    color: #fff;
}

/* Add to Cart button */
.crommelins-cp-btn--cart {
    background: #F5A623;
    color: #fff;
}

.crommelins-cp-btn--cart:hover {
    background: #e0960e;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(245, 166, 35, 0.35);
    color: #fff;
}

/* Out of Stock */
.crommelins-cp-btn--outofstock {
    background: #f0f0ec;
    color: #aaa;
    cursor: not-allowed;
}

/* Submit button */
.crommelins-cp-btn--submit {
    background: #F5A623;
    color: #fff;
    padding: 13px 28px;
    font-size: 14px;
    width: auto;
    min-width: 160px;
}

.crommelins-cp-btn--submit:hover {
    background: #e0960e;
    transform: translateY(-1px);
}

/* ── Button inner elements (icon / spinner / check / label) ── */
.crommelins-cp-btn--cart {
    gap: 0;
    position: relative;
}

.crommelins-cp-btn-icon,
.crommelins-cp-cart-spinner,
.crommelins-cp-cart-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.crommelins-cp-btn-icon svg,
.crommelins-cp-cart-spinner svg,
.crommelins-cp-cart-check svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.crommelins-cp-btn-label {
    margin-left: 7px;
}

/* Loading state */
.crommelins-cp-btn--cart.cp-cart-loading {
    opacity: 0.8;
    cursor: not-allowed;
    pointer-events: none;
}

/* Added (success) state */
.crommelins-cp-btn--cart.cp-cart-added {
    background: #27ae60;
}

.crommelins-cp-btn--cart.cp-cart-added:hover {
    background: #219a52;
    box-shadow: 0 4px 14px rgba(39, 174, 96, 0.35);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#crommelins-cp-toast-wrap {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.crommelins-cp-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #111111;
    color: #fff;
    padding: 14px 18px;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    max-width: 340px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
    pointer-events: all;
    transform: translateX(20px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    line-height: 1.4;
    border-left: 4px solid transparent;
}

.crommelins-cp-toast.is-visible {
    transform: translateX(0);
    opacity: 1;
}

/* Success */
.crommelins-cp-toast--success {
    border-left-color: #27ae60;
}

.crommelins-cp-toast--success svg {
    width: 20px;
    height: 20px;
    fill: #27ae60;
    flex-shrink: 0;
}

/* Error */
.crommelins-cp-toast--error {
    border-left-color: #e74c3c;
}

.crommelins-cp-toast--error svg {
    width: 20px;
    height: 20px;
    fill: #e74c3c;
    flex-shrink: 0;
}

.crommelins-cp-toast span {
    flex: 1;
}

.crommelins-cp-toast a {
    color: #F5A623;
    text-decoration: none;
    font-weight: 700;
}

.crommelins-cp-toast a:hover {
    text-decoration: underline;
}

.crommelins-cp-toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 0 0 6px;
    flex-shrink: 0;
    transition: color 0.15s;
}

.crommelins-cp-toast-close:hover {
    color: #fff;
}

@media (max-width: 480px) {
    #crommelins-cp-toast-wrap {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }

    .crommelins-cp-toast {
        max-width: 100%;
    }
}

/* ============================================================
   GRAVITY FORM POPUP OVERLAY
   ============================================================ */
.crommelins-cp-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 30, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.crommelins-cp-popup-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* Popup Box */
.crommelins-cp-popup-box {
    background: #fff;
    border-radius: 18px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
    transform: translateY(24px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    scrollbar-width: thin;
    scrollbar-color: #F5A623 #f0f0ec;
}

.crommelins-cp-popup-overlay.is-open .crommelins-cp-popup-box {
    transform: translateY(0) scale(1);
}

.crommelins-cp-popup-box::-webkit-scrollbar {
    width: 5px;
}

.crommelins-cp-popup-box::-webkit-scrollbar-track {
    background: #f0f0ec;
    border-radius: 10px;
}

.crommelins-cp-popup-box::-webkit-scrollbar-thumb {
    background: #F5A623;
    border-radius: 10px;
}

/* ── Close Button ── */
.crommelins-cp-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    border: none;
    background: #f5f5f0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.15s;
    z-index: 10;
}

.crommelins-cp-popup-close svg {
    width: 16px;
    height: 16px;
    fill: #555;
}

.crommelins-cp-popup-close:hover {
    background: #ffe4a8;
    transform: rotate(90deg);
}

/* ── Popup Header ── */
.crommelins-cp-popup-header {
    padding: 30px 32px 20px;
    border-bottom: 1.5px solid #f0f0ec;
    background: linear-gradient(135deg, #111111 0%, #111111 100%);
    border-radius: 18px 18px 0 0;
    position: relative;
}

.crommelins-cp-popup-tag {
    display: inline-block;
    padding: 4px 12px;
    background: #F5A623;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.crommelins-cp-popup-product-name {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 6px 0;
    line-height: 1.25;
    padding-right: 40px;
}

.crommelins-cp-popup-product-sku {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.4px;
}

/* Override close button background for dark header */
.crommelins-cp-popup-header ~ .crommelins-cp-popup-close,
.crommelins-cp-popup-box .crommelins-cp-popup-close {
    background: rgba(255,255,255,0.15);
}

.crommelins-cp-popup-box .crommelins-cp-popup-close svg {
    fill: #fff;
}

.crommelins-cp-popup-box .crommelins-cp-popup-close:hover {
    background: rgba(255,255,255,0.3);
}

/* ── Popup Body ── */
.crommelins-cp-popup-body {
    padding: 28px 32px 32px;
}

/* ============================================================
   FALLBACK FORM STYLES
   ============================================================ */
.crommelins-cp-fallback-form .crommelins-cp-form-row {
    margin-bottom: 16px;
}

.crommelins-cp-fallback-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #111111;
    margin-bottom: 6px;
}

.crommelins-cp-fallback-form label .req {
    color: #e74c3c;
    margin-left: 2px;
}

.crommelins-cp-fallback-form input[type="text"],
.crommelins-cp-fallback-form input[type="email"],
.crommelins-cp-fallback-form input[type="tel"],
.crommelins-cp-fallback-form textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #111111;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
    background: #fff;
}

.crommelins-cp-fallback-form input:focus,
.crommelins-cp-fallback-form textarea:focus {
    border-color: #F5A623;
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15);
}

.crommelins-cp-fallback-form input.error,
.crommelins-cp-fallback-form textarea.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.12);
}

.crommelins-cp-fallback-form textarea {
    resize: vertical;
    min-height: 110px;
}

.crommelins-cp-form-error {
    background: #fef0ef;
    border: 1px solid #e74c3c;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    color: #c0392b;
    margin-bottom: 14px;
}

.crommelins-cp-form-actions {
    text-align: right;
}

/* Success State */
.crommelins-cp-form-success {
    text-align: center;
    padding: 20px 0;
}

.crommelins-cp-form-success svg {
    width: 52px;
    height: 52px;
    fill: #27ae60;
    margin-bottom: 14px;
}

.crommelins-cp-form-success .success-msg {
    font-size: 15px;
    font-weight: 600;
    color: #111111;
    margin: 0;
    line-height: 1.5;
}

/* ── Spinner ── */
.spin-icon {
    width: 18px;
    height: 18px;
    fill: #fff;
    animation: cp-spin 0.7s linear infinite;
}

@keyframes cp-spin {
    to { transform: rotate(360deg); }
}

/* ── Body scroll lock ── */
body.crommelins-cp-open {
    overflow: hidden;
}

/* ============================================================
   GRAVITY FORMS OVERRIDES inside popup
   ============================================================ */
.crommelins-cp-popup-body .gform_wrapper {
    margin: 0 !important;
}

.crommelins-cp-popup-body .gform_wrapper .gfield_label {
    font-family: 'Inter', sans-serif !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #111111 !important;
}

.crommelins-cp-popup-body .gform_wrapper input[type="text"],
.crommelins-cp-popup-body .gform_wrapper input[type="email"],
.crommelins-cp-popup-body .gform_wrapper input[type="tel"],
.crommelins-cp-popup-body .gform_wrapper input[type="number"],
.crommelins-cp-popup-body .gform_wrapper textarea,
.crommelins-cp-popup-body .gform_wrapper select {
    border: 1.5px solid #e0e0e0 !important;
    border-radius: 8px !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 14px !important;
    padding: 10px 13px !important;
    transition: border-color 0.18s, box-shadow 0.18s !important;
    width: 100% !important;
}

.crommelins-cp-popup-body .gform_wrapper input:focus,
.crommelins-cp-popup-body .gform_wrapper textarea:focus,
.crommelins-cp-popup-body .gform_wrapper select:focus {
    border-color: #F5A623 !important;
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15) !important;
    outline: none !important;
}

.crommelins-cp-popup-body .gform_wrapper .gform_submit_button,
.crommelins-cp-popup-body .gform_wrapper input[type="submit"] {
    background: #F5A623 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 12px 28px !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: background 0.2s ease, transform 0.15s ease !important;
}

.crommelins-cp-popup-body .gform_wrapper .gform_submit_button:hover,
.crommelins-cp-popup-body .gform_wrapper input[type="submit"]:hover {
    background: #e0960e !important;
    transform: translateY(-1px) !important;
}

.crommelins-cp-popup-body .gform_wrapper .gform_validation_errors,
.crommelins-cp-popup-body .gform_wrapper .validation_error {
    border-radius: 8px !important;
    font-family: 'Inter', sans-serif !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
    .crommelins-cp-cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .crommelins-cp-cols-3,
    .crommelins-cp-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .crommelins-cp-popup-box {
        max-width: 100%;
        border-radius: 14px;
    }

    .crommelins-cp-popup-header,
    .crommelins-cp-popup-body {
        padding-left: 22px;
        padding-right: 22px;
    }

    .crommelins-cp-popup-product-name {
        font-size: 17px;
    }
}

@media (max-width: 480px) {
    .crommelins-cp-cols-2,
    .crommelins-cp-cols-3,
    .crommelins-cp-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .crommelins-cp-grid {
        gap: 14px;
    }

    .crommelins-cp-title {
        font-size: 12px;
    }

    .crommelins-cp-btn {
        font-size: 12px;
        padding: 9px 10px;
    }
}
