/* ============================================================
   Card Watermark Pro v2.0 — Frontend Styles
   All devices: desktop, laptop, mobile, tablet
   ============================================================ */

/* ---- Core container ---- */
.cwp-watermark-container {
    position: relative;
    display: inline-block;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Make it block-level when inside WC loop items */
.woocommerce ul.products li.product .cwp-watermark-container,
.woocommerce-page ul.products li.product .cwp-watermark-container,
.cwp-block-wrap {
    display: block;
    width: 100%;
}

/* ---- Images inside container ---- */
.cwp-watermark-container img {
    display: block;
    max-width: 100%;
    height: auto;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    -moz-user-select: none;
    -webkit-touch-callout: none; /* iOS: prevent save image sheet */
}

/* ---- Canvas overlay ---- */
.cwp-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    touch-action: none;
    z-index: 10;
    display: block;
}

/* ---- Protection tooltip ---- */
.cwp-tip {
    position: fixed;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    z-index: 999999;
    display: none;
    pointer-events: none;
    max-width: 280px;
    text-align: center;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* ---- Screenshot flash overlay ---- */
.cwp-screenshot-flash {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 9999999;
    pointer-events: none;
    display: none;
}

/* ============================================================
   SHOP PAGE / LOOP / CATEGORY — ensure container fills correctly
   ============================================================ */
.woocommerce .cwp-watermark-container {
    display: block;
}

/* Storefront, Twenty themes, Astra, etc. */
.woocommerce ul.products li.product a img {
    pointer-events: none;
}

/* ============================================================
   SHORTCODE: Single card preview
   ============================================================ */
.cwp-shortcode-card {
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.14);
    overflow: hidden;
    max-width: 320px;
    display: inline-block;
}
.cwp-card-info {
    padding: 16px;
    background: #fff;
}
.cwp-card-info h3 {
    margin: 0 0 8px;
    font-size: 16px;
    color: #333;
}
.cwp-price {
    font-size: 18px;
    font-weight: 700;
    color: #0073aa;
    margin: 0 0 12px;
}
.cwp-btn-buy {
    display: inline-block;
    background: #0073aa;
    color: #fff !important;
    padding: 9px 22px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background .2s;
}
.cwp-btn-buy:hover { background: #005a87; }

/* ============================================================
   SHORTCODE: Gallery grid
   ============================================================ */
.cwp-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}
.cwp-gallery-item {
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    transition: transform .2s, box-shadow .2s;
}
.cwp-gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.cwp-gallery-img {
    width: 100%;
    height: auto;
    display: block;
}
.cwp-gallery-info { padding: 12px; }
.cwp-gallery-info h4 { margin: 0 0 6px; font-size: 14px; color: #333; }
.cwp-gallery-price { display: block; color: #0073aa; font-weight: 700; margin-bottom: 8px; }
.cwp-gallery-link {
    display: inline-block;
    background: #28a745;
    color: #fff !important;
    padding: 6px 14px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 13px;
    transition: background .2s;
}
.cwp-gallery-link:hover { background: #1e7e34; }

/* ============================================================
   THANK YOU PAGE — Download section
   ============================================================ */
.cwp-thankyou-downloads {
    background: linear-gradient(135deg, #f0fdf4 0%, #e8f5e9 100%);
    border: 2px solid #4caf50;
    border-radius: 14px;
    padding: 30px;
    margin: 32px 0;
    text-align: center;
}
.cwp-thankyou-downloads h2 {
    color: #2e7d32;
    margin: 0 0 10px;
    font-size: 22px;
}
.cwp-thankyou-downloads > p {
    color: #555;
    margin-bottom: 22px;
}
.cwp-download-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-bottom: 20px;
}
.cwp-download-card {
    background: #fff;
    border-radius: 12px;
    padding: 22px 18px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.09);
    min-width: 170px;
    max-width: 220px;
    text-align: center;
}
.cwp-dl-icon { font-size: 38px; margin-bottom: 10px; }
.cwp-dl-name { font-weight: 600; color: #333; margin-bottom: 12px; font-size: 14px; }
.cwp-dl-btn {
    display: inline-block;
    background: #4caf50;
    color: #fff !important;
    padding: 10px 20px;
    border-radius: 7px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: background .2s;
    margin-bottom: 6px;
}
.cwp-dl-btn:hover { background: #388e3c; }
.cwp-dl-note { font-size: 11px; color: #aaa; }
.cwp-email-note {
    color: #666;
    font-size: 13px;
    margin: 0;
    padding-top: 14px;
    border-top: 1px solid rgba(0,0,0,0.08);
}

/* ORDER DETAIL */
.cwp-order-downloads {
    margin-top: 24px;
    padding: 16px 20px;
    background: #f9f9f9;
    border-left: 4px solid #0073aa;
    border-radius: 5px;
}
.cwp-inline-dl { color: #0073aa; font-weight: 600; text-decoration: none; }
.cwp-inline-dl:hover { text-decoration: underline; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .cwp-gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .cwp-download-grid { flex-direction: column; align-items: center; }
    .cwp-thankyou-downloads { padding: 20px 16px; }
}
@media (max-width: 480px) {
    .cwp-gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .cwp-tip { font-size: 12px; padding: 6px 12px; }
}
